Class ServerManager

java.lang.Object
de.iip_ecosphere.platform.services.spring.ServerManager

public class ServerManager extends Object
Manages server instances.
Author:
Holger Eichelberger, SSE
  • Field Details

    • PROP_DISABLE_SERVER

      private static final String PROP_DISABLE_SERVER
      See Also:
    • LOGGER

      private static final de.iip_ecosphere.platform.support.logging.Logger LOGGER
    • runningServers

      private Map<SpringCloudServiceDescriptor,de.iip_ecosphere.platform.support.Server> runningServers
    • networkManagerSupplier

      private Supplier<de.iip_ecosphere.platform.support.net.NetworkManager> 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

      Obtains a class loader from loaders or adds a new one determined by ArtifactResolver.determineArtifactClassLoader().
      Parameters:
      loaders - the class loaders
      sDesc - 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 null
      artifacts - the artifacts to be considered for server definitions
      See Also:
    • stopServers

      public void stopServers(Collection<SpringCloudArtifactDescriptor> artifacts)
      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

      private static Set<String> getThisDeviceHostIds()
      String returns the host names/ids to be considered equal for this (the executing) device.
      Returns:
      the ids
    • getServers

      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 null
      artifacts - the artifacts to be considered for server definitions
      Returns:
      the id-descriptor mapping of servers to be started, may be empty