Class AbstractServiceScheme<D extends ServiceDependencies>

    • Constructor Detail

      • AbstractServiceScheme

        public AbstractServiceScheme()
    • Method Detail

      • realizeService

        public Service realizeService​(ParameterResolver resolver,
                                      ClassLoader loader,
                                      Cluster cluster)
        Realize (ensure) a Service. The returned Service is fully configured and ready to be used.
        Specified by:
        realizeService in interface ServiceBuilder
        Parameters:
        resolver - the ParameterResolver
        loader - the ClassLoader
        cluster - the Cluster which will already be running if necessary
        Returns:
        the Service
      • isRunningClusterNeeded

        public abstract boolean isRunningClusterNeeded()
        Return true if a running cluster is needed before using a service.
        Specified by:
        isRunningClusterNeeded in interface ServiceBuilder
        Returns:
        true if a running cluster is needed before using a service
      • setScopeName

        @Injectable
        public void setScopeName​(String sName)
        Set the scope name.
        Parameters:
        sName - the scope name
      • setXml

        @Deprecated
        public void setXml​(XmlElement element)
        Deprecated.
        Deprecated: Set the XML so that we can create a Service using the SafeCluster.ensureService.
        Specified by:
        setXml in interface ServiceBuilder
        Parameters:
        element - the distributed-scheme XML
      • isAutoStart

        public boolean isAutoStart()
        Return true if the service has auto-start enabled.
        Specified by:
        isAutoStart in interface ServiceScheme
        Returns:
        the auto-start flag.
      • setAutoStart

        @Injectable("autostart")
        public void setAutoStart​(boolean fEnabled)
        Set the auto-start enabled flag.
        Parameters:
        fEnabled - the auto-start enabled flag
      • setServiceName

        @Injectable
        public void setServiceName​(String sName)
        Set the service name.
        Parameters:
        sName - the service name.
      • getScopedServiceName

        public String getScopedServiceName()
        Return the service name with any scoping applied. The scoped name in general has the following format:
           [<domain-partition-name>'/'] [<application-scope>':'] <service-name>
         
        Specified by:
        getScopedServiceName in interface ServiceScheme
        Returns:
        the scoped service name
      • injectScopeNameIntoService

        protected void injectScopeNameIntoService​(Service service)
        Get the wrapped Service from the SafeService and invoke setScopeName() on the wrapped Service.
        Parameters:
        service - The safe service
      • setServiceDependencies

        public void setServiceDependencies​(D dependencies)
        Set the ServiceDependencies to be used by this scheme when configuring a newly realized Service.
        Parameters:
        dependencies - the ServiceDependencies object
      • getDefaultServiceName

        protected String getDefaultServiceName()
        DefaultServiceName to use if none configured.
        Returns:
        default service name