Class ClientServiceManager
java.lang.Object
com.jme3.network.service.ServiceManager<ClientServiceManager>
com.jme3.network.service.ClientServiceManager
Manages ClientServices on behalf of a network Client object.
- Author:
- Paul Speed
-
Constructor Summary
ConstructorsConstructorDescriptionClientServiceManager(Client client) Creates a new ClientServiceManager for the specified network Client. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified ClientService and initializes it.voidaddServices(ClientService... services) Adds the specified services and initializes them.Returns the network Client associated with this ClientServiceManager.protected final ClientServiceManagerReturns 'this' and is what is passed to ClientService.initialize() and ClientService.terminate();voidRemoves the specified ClientService from this service manager, stopping and terminating it as required.Methods inherited from class ServiceManager
addService, getService, getServices, isStarted, removeService, start, stop, terminate, toString
-
Constructor Details
-
ClientServiceManager
Creates a new ClientServiceManager for the specified network Client.- Parameters:
client- the client whose services are being managed
-
-
Method Details
-
getClient
Returns the network Client associated with this ClientServiceManager.- Returns:
- the managed client
-
getParent
Returns 'this' and is what is passed to ClientService.initialize() and ClientService.terminate();- Specified by:
getParentin classServiceManager<ClientServiceManager>- Returns:
- the parent object exposed to managed services
-
addService
Adds the specified ClientService and initializes it. If the service manager has already been started then the service will also be started.- Parameters:
s- the client service to add
-
addServices
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.- Parameters:
services- the client services to add
-
removeService
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.- Parameters:
s- the client service to remove
-