Class ClientServiceManager


public class ClientServiceManager extends ServiceManager<ClientServiceManager>
Manages ClientServices on behalf of a network Client object.
  • Constructor Details

    • ClientServiceManager

      public ClientServiceManager(Client client)
      Creates a new ClientServiceManager for the specified network Client.
  • Method Details

    • getClient

      public Client getClient()
      Returns the network Client associated with this ClientServiceManager.
    • getParent

      protected final ClientServiceManager getParent()
      Returns 'this' and is what is passed to ClientService.initialize() and ClientService.terminate();
      Specified by:
      getParent in class ServiceManager<ClientServiceManager>
    • addService

      public void addService(ClientService s)
      Adds the specified ClientService and initializes it. If the service manager has already been started then the service will also be started.
    • addServices

      public void addServices(ClientService... services)
      Adds the specified services and initializes them. If the service manager has already been started then the services will also be started. This is a convenience method that delegates to addService(), thus each service will be initialized (and possibly started) in sequence rather than doing them all at the end.
    • removeService

      public void removeService(ClientService s)
      Removes the specified ClientService from this service manager, stopping and terminating it as required. If this service manager is in a started state then the service will be stopped. After removal, the service will be terminated.