Class BasicModule
java.lang.Object
com.google.appengine.tools.development.AbstractModule<com.google.appengine.tools.development.ManualInstanceHolder>
com.google.appengine.tools.development.BasicModule
- All Implemented Interfaces:
Module
public class BasicModule
extends AbstractModule<com.google.appengine.tools.development.ManualInstanceHolder>
Basic
Module implementation. Very similar to ManualModule, but will create 1 or 2
instances based on maxInstances. Does not attempt to implement autoscaling since we do not
do that in dynamic modules either. Will create 2 instances and balance load between the two
if maxInstances is >= 2, this should help with testing shared state between instances.-
Method Summary
Modifier and TypeMethodDescriptiondoConfigure(ApplicationConfigurationManager.ModuleConfigurationHandle moduleConfigurationHandle, String serverInfo, File externalResourceDir, String address, Map<String, Object> containerConfigProperties, DevAppServer devAppServer) Acquires a serving permit and returns anInstanceHolderfor an instance which is available to handle a request or returns null if there is no such instance.intReturns the number of instances for this module.voidSimulates starting the module in production.voidSimulates stopping the module in production.Methods inherited from class com.google.appengine.tools.development.AbstractModule
configure, createConnection, getHostAndPort, getInstanceHolder, getLocalServerEnvironment, getMainContainer, getModuleName, setApiProxyDelegate, shutdown, startup
-
Method Details
-
doConfigure
public LocalServerEnvironment doConfigure(ApplicationConfigurationManager.ModuleConfigurationHandle moduleConfigurationHandle, String serverInfo, File externalResourceDir, String address, Map<String, Object> containerConfigProperties, DevAppServer devAppServer) throws Exception- Throws:
Exception
-
getInstanceCount
public int getInstanceCount()Description copied from interface:ModuleReturns the number of instances for this module. This will return 0 for anAutomaticModule. -
getAndReserveAvailableInstanceHolder
public com.google.appengine.tools.development.ManualInstanceHolder getAndReserveAvailableInstanceHolder()Description copied from interface:ModuleAcquires a serving permit and returns anInstanceHolderfor an instance which is available to handle a request or returns null if there is no such instance.throws
UnsupportedOperationExceptionunless this is aManualModule.- Specified by:
getAndReserveAvailableInstanceHolderin interfaceModule- Overrides:
getAndReserveAvailableInstanceHolderin classAbstractModule<com.google.appengine.tools.development.ManualInstanceHolder>
-
startServing
Description copied from interface:ModuleSimulates starting the module in production.- Specified by:
startServingin interfaceModule- Overrides:
startServingin classAbstractModule<com.google.appengine.tools.development.ManualInstanceHolder>- Throws:
Exception
-
stopServing
Description copied from interface:ModuleSimulates stopping the module in production.- Specified by:
stopServingin interfaceModule- Overrides:
stopServingin classAbstractModule<com.google.appengine.tools.development.ManualInstanceHolder>- Throws:
Exception
-