Package com.jme3.network.service
Class ServiceManager<T>
java.lang.Object
com.jme3.network.service.ServiceManager<T>
- Direct Known Subclasses:
- ClientServiceManager,- HostedServiceManager
The base service manager class from which the HostedServiceManager
  and ClientServiceManager classes are derived.  This manages
  the underlying services and their life cycles.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddService(S s) Adds the specified service and initializes it.protected abstract TRetrieves the 'parent' of this service manager, usually a more specifically typed version of 'this' but it can be anything the services are expecting.getService(Class<S> type) Retrieves the first service of the specified type.Returns the complete list of services managed by this service manager.booleanReturns true if this service manager has been started.removeService(S s) Removes the specified service from this service manager, stopping and terminating it as required.voidstart()Starts this service manager and all services that it contains.voidstop()Stops all services and puts the service manager into a stopped state.voidTerminates all services.toString()
- 
Constructor Details- 
ServiceManagerprotected ServiceManager()
 
- 
- 
Method Details- 
getParentRetrieves the 'parent' of this service manager, usually a more specifically typed version of 'this' but it can be anything the services are expecting.
- 
getServicesReturns the complete list of services managed by this service manager. This list is thread safe following the CopyOnWriteArrayList semantics.
- 
startpublic void start()Starts this service manager and all services that it contains. Any services added after the service manager has started will have their start() methods called.
- 
isStartedpublic boolean isStarted()Returns true if this service manager has been started.
- 
stoppublic void stop()Stops all services and puts the service manager into a stopped state.
- 
addServiceAdds the specified service and initializes it. If the service manager has already been started then the service will also be started.
- 
removeServiceRemoves the specified service 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.
- 
terminatepublic void terminate()Terminates all services. If the service manager has not been stopped yet, then it will be stopped.
- 
getServiceRetrieves the first service of the specified type.
- 
toString
 
-