Package com.jme3.network.service
Class HostedServiceManager
java.lang.Object
com.jme3.network.service.ServiceManager<HostedServiceManager>
com.jme3.network.service.HostedServiceManager
Manages HostedServices on behalf of a network Server object.
All HostedServices are automatically informed about new and
leaving connections.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionHostedServiceManager
(Server server) Creates a HostedServiceManager for the specified network Server. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called internally when a new connection has been added so that the services can be notified.void
Adds the specified HostedService and initializes it.void
addServices
(HostedService... services) Adds the specified services and initializes them.protected final HostedServiceManager
Returns 'this' and is what is passed to HostedService.initialize() and HostedService.terminate();Returns the network Server associated with this HostedServiceManager.protected void
Called internally when a connection has been removed so that the services can be notified.void
Removes the specified HostedService from this service manager, stopping and terminating it as required.Methods inherited from class com.jme3.network.service.ServiceManager
addService, getService, getServices, isStarted, removeService, start, stop, terminate, toString
-
Constructor Details
-
HostedServiceManager
Creates a HostedServiceManager for the specified network Server.
-
-
Method Details
-
getServer
Returns the network Server associated with this HostedServiceManager. -
getParent
Returns 'this' and is what is passed to HostedService.initialize() and HostedService.terminate();- Specified by:
getParent
in classServiceManager<HostedServiceManager>
-
addService
Adds the specified HostedService and initializes it. If the service manager has already been started then the service will also be started. -
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. -
removeService
Removes the specified HostedService 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. -
addConnection
Called internally when a new connection has been added so that the services can be notified. -
removeConnection
Called internally when a connection has been removed so that the services can be notified.
-