Package jade.core

Class ServiceManagerImpl

  • All Implemented Interfaces:
    ServiceFinder, ServiceManager

    public class ServiceManagerImpl
    extends Object
    implements ServiceManager, ServiceFinder
    The ServiceManagerImpl class is the actual implementation of JADE platform Service Manager and Service Finder components. It holds a set of services and manages them.
    Author:
    Giovanni Rimassa - FRAMeTech s.r.l., Giovanni Caire - TILAB
    • Method Detail

      • getPlatformName

        public String getPlatformName()
                               throws IMTPException
        Description copied from interface: ServiceManager
        Retrieves the platform name from the platform Service Manager.
        Specified by:
        getPlatformName in interface ServiceManager
        Returns:
        The name of the platform, that can be used to compose the GUID of the resident agents.
        Throws:
        IMTPException - If an underlying network error forbids to fetch the name from the remote end.
      • addAddress

        public void addAddress​(String addr)
                        throws IMTPException
        Description copied from interface: ServiceManager
        Adds an address to the address list of this Service Manager.
        Specified by:
        addAddress in interface ServiceManager
        Parameters:
        addr - The address to add, as a stringified URL.
        Throws:
        IMTPException - If an underlying network error occurs.
      • removeAddress

        public void removeAddress​(String addr)
                           throws IMTPException
        Description copied from interface: ServiceManager
        Removes an address to the address list of this Service Manager.
        Specified by:
        removeAddress in interface ServiceManager
        Parameters:
        addr - The address to remove, as a stringified URL.
        Throws:
        IMTPException - If an underlying network error occurs.
      • addNode

        public void addNode​(NodeDescriptor desc,
                            ServiceDescriptor[] services)
                     throws IMTPException,
                            ServiceException,
                            JADESecurityException
        Description copied from interface: ServiceManager
        Adds a new node to the distributed platform. The node abstraction can correspond to an agent container, but also to a different kind of networked component (command proxy server, persistent repository, etc.) of the JADE platform.
        Specified by:
        addNode in interface ServiceManager
        Parameters:
        desc - The description of the new node to add, containing the node identifier and other node properties.
        services - An array of ServiceDescriptor objects, describing the various kernel-level services that are to be activated on the newly created node.
        Throws:
        IMTPException - If an underlying network error forbids to tell whether the requested operation was possible. In that case, the operation is not executed.
        ServiceException - If the requested operation couldn't be executed (or an execution attempt failed) due to some condition on the remote end.
        JADESecurityException
      • removeNode

        public void removeNode​(NodeDescriptor desc)
                        throws IMTPException,
                               ServiceException
        Description copied from interface: ServiceManager
        Removes a node from the distributed platform. The node abstraction can correspond to an agent container, but also to a different kind of networked component (command proxy server, persistent repository, etc.) of the JADE platform.
        Specified by:
        removeNode in interface ServiceManager
        Parameters:
        desc - The description of the node to remove. At the very least, the description must contain a node identifier used as a key in node findng operations.
        Throws:
        IMTPException - If an underlying network error forbids to tell whether the requested operation was possible. In that case, the operation is not executed.
        ServiceException - If the requested operation couldn't be executed (or an execution attempt failed) due to some condition on the remote end.
      • activateService

        public void activateService​(ServiceDescriptor desc)
                             throws IMTPException,
                                    ServiceException
        Description copied from interface: ServiceManager
        Activates a new service on the local agent container. Depending on whether the service is already active on other containers, the result can be the actual federation of this container and other containers service slices.
        Specified by:
        activateService in interface ServiceManager
        Parameters:
        desc - The ServiceDescriptor object specifying the Service object implementing the service, along with the name and properties of the service.
        Throws:
        IMTPException - If an underlying network error forbids to tell whether the requested operation was possible. In that case, the operation is not executed.
        ServiceException - If the requested operation couldn't be executed (or an execution attempt failed) due to some condition on the remote end.
        See Also:
        ServiceFinder
      • deactivateService

        public void deactivateService​(String name)
                               throws IMTPException,
                                      ServiceException
        Description copied from interface: ServiceManager
        Deactivates a service on the local container. Depending on whether the service is enabled also on other containers, this method can cause the complete service deactivation on the platform or just the detchmnent of the service slice corresponding to this container.
        Specified by:
        deactivateService in interface ServiceManager
        Parameters:
        name - The name of the service to be deactivated.
        Throws:
        IMTPException - If an underlying network error forbids to tell whether the requested operation was possible. In that case, the operation is not executed.
        ServiceException - If the requested operation couldn't be executed (or an execution attempt failed) due to some condition on the remote end.
        See Also:
        ServiceFinder
      • getLocalServices

        public Vector getLocalServices()
        Description copied from interface: ServiceManager
        Retrieve the list of locally installed services as a Vector of ServiceDescriptor objects
        Specified by:
        getLocalServices in interface ServiceManager
        Returns:
        the list of locally installed services as a Vector of ServiceDescriptor objects