Interface Module
- All Known Implementing Classes:
AbstractModule,BasicModule,ManualModule
public interface Module
Holder for both configuration and runtime information for a single
DevAppServer module and all its instances.-
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure thisModule.voidCreates the network connections for thisModule.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.getHostAndPort(int instance) Returns the host and port for the requested instance or null if the instance does not exist.intReturns the number of instances for this module.getInstanceHolder(int instance) Returns the requestedInstanceHolderor null if the instance does not exist.Returns theLocalServerEnvironmentfor the primary instance for thisModule.Returns theContainerServicefor the primary instance for thisModule.Returns the module name for thisModule.voidsetApiProxyDelegate(ApiProxy.Delegate<?> apiProxyDelegate) Sets theApiProxy.Delegate.voidshutdown()Stops all the instances for thisModule.voidSimulates starting the module in production.voidstartup()Starts all the instances for thisModule.voidSimulates stopping the module in production.
-
Method Details
-
configure
Configure thisModule.Note
configure(java.util.Map<java.lang.String, java.lang.Object>)fits into theDevAppServerstartup sequence. The user may adjustDevAppServer.setServiceProperties(java.util.Map<java.lang.String, java.lang.String>)values after construction and before callingDevAppServer.start()which callsconfigure(java.util.Map<java.lang.String, java.lang.Object>). To retain compatibility operations that make use of these user specified settings such as port selection must not not be performed during construction.- Parameters:
containerConfigProperties- container configuration properties.- Throws:
Exception
-
setApiProxyDelegate
Sets theApiProxy.Delegate. -
createConnection
Creates the network connections for thisModule.- Throws:
Exception
-
startup
- Throws:
Exception
-
shutdown
- Throws:
Exception
-
stopServing
Simulates stopping the module in production.- Throws:
UnsupportedOperationException- if this is not a manual module.Exception
-
startServing
Simulates starting the module in production.- Throws:
UnsupportedOperationException- if this is not a manual module.Exception
-
getModuleName
String getModuleName()Returns the module name for thisModule. -
getMainContainer
ContainerService getMainContainer()Returns theContainerServicefor the primary instance for thisModule. -
getLocalServerEnvironment
LocalServerEnvironment getLocalServerEnvironment()Returns theLocalServerEnvironmentfor the primary instance for thisModule. -
getHostAndPort
Returns the host and port for the requested instance or null if the instance does not exist.- Parameters:
instance- The instance number orLocalEnvironment.MAIN_INSTANCE.
-
getInstanceHolder
Returns the requestedInstanceHolderor null if the instance does not exist.- Parameters:
instance- the instance number orLocalEnvironment.MAIN_INSTANCE.
-
getInstanceCount
int getInstanceCount()Returns the number of instances for this module. This will return 0 for anAutomaticModule. -
getAndReserveAvailableInstanceHolder
InstanceHolder getAndReserveAvailableInstanceHolder()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.throws
UnsupportedOperationExceptionunless this is aManualModule.
-