Class ServicePoolAgent

  • All Implemented Interfaces:
    IServicePoolService

    public class ServicePoolAgent
    extends java.lang.Object
    implements IServicePoolService
    The service pool agent can be used to handle services in a pooled manner. Via its service pool service interface new service types can be registered (and removed). For each registered service the agent will create a proxy service that is found via search. Incoming service invocations are routed towards the concrete handler agents that are either already in the pool or are created up to a creation limit.
    • Field Detail

      • servicetypes

        protected java.util.Map<java.lang.Class<?>,​ServiceHandler> servicetypes
        The registered service types.
    • Constructor Detail

      • ServicePoolAgent

        public ServicePoolAgent()
    • Method Detail

      • agentCreated

        public IFuture<java.lang.Void> agentCreated()
        Called once after agent creation.
      • addServiceType

        public IFuture<java.lang.Void> addServiceType​(java.lang.Class<?> servicetype,
                                                      java.lang.String componentmodel)
        Add a new service type and a strategy.
        Specified by:
        addServiceType in interface IServicePoolService
        Parameters:
        servicetype - The service type.
        componentmodel - The component model.
      • addServiceType

        public IFuture<java.lang.Void> addServiceType​(java.lang.Class<?> servicetype,
                                                      java.lang.String componentmodel,
                                                      CreationInfo info)
        Add a new service type and a strategy.
        Specified by:
        addServiceType in interface IServicePoolService
        Parameters:
        servicetype - The service type.
        componentmodel - The component model.
        info - The creation info.
      • addServiceType

        public IFuture<java.lang.Void> addServiceType​(java.lang.Class<?> servicetype,
                                                      IPoolStrategy strategy,
                                                      java.lang.String componentmodel)
        Add a new service type and a strategy.
        Specified by:
        addServiceType in interface IServicePoolService
        Parameters:
        servicetype - The service type.
        strategy - The service pool strategy.
        componentmodel - The component model.
      • addServiceType

        public IFuture<java.lang.Void> addServiceType​(java.lang.Class<?> servicetype,
                                                      IPoolStrategy strategy,
                                                      java.lang.String componentmodel,
                                                      CreationInfo info,
                                                      PublishInfo pi)
        Add a new service type and a strategy.
        Parameters:
        servicetype - The service type.
        strategy - The service pool strategy.
      • addServiceType

        public IFuture<java.lang.Void> addServiceType​(java.lang.Class<?> servicetype,
                                                      IPoolStrategy strategy,
                                                      java.lang.String componentmodel,
                                                      CreationInfo info,
                                                      PublishInfo pi,
                                                      ServiceScope scope)
        Add a new service type and a strategy.
        Specified by:
        addServiceType in interface IServicePoolService
        Parameters:
        servicetype - The service type.
        strategy - The service pool strategy.
        componentmodel - The component model.
        info - The worker creation info.
        pi - The worker publish info.
        scope - The service publication scope.
      • removeServiceType

        public IFuture<java.lang.Void> removeServiceType​(java.lang.Class<?> servicetype)
        Remove a service type.
        Specified by:
        removeServiceType in interface IServicePoolService
        Parameters:
        servicetype - The service type.
      • getDefaultStrategy

        protected IPoolStrategy getDefaultStrategy()