Class AbstractContainerService
java.lang.Object
com.google.appengine.tools.development.AbstractContainerService
- All Implemented Interfaces:
ContainerService
Common implementation for the
ContainerService interface.
There should be no reference to any third-party servlet container from here.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA fakeLocalEnvironmentimplementation that is used during the initialization of the Development AppServer.static interfaceProvider for the 'portMapping'. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal LocalServerEnvironmentconfigure(String devAppServerVersion, String address, int port, ApplicationConfigurationManager.ModuleConfigurationHandle moduleConfigurationHandle, File externalResourceDir, Map<String, Object> containerConfigProperties, int instance, DevAppServer devAppServer) Sets up the necessary configuration parameters.final voidCreate's this containers network connections.Returns the listener network address, however it's decided during the servlet container deployment.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.static voidinstallLocalInitializationEnvironment(com.google.apphosting.utils.config.AppEngineWebXml appEngineWebXml, int instance, int port, int defaultModuleMainPort, String backendName, int backendInstance, Map<String, String> portMapping) Sets up anApiProxy.Environmentfor container initialization.voidsetApiProxyDelegate(ApiProxy.Delegate<?> apiProxyDelegate) Sets theApiProxy.Delegate.final voidshutdown()Shuts down the servlet container.final voidstartup()Starts up the servlet container.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.appengine.tools.development.ContainerService
getAppContext
-
Field Details
-
PORT_MAPPING_PROVIDER_PROP
- See Also:
-
-
Constructor Details
-
AbstractContainerService
public AbstractContainerService()
-
-
Method Details
-
configure
public final LocalServerEnvironment configure(String devAppServerVersion, String address, int port, ApplicationConfigurationManager.ModuleConfigurationHandle moduleConfigurationHandle, File externalResourceDir, Map<String, Object> containerConfigProperties, int instance, DevAppServer devAppServer) Description copied from interface:ContainerServiceSets up the necessary configuration parameters.- Specified by:
configurein interfaceContainerService- 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.externalResourceDir- 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.
-
setApiProxyDelegate
Description copied from interface:ContainerServiceSets 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.- Specified by:
setApiProxyDelegatein interfaceContainerService- Parameters:
apiProxyDelegate-
-
createConnection
Description copied from interface:ContainerServiceCreate's this containers network connections. After this returnsContainerService.getAddress(),ContainerService.getPort()andContainerService.getHostName()return correct values for this container.- Specified by:
createConnectionin interfaceContainerService- Throws:
Exception
-
startup
Description copied from interface:ContainerServiceStarts up the servlet container.- Specified by:
startupin interfaceContainerService- Throws:
Exception- Any exception from the container will be rethrown as is.
-
shutdown
Description copied from interface:ContainerServiceShuts down the servlet container.- Specified by:
shutdownin interfaceContainerService- Throws:
Exception- Any exception from the container will be rethrown as is.
-
getServiceProperties
Description copied from interface:ContainerServiceGet a set of properties to be passed to each service, based on the AppEngineWebXml configuration.- Specified by:
getServicePropertiesin interfaceContainerService- Returns:
- the map of properties to be passed to each service.
-
getAddress
Description copied from interface:ContainerServiceReturns the listener network address, however it's decided during the servlet container deployment.- Specified by:
getAddressin interfaceContainerService
-
getAppEngineWebXmlConfig
public com.google.apphosting.utils.config.AppEngineWebXml getAppEngineWebXmlConfig()Description copied from interface:ContainerServiceReturn the AppEngineWebXml configuration of this container- Specified by:
getAppEngineWebXmlConfigin interfaceContainerService
-
getPort
public int getPort()Description copied from interface:ContainerServiceReturns the listener port number, however it's decided during the servlet container deployment.- Specified by:
getPortin interfaceContainerService
-
getHostName
Description copied from interface:ContainerServiceReturns the host name of the module instance, however it's decided during the the servlet container deployment.- Specified by:
getHostNamein interfaceContainerService
-
installLocalInitializationEnvironment
public static void installLocalInitializationEnvironment(com.google.apphosting.utils.config.AppEngineWebXml appEngineWebXml, int instance, int port, int defaultModuleMainPort, String backendName, int backendInstance, Map<String, String> portMapping) Sets up anApiProxy.Environmentfor container initialization.
-