com.google.appengine.tools.development
Interface ContainerService
-
- All Known Implementing Classes:
- AbstractContainerService
public interface ContainerService
Provides the backing servlet container support for theDevAppServer
, as discovered viaServiceProvider
.More specifically, this interface encapsulates the interactions between the
DevAppServer
and the underlying servlet container, which by default uses Jetty.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description com.google.appengine.tools.development.LocalServerEnvironment
configure(java.lang.String devAppServerVersion, java.lang.String address, int port, com.google.appengine.tools.development.ApplicationConfigurationManager.ModuleConfigurationHandle moduleConfigurationHandle, java.io.File externalResourceDirectory, java.util.Map<java.lang.String,java.lang.Object> containerConfigProperties, int instance, DevAppServer devAppServer)
Sets up the necessary configuration parameters.void
createConnection()
Create's this containers network connections.void
forwardToServer(HttpServletRequest hrequest, HttpServletResponse hresponse)
Forwards an HttpRequest request to this container.java.lang.String
getAddress()
Returns the listener network address, however it's decided during the servlet container deployment.com.google.appengine.tools.development.AppContext
getAppContext()
Returns the context representing the currently executing webapp.AppEngineWebXml
getAppEngineWebXmlConfig()
Return the AppEngineWebXml configuration of this containerjava.lang.String
getHostName()
Returns the host name of the module instance, however it's decided during the the servlet container deployment.int
getPort()
Returns the listener port number, however it's decided during the servlet container deployment.java.util.Map<java.lang.String,java.lang.String>
getServiceProperties()
Get a set of properties to be passed to each service, based on the AppEngineWebXml configuration.void
setApiProxyDelegate(<any> apiProxyDelegate)
Sets thecom.google.apphosting.api.ApiProxy.Delegate
.void
shutdown()
Shuts down the servlet container.void
startup()
Starts up the servlet container.
-
-
-
Method Detail
-
configure
com.google.appengine.tools.development.LocalServerEnvironment configure(java.lang.String devAppServerVersion, java.lang.String address, int port, com.google.appengine.tools.development.ApplicationConfigurationManager.ModuleConfigurationHandle moduleConfigurationHandle, java.io.File externalResourceDirectory, java.util.Map<java.lang.String,java.lang.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.instance
- the 0 based instance number for this container's instance orLocalEnvironment.MAIN_INSTANCE
.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.- Returns:
- A LocalServerEnvironment describing the environment in which the module instance is running.
-
createConnection
void createConnection() throws java.lang.Exception
Create's this containers network connections. After this returnsgetAddress()
,getPort()
andgetHostName
return correct values for this container.- Throws:
java.lang.Exception
-
setApiProxyDelegate
void setApiProxyDelegate(<any> apiProxyDelegate)
Sets thecom.google.apphosting.api.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 java.lang.Exception
Starts up the servlet container.- Throws:
java.lang.Exception
- Any exception from the container will be rethrown as is.
-
shutdown
void shutdown() throws java.lang.Exception
Shuts down the servlet container.- Throws:
java.lang.Exception
- Any exception from the container will be rethrown as is.
-
getAddress
java.lang.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
java.lang.String getHostName()
Returns the host name of the module instance, however it's decided during the the servlet container deployment.
-
getAppContext
com.google.appengine.tools.development.AppContext getAppContext()
Returns the context representing the currently executing webapp.
-
getAppEngineWebXmlConfig
AppEngineWebXml getAppEngineWebXmlConfig()
Return the AppEngineWebXml configuration of this container
-
getServiceProperties
java.util.Map<java.lang.String,java.lang.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.
-
forwardToServer
void forwardToServer(HttpServletRequest hrequest, HttpServletResponse hresponse) throws java.io.IOException, ServletException
Forwards an HttpRequest request to this container.- Throws:
java.io.IOException
ServletException
-
-