Class TopService


  • final class TopService
    extends java.lang.Object
    A description of an instance of a module.
    • Field Detail

      • key

        ProtocolKey key
        The idenity of this service, note that it may not be active yet.
      • inShutdown

        boolean inShutdown
      • serviceType

        PersistentService serviceType
        The type of service this was created by. If null then this is a non-persistent service.
      • serviceLocale

        java.util.Locale serviceLocale
    • Method Detail

      • setTopModule

        void setTopModule​(java.lang.Object instance)
      • getService

        java.lang.Object getService()
      • isPotentialService

        boolean isPotentialService​(ProtocolKey otherKey)
      • isActiveService

        boolean isActiveService()
      • isActiveService

        boolean isActiveService​(ProtocolKey otherKey)
      • findModule

        java.lang.Object findModule​(ProtocolKey key,
                                    boolean findOnly,
                                    java.util.Properties properties)
        Find an module in the protocol table that supports the required protocol name combination and can handle the properties. Returns the instance of the module or null if one does not exist in the protocol table.
      • findModuleInstance

        private ModuleInstance findModuleInstance​(java.lang.Object instance)
        Find a ModuleInstance object whose getInstance() method returns the object specified by the instance parameter.
        Parameters:
        instance - the instance to look for
        Returns:
        a ModuleInstance object, or null if no match was found
      • bootModule

        java.lang.Object bootModule​(boolean create,
                                    java.lang.Object service,
                                    ProtocolKey key,
                                    java.util.Properties properties)
                             throws StandardException
        Boot a module, performs three steps.
        1. Look for an existing module in the protocol table
        2. Look for a module in the implementation table that handles this protocol
        3. Create an instance that handles this protocol.
        Throws:
        StandardException
      • shutdown

        boolean shutdown()
        If the service is already beign shutdown we return false.
      • addToProtocol

        private boolean addToProtocol​(ProtocolKey key,
                                      ModuleInstance module)
        Add a running module into the protocol hash table. Return true if the module was added successfully, false if it couldn't be added. In the latter case the module should be shutdown if its reference count is 0.
      • inService

        boolean inService​(java.lang.Object instance)
      • stop

        private static void stop​(java.lang.Object instance)