Interface ContainerService

All Known Subinterfaces:
ContainerService, ContainerServiceEE8
All Known Implementing Classes:
AbstractContainerService

public interface ContainerService
Provides the backing servlet container support for the DevAppServer, as discovered via
invalid reference
ServiceProvider
.

More specifically, this interface encapsulates the interactions between the DevAppServer and the underlying servlet container, which by default uses Jetty.

  • Method Details

    • configure

      LocalServerEnvironment configure(String devAppServerVersion, String address, int port, ApplicationConfigurationManager.ModuleConfigurationHandle moduleConfigurationHandle, File externalResourceDirectory, Map<String,Object> containerConfigProperties, int instance, DevAppServer devAppServer)
      Sets up the necessary configuration parameters.
      Parameters:
      devAppServerVersion - Version of the devAppServer.
      address - The address on which the module instance will run
      port - The port to which the module instance will be bound. If 0, an available port will be selected.
      moduleConfigurationHandle - Handle to access and reread the configuration.
      externalResourceDirectory - If not null, a resource directory external to the applicationDirectory. This will be searched before applicationDirectory when looking for resources.
      containerConfigProperties - Additional properties used in the configuration of the specific container implementation. This map travels across classloader boundaries, so all values in the map must be JRE classes.
      instance - the 0 based instance number for this container's instance or LocalEnvironment.MAIN_INSTANCE.
      Returns:
      A LocalServerEnvironment describing the environment in which the module instance is running.
    • createConnection

      void createConnection() throws Exception
      Create's this containers network connections. After this returns getAddress(), getPort() and getHostName() return correct values for this container.
      Throws:
      Exception
    • setApiProxyDelegate

      void setApiProxyDelegate(com.google.apphosting.api.ApiProxy.Delegate<?> apiProxyDelegate)
      Sets the ApiProxy.Delegate.

      Note that this provides access to the original delegate which was established by the DevAppServer. Though this delegate is usually available by calling the delegate can be changed by the application so we keep this reference to the original.

      Parameters:
      apiProxyDelegate -
    • startup

      void startup() throws Exception
      Starts up the servlet container.
      Throws:
      Exception - Any exception from the container will be rethrown as is.
    • shutdown

      void shutdown() throws Exception
      Shuts down the servlet container.
      Throws:
      Exception - Any exception from the container will be rethrown as is.
    • getAddress

      String getAddress()
      Returns the listener network address, however it's decided during the servlet container deployment.
    • getPort

      int getPort()
      Returns the listener port number, however it's decided during the servlet container deployment.
    • getHostName

      String getHostName()
      Returns the host name of the module instance, however it's decided during the the servlet container deployment.
    • getAppContext

      AppContext getAppContext()
      Returns the context representing the currently executing webapp.
    • getAppEngineWebXmlConfig

      com.google.apphosting.utils.config.AppEngineWebXml getAppEngineWebXmlConfig()
      Return the AppEngineWebXml configuration of this container
    • getServiceProperties

      Map<String,String> getServiceProperties()
      Get a set of properties to be passed to each service, based on the AppEngineWebXml configuration.
      Returns:
      the map of properties to be passed to each service.