Package org.apache.synapse
Class Axis2SynapseController
- java.lang.Object
-
- org.apache.synapse.Axis2SynapseController
-
- All Implemented Interfaces:
SynapseController
public class Axis2SynapseController extends Object implements SynapseController
Axis2 Based Synapse Controller.- See Also:
SynapseController
-
-
Field Summary
Fields Modifier and Type Field Description protected ServerConfigurationInformationserverConfigurationInformationServerConfiguration Informationprotected ServerContextInformationserverContextInformationRuntime information about the serverprotected SynapseConfigurationsynapseConfigurationReference to the Synapse configurationprotected SynapseEnvironmentsynapseEnvironmentReference to the Synapse configuration
-
Constructor Summary
Constructors Constructor Description Axis2SynapseController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SynapseConfigurationcreateSynapseConfiguration()Creates the Synapse configuration by reading and processing the synapse configuration file.SynapseEnvironmentcreateSynapseEnvironment()Setup synapse in axis2 environment and return the created instance.voiddestroy()Destroys the Synapse Controller.voiddestroySynapseConfiguration()Destroys the SynapseConfiguration instancevoiddestroySynapseConfiguration(boolean preserveState)Destroys the SynapseConfiguration instance, but preservers the artifacts state based on @param preserveStatevoiddestroySynapseEnvironment()Destroys the Synapse Environment by undeploying all Axis2 services.voidendMaintenance()Recovers the Synapse Server from maintenance mode resuming transport listeners, senders and tasks.ObjectgetContext()Returns underlying environment contextvoidinit(ServerConfigurationInformation serverConfigurationInformation, ServerContextInformation serverContextInformation)Initialization of the synapse controllerbooleanisInitialized()Explicitly checks the initialization.voidstart()Adds the synapse handlers to the inflow Dispatch phase and starts the listener manager if the axis2 instance is created by the SynapsevoidstartMaintenance()Puts the Synapse Server into a maintenance mode pausing transport listeners, senders and tasks.voidstop()Cleanup the axis2 environment and stop the synapse environment.booleanwaitUntilSafeToStop(long waitIntervalMillis, long endTime)Waits until it is safe to stop or the the specified end time has been reached.
-
-
-
Field Detail
-
synapseConfiguration
protected SynapseConfiguration synapseConfiguration
Reference to the Synapse configuration
-
synapseEnvironment
protected SynapseEnvironment synapseEnvironment
Reference to the Synapse configuration
-
serverConfigurationInformation
protected ServerConfigurationInformation serverConfigurationInformation
ServerConfiguration Information
-
serverContextInformation
protected ServerContextInformation serverContextInformation
Runtime information about the server
-
-
Method Detail
-
init
public void init(ServerConfigurationInformation serverConfigurationInformation, ServerContextInformation serverContextInformation)
Initialization of the synapse controller- Specified by:
initin interfaceSynapseController- Parameters:
serverConfigurationInformation- ServerConfigurationInformation InstanceserverContextInformation- Server Context if the Axis2 Based Server Environment has been already set up.
-
destroy
public void destroy()
Destroys the Synapse Controller.- Specified by:
destroyin interfaceSynapseController
-
isInitialized
public boolean isInitialized()
Explicitly checks the initialization.- Specified by:
isInitializedin interfaceSynapseController- Returns:
- true if the initialization has been a success.
-
start
public void start()
Adds the synapse handlers to the inflow Dispatch phase and starts the listener manager if the axis2 instance is created by the Synapse- Specified by:
startin interfaceSynapseController
-
startMaintenance
public void startMaintenance()
Puts the Synapse Server into a maintenance mode pausing transport listeners, senders and tasks.- Specified by:
startMaintenancein interfaceSynapseController
-
endMaintenance
public void endMaintenance()
Recovers the Synapse Server from maintenance mode resuming transport listeners, senders and tasks.- Specified by:
endMaintenancein interfaceSynapseController
-
stop
public void stop()
Cleanup the axis2 environment and stop the synapse environment.- Specified by:
stopin interfaceSynapseController
-
createSynapseEnvironment
public SynapseEnvironment createSynapseEnvironment()
Setup synapse in axis2 environment and return the created instance.- Specified by:
createSynapseEnvironmentin interfaceSynapseController- Returns:
- SynapseEnvironment instance
-
destroySynapseEnvironment
public void destroySynapseEnvironment()
Destroys the Synapse Environment by undeploying all Axis2 services.- Specified by:
destroySynapseEnvironmentin interfaceSynapseController
-
createSynapseConfiguration
public SynapseConfiguration createSynapseConfiguration()
Creates the Synapse configuration by reading and processing the synapse configuration file.- Specified by:
createSynapseConfigurationin interfaceSynapseController- Returns:
- the synapse configuration
-
destroySynapseConfiguration
public void destroySynapseConfiguration(boolean preserveState)
Destroys the SynapseConfiguration instance, but preservers the artifacts state based on @param preserveState- Specified by:
destroySynapseConfigurationin interfaceSynapseController
-
destroySynapseConfiguration
public void destroySynapseConfiguration()
Description copied from interface:SynapseControllerDestroys the SynapseConfiguration instance- Specified by:
destroySynapseConfigurationin interfaceSynapseController
-
waitUntilSafeToStop
public boolean waitUntilSafeToStop(long waitIntervalMillis, long endTime)Waits until it is safe to stop or the the specified end time has been reached. A delay ofwaitIntervalMillismilliseconds is used between each subsequent check. If the state "safeToStop" is reached before the specifiedendTime, the return value is true.- Specified by:
waitUntilSafeToStopin interfaceSynapseController- Parameters:
waitIntervalMillis- the pause time (delay) in milliseconds between subsequent checksendTime- the time until which the checks need to finish successfully- Returns:
- true, if a safe state is reached before the specified
endTime, otherwise false (forceful stop required)
-
getContext
public Object getContext()
Description copied from interface:SynapseControllerReturns underlying environment context- Specified by:
getContextin interfaceSynapseController- Returns:
- Underlying environment context
-
-