Class LocalEnvironment
java.lang.Object
com.google.appengine.tools.development.LocalEnvironment
- All Implemented Interfaces:
ApiProxy.Environment
- Direct Known Subclasses:
AbstractContainerService.LocalInitializationEnvironment,LocalHttpRequestEnvironment,LocalHttpRequestEnvironment
LocalEnvironment is a simple
ApiProxy.Environment that reads
application-specific details (e.g. application identifer) directly from the
custom deployment descriptor.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringApiProxy.Environmentinstances used withApiProxyLocalFactoryshould have a entry in the map returned bygetAttributes()with this key, and aSemaphoreas the value.static final StringIn production, this is a constant that defines theattributename that contains the hostname on which the default version is listening.static final StringThe name of anattributethat contains theHttpServletRequestinstance.static final Stringstatic final intInstance number for a main instance.static final Stringstatic final StringThe name of anattributethat contains aSet<RequestEndListener>.static final StringThe name of anattributethat contains a (String) unique identifier for the curent request.static final Stringstatic final Integer -
Method Summary
Modifier and TypeMethodDescriptionvoidgetAppId()static StringgetMajorVersion(String versionId) Returns the major version component from the provided version id or null if the provided version id has no major version component.longfinal StringDeprecated.static voidsetInstance(Map<String, Object> attributes, int instance) Sets the instance for the provided attributes.static voidSets thePORT_ID_ENV_ATTRIBUTEvalue to the provided port value or clears it if port is null.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.apphosting.api.ApiProxy.Environment
getEmail, isAdmin, isLoggedIn
-
Field Details
-
TESTING_DEFAULT_PORT
-
INSTANCE_ID_ENV_ATTRIBUTE
- See Also:
-
PORT_ID_ENV_ATTRIBUTE
- See Also:
-
API_CALL_SEMAPHORE
ApiProxy.Environmentinstances used withApiProxyLocalFactoryshould have a entry in the map returned bygetAttributes()with this key, and aSemaphoreas the value. This is used internally to track asynchronous API calls.- See Also:
-
REQUEST_ID
The name of anattributethat contains a (String) unique identifier for the curent request.- See Also:
-
START_TIME_ATTR
The name of anattributethat contains a aDateobject representing the time this request was started.- See Also:
-
REQUEST_END_LISTENERS
The name of anattributethat contains aSet<RequestEndListener>. The set ofRequestEndListenersis populated by from within the service calls. The listeners are invoked at the end of a user request.- See Also:
-
HTTP_SERVLET_REQUEST
The name of anattributethat contains theHttpServletRequestinstance.- See Also:
-
DEFAULT_VERSION_HOSTNAME
In production, this is a constant that defines theattributename that contains the hostname on which the default version is listening. In the local development server, theattributecontains the listening port in addition to the hostname, and is the one and only frontend app instance hostname and port.- See Also:
-
MAIN_INSTANCE
public static final int MAIN_INSTANCEInstance number for a main instance.Clients depend on this literal having the value -1 so do not change this value without making needed updates to clients.
- See Also:
-
-
Method Details
-
setInstance
Sets the instance for the provided attributes. -
setPort
Sets thePORT_ID_ENV_ATTRIBUTEvalue to the provided port value or clears it if port is null. -
getAppId
- Specified by:
getAppIdin interfaceApiProxy.Environment
-
getModuleId
- Specified by:
getModuleIdin interfaceApiProxy.Environment
-
getVersionId
- Specified by:
getVersionIdin interfaceApiProxy.Environment
-
getAuthDomain
- Specified by:
getAuthDomainin interfaceApiProxy.Environment
-
getRequestNamespace
Deprecated.- Specified by:
getRequestNamespacein interfaceApiProxy.Environment
-
getAttributes
- Specified by:
getAttributesin interfaceApiProxy.Environment
-
callRequestEndListeners
public void callRequestEndListeners() -
getRemainingMillis
public long getRemainingMillis()- Specified by:
getRemainingMillisin interfaceApiProxy.Environment
-
getMajorVersion
Returns the major version component from the provided version id or null if the provided version id has no major version component.
-