public interface ContainerService
DevAppServer
,
as discovered via ServiceProvider
.
More specifically, this interface encapsulates the interactions between the
DevAppServer
and the underlying servlet container, which by default
uses Jetty.
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 container
|
java.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(
Sets the
com.google.apphosting.api.ApiProxy.Delegate . |
void |
shutdown()
Shuts down the servlet container.
|
void |
startup()
Starts up the servlet container.
|
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)
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 not null
, 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 or
LocalEnvironment.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.void createConnection() throws java.lang.Exception
getAddress()
, getPort()
and getHostName
return
correct values for this container.java.lang.Exception
void setApiProxyDelegate(apiProxyDelegate)
com.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.
apiProxyDelegate
- void startup() throws java.lang.Exception
java.lang.Exception
- Any exception from the container will be rethrown as is.void shutdown() throws java.lang.Exception
java.lang.Exception
- Any exception from the container will be rethrown as is.java.lang.String getAddress()
int getPort()
java.lang.String getHostName()
com.google.appengine.tools.development.AppContext getAppContext()
AppEngineWebXml getAppEngineWebXmlConfig()
java.util.Map<java.lang.String,java.lang.String> getServiceProperties()
void forwardToServer(HttpServletRequest hrequest, HttpServletResponse hresponse) throws java.io.IOException, ServletException
java.io.IOException
ServletException