Interface IService

    • Method Detail

      • preRegister

        void preRegister​(SessionConfig sessionConfig,
                         org.w3c.dom.Node serviceXmlNode,
                         ITransaction transaction)
                  throws PortalException
        Called by the service manager when a service definition is about to be registered. This method allows the Service implementation to set its default values into the service definition xml.
        Parameters:
        sessionConfig - TODO
        serviceXmlNode -
        transaction - TODO
        Throws:
        PortalException
      • postRegister

        void postRegister​(SessionConfig sessionConfig,
                          ServiceConfig serviceConfig,
                          ITransaction transaction)
                   throws PortalException
        Called by the service manager after a service definition is registered. This method allows the Service implementation to perform any custom registration that the service may require.
        Parameters:
        serviceXmlNode -
        Throws:
        PortalException
      • preUnregister

        void preUnregister​(SessionConfig sessionConfig,
                           ITransaction transaction)
                    throws PortalException
        Called by the service manager when a service is about to be unregistered.
        Parameters:
        sessionConfig - the user session information.
        transaction - transaction for persistence access.
        Throws:
        PortalException
      • postUnregister

        void postUnregister​(SessionConfig sessionConfig,
                            ITransaction transaction)
                     throws PortalException
        Called by the service manager after a service has been unregistered.
        Parameters:
        sessionConfig - the user session information.
        transaction - transaction for persistence access.
        Throws:
        PortalException
      • load

        void load​(ServiceConfig config)
           throws ServiceException,
                  PortalException
        Called by the service container to indicate to a service that the service is being activated.

        The service container calls the init method exactly once after instantiating the service. The init method must complete successfully before any interfaces are created.

        The service container cannot place the service into service if the init method

        1. Throws a ServiceException
        2. Does not return within a time period defined by the service container.
        Parameters:
        config - a ServiceConfig object containing the service's configuration and initialization parameters
        Throws:
        ServiceException - if an exception has occurred that interferes with the service interface's normal operation.
        PortalException
      • unload

        void unload​(ServiceConfig config)
             throws ServiceException,
                    PortalException
        Called by the service container to indicate to a service that the it is being de-activated.

        Before the service container calls the destroy method, it should allow any threads that are currently processing requests within the service object to complete execution. To avoid waiting forever, the service container can optionally wait for a predefined time before destroying the service object.

        This method enables the service to do the following:

        • clean up any resources that it holds (for example, memory, file handles, threads)
        • make sure that any persistent state is synchronized with the service current state in memory.
        Parameters:
        config - a ServiceConfig object containing the service's configuration
        Throws:
        ServiceException
        PortalException
      • instanceLoaded

        @Deprecated
        void instanceLoaded​(ServiceInstanceConfig config)
                     throws ServiceException,
                            PortalException
        Deprecated.
        Since 11.2.0 because this method was never called and may be removed in the future.
        Called by the service container to indicate that a service instance has been loaded
        Parameters:
        config - a ServiceInstanceConfig object containing the service's configuration
        Throws:
        ServiceException
        PortalException
      • instanceUnloaded

        @Deprecated
        void instanceUnloaded​(ServiceInstanceConfig config)
                       throws ServiceException,
                              PortalException
        Deprecated.
        Since 11.2.0 because this method was never called and may be removed in the future.
        Called by the service container to indicate that a service instance is about to be unloaded
        Parameters:
        config - a ServiceInstanceConfig object containing the service's configuration
        Throws:
        ServiceException
        PortalException
      • instanceSerialized

        void instanceSerialized​(ServiceInstanceSerializationContext serviceInstanceSerializationContext)
                         throws PortalException
        Called after the serialization of a service instance. The service may serialize additional structure or data
        Parameters:
        sessionConfig -
        serviceInstanceSerializationContext -
        transaction -
        Throws:
        PortalException
      • getDefaultServiceInstanceMenu

        org.w3c.dom.Element getDefaultServiceInstanceMenu​(ServiceInstanceConfig serviceInstance)
                                                   throws PortalException
        Returns the default service instance menu definition to use for a service instance.

        This default is used if this service does not have a explicit menu definition in its servicedefinition.xml.

        Parameters:
        serviceInstance - the service instance.
        Returns:
        the menu definition.
        Throws:
        PortalException - if the menu could not be generated.
        Since:
        8.2.0
      • checkFileAccess

        default boolean checkFileAccess​(FileConfig file)
                                 throws PortalException
        Returns whether the current user has access to the given file.
        Parameters:
        file - the file.
        Throws:
        PortalException
        Since:
        10.1.0