public function createServiceInterface(string $class_name) : INabuMessagingServiceInterface
    {
        $nb_engine = CNabuEngine::getEngine();
        $nb_descriptor = $nb_engine->getProviderInterfaceDescriptor(
            $this->getVendorKey(), $this->getModuleKey(),
            CNabuProviderFactory::INTERFACE_MESSAGING_SERVICE, $class_name
        );

        if ($nb_descriptor instanceof CNabuProviderInterfaceDescriptor) {
            $fullname = $nb_descriptor->getNamespace() . "\\services\\$class_name";
            if ($nb_engine->preloadClass($fullname)) {
                $interface = new $fullname($this);
                if ($this->registerServiceInterface($interface)) {
                    return $interface;
                } else {
                    throw new ENabuMessagingException(
                        ENabuMessagingException::ERROR_SERVICE_CANNOT_BE_INSTANTIATED,
                        array($class_name)
                    );
                }
            } else {
                throw new ENabuMessagingException(
                    ENabuMessagingException::ERROR_INVALID_SERVICE_CLASS_NAME, array($class_name)
                );
            }
        } else {
            throw new ENabuProviderException(
                ENabuProviderException::ERROR_INTERFACE_DESCRIPTOR_NOT_FOUND, array($class_name)
            );
        }
    }
public function createServiceInterface(string $class_name) : INabuMessagingServiceInterface
    {
        $nb_engine = CNabuEngine::getEngine();
        $nb_descriptor = $nb_engine->getProviderInterfaceDescriptor(
            $this->getVendorKey(), $this->getModuleKey(),
            CNabuProviderFactory::INTERFACE_MESSAGING_SERVICE, $class_name
        );

        if ($nb_descriptor instanceof CNabuProviderInterfaceDescriptor) {
            $fullname = $nb_descriptor->getNamespace() . "\\services\\$class_name";
            if ($nb_engine->preloadClass($fullname)) {
                $interface = new $fullname($this);
                if ($this->registerServiceInterface($interface)) {
                    return $interface;
                } else {
                    throw new ENabuMessagingException(
                        ENabuMessagingException::ERROR_SERVICE_CANNOT_BE_INSTANTIATED,
                        array($class_name)
                    );
                }
            } else {
                throw new ENabuMessagingException(
                    ENabuMessagingException::ERROR_INVALID_SERVICE_CLASS_NAME, array($class_name)
                );
            }
        } else {
            throw new ENabuProviderException(
                ENabuProviderException::ERROR_INTERFACE_DESCRIPTOR_NOT_FOUND, array($class_name)
            );
        }
    }
public function createServiceInterface ( string $ class_name ) : INabuMessagingServiceInterface { $ nb_engine = CNabuEngine :: getEngine ( ) ; $ nb_descriptor = $ nb_engine -> getProviderInterfaceDescriptor ( $ this -> getVendorKey ( ) , $ this -> getModuleKey ( ) , CNabuProviderFactory :: INTERFACE_MESSAGING_SERVICE , $ class_name ) ; if ( $ nb_descriptor instanceof CNabuProviderInterfaceDescriptor ) { $ fullname = $ nb_descriptor -> getNamespace ( ) . "\\services\\$class_name" ; if ( $ nb_engine -> preloadClass ( $ fullname ) ) { $ interface = new $ fullname ( $ this ) ; if ( $ this -> registerServiceInterface ( $ interface ) ) { return $ interface ; } else { throw new ENabuMessagingException ( ENabuMessagingException :: ERROR_SERVICE_CANNOT_BE_INSTANTIATED , array ( $ class_name ) ) ; } } else { throw new ENabuMessagingException ( ENabuMessagingException :: ERROR_INVALID_SERVICE_CLASS_NAME , array ( $ class_name ) ) ; } } else { throw new ENabuProviderException ( ENabuProviderException :: ERROR_INTERFACE_DESCRIPTOR_NOT_FOUND , array ( $ class_name ) ) ; } }
Create a Service Interface to manage a Messaging service.
This method is intended to speed up the creation of Service Interfaces in descendant Messaging modules.
@param string $class_name Class name to be instantiated.
@return INabuMessagingServiceInterface Returns a valid instance if $name is a valid name.
@throws ENabuMessagingException Raises an exception if the interface name is invalid.
Create a Service Interface to manage a Messaging service . This method is intended to speed up the creation of Service Interfaces in descendant Messaging modules .