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 Summary
Modifier and TypeMethodDescriptionconfigure(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.voidCreate's this containers network connections.Returns the listener network address, however it's decided during the servlet container deployment.Returns the context representing the currently executing webapp.com.google.apphosting.utils.config.AppEngineWebXmlReturn the AppEngineWebXml configuration of this containerReturns the host name of the module instance, however it's decided during the the servlet container deployment.intgetPort()Returns the listener port number, however it's decided during the servlet container deployment.Get a set of properties to be passed to each service, based on the AppEngineWebXml configuration.voidsetApiProxyDelegate(ApiProxy.Delegate<?> apiProxyDelegate) Sets theApiProxy.Delegate.voidshutdown()Shuts down the servlet container.voidstartup()Starts up the servlet container.
-
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 runport- 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 notnull, 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 orLocalEnvironment.MAIN_INSTANCE.- Returns:
- A LocalServerEnvironment describing the environment in which the module instance is running.
-
createConnection
Create's this containers network connections. After this returnsgetAddress(),getPort()andgetHostName()return correct values for this container.- Throws:
Exception
-
setApiProxyDelegate
Sets theApiProxy.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
Starts up the servlet container.- Throws:
Exception- Any exception from the container will be rethrown as is.
-
shutdown
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
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.
-