Class ServerManager
java.lang.Object
de.iip_ecosphere.platform.services.spring.ServerManager
Manages server instances.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classWraps a spawned JVM process into aServerinstance. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final de.iip_ecosphere.platform.support.logging.Loggerprivate Supplier<de.iip_ecosphere.platform.support.net.NetworkManager> private static final Stringprivate Map<SpringCloudServiceDescriptor, de.iip_ecosphere.platform.support.Server> -
Constructor Summary
ConstructorsConstructorDescriptionServerManager(Supplier<de.iip_ecosphere.platform.support.net.NetworkManager> networkManagerSupplier) Creates a server manager instance. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of running servers.private Map<String, SpringCloudServiceDescriptor> getServers(Map<String, String> options, Collection<SpringCloudArtifactDescriptor> artifacts) Returns the servers to be started.String returns the host names/ids to be considered equal for this (the executing) device.private ClassLoaderobtainLoader(Map<SpringCloudArtifactDescriptor, ClassLoader> loaders, SpringCloudServiceDescriptor sDesc) Obtains a class loader fromloadersor adds a new one determined byArtifactResolver.determineArtifactClassLoader().voidstartServers(Map<String, String> options, Collection<SpringCloudArtifactDescriptor> artifacts) Starting server instances.voidstopServers(Collection<SpringCloudArtifactDescriptor> artifacts) Stopping server instances.
-
Field Details
-
PROP_DISABLE_SERVER
- See Also:
-
LOGGER
private static final de.iip_ecosphere.platform.support.logging.Logger LOGGER -
runningServers
-
networkManagerSupplier
-
-
Constructor Details
-
ServerManager
public ServerManager(Supplier<de.iip_ecosphere.platform.support.net.NetworkManager> networkManagerSupplier) Creates a server manager instance.- Parameters:
networkManagerSupplier- the network manager supplier
-
-
Method Details
-
obtainLoader
private ClassLoader obtainLoader(Map<SpringCloudArtifactDescriptor, ClassLoader> loaders, SpringCloudServiceDescriptor sDesc) Obtains a class loader fromloadersor adds a new one determined byArtifactResolver.determineArtifactClassLoader().- Parameters:
loaders- the class loaderssDesc- the service descriptor- Returns:
- the class loader
-
startServers
public void startServers(Map<String, String> options, Collection<SpringCloudArtifactDescriptor> artifacts) Starting server instances.- Parameters:
options- optional map of optional options to reconfigure the host identifications of the servers (ServiceOperations.OPTION_SERVERS), may be nullartifacts- the artifacts to be considered for server definitions- See Also:
-
stopServers
Stopping server instances.- Parameters:
artifacts- the artifacts to be considered for server definitions
-
getRunningServersCount
public int getRunningServersCount()Returns the number of running servers.- Returns:
- the number of running servers
-
getThisDeviceHostIds
String returns the host names/ids to be considered equal for this (the executing) device.- Returns:
- the ids
-
getServers
private Map<String,SpringCloudServiceDescriptor> getServers(Map<String, String> options, Collection<SpringCloudArtifactDescriptor> artifacts) Returns the servers to be started.- Parameters:
options- optional map of optional options to reconfigure the host identifications of the servers (ServiceOperations.OPTION_SERVERS), may be nullartifacts- the artifacts to be considered for server definitions- Returns:
- the id-descriptor mapping of servers to be started, may be empty
-