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 ServerConfigurationInformation
serverConfigurationInformation
ServerConfiguration Informationprotected ServerContextInformation
serverContextInformation
Runtime information about the serverprotected SynapseConfiguration
synapseConfiguration
Reference to the Synapse configurationprotected SynapseEnvironment
synapseEnvironment
Reference to the Synapse configuration
-
Constructor Summary
Constructors Constructor Description Axis2SynapseController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SynapseConfiguration
createSynapseConfiguration()
Creates the Synapse configuration by reading and processing the synapse configuration file.SynapseEnvironment
createSynapseEnvironment()
Setup synapse in axis2 environment and return the created instance.void
destroy()
Destroys the Synapse Controller.void
destroySynapseConfiguration()
Destroys the SynapseConfiguration instancevoid
destroySynapseConfiguration(boolean preserveState)
Destroys the SynapseConfiguration instance, but preservers the artifacts state based on @param preserveStatevoid
destroySynapseEnvironment()
Destroys the Synapse Environment by undeploying all Axis2 services.void
endMaintenance()
Recovers the Synapse Server from maintenance mode resuming transport listeners, senders and tasks.Object
getContext()
Returns underlying environment contextvoid
init(ServerConfigurationInformation serverConfigurationInformation, ServerContextInformation serverContextInformation)
Initialization of the synapse controllerboolean
isInitialized()
Explicitly checks the initialization.void
start()
Adds the synapse handlers to the inflow Dispatch phase and starts the listener manager if the axis2 instance is created by the Synapsevoid
startMaintenance()
Puts the Synapse Server into a maintenance mode pausing transport listeners, senders and tasks.void
stop()
Cleanup the axis2 environment and stop the synapse environment.boolean
waitUntilSafeToStop(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:
init
in 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:
destroy
in interfaceSynapseController
-
isInitialized
public boolean isInitialized()
Explicitly checks the initialization.- Specified by:
isInitialized
in 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:
start
in interfaceSynapseController
-
startMaintenance
public void startMaintenance()
Puts the Synapse Server into a maintenance mode pausing transport listeners, senders and tasks.- Specified by:
startMaintenance
in interfaceSynapseController
-
endMaintenance
public void endMaintenance()
Recovers the Synapse Server from maintenance mode resuming transport listeners, senders and tasks.- Specified by:
endMaintenance
in interfaceSynapseController
-
stop
public void stop()
Cleanup the axis2 environment and stop the synapse environment.- Specified by:
stop
in interfaceSynapseController
-
createSynapseEnvironment
public SynapseEnvironment createSynapseEnvironment()
Setup synapse in axis2 environment and return the created instance.- Specified by:
createSynapseEnvironment
in interfaceSynapseController
- Returns:
- SynapseEnvironment instance
-
destroySynapseEnvironment
public void destroySynapseEnvironment()
Destroys the Synapse Environment by undeploying all Axis2 services.- Specified by:
destroySynapseEnvironment
in interfaceSynapseController
-
createSynapseConfiguration
public SynapseConfiguration createSynapseConfiguration()
Creates the Synapse configuration by reading and processing the synapse configuration file.- Specified by:
createSynapseConfiguration
in 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:
destroySynapseConfiguration
in interfaceSynapseController
-
destroySynapseConfiguration
public void destroySynapseConfiguration()
Description copied from interface:SynapseController
Destroys the SynapseConfiguration instance- Specified by:
destroySynapseConfiguration
in 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 ofwaitIntervalMillis
milliseconds is used between each subsequent check. If the state "safeToStop" is reached before the specifiedendTime
, the return value is true.- Specified by:
waitUntilSafeToStop
in 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:SynapseController
Returns underlying environment context- Specified by:
getContext
in interfaceSynapseController
- Returns:
- Underlying environment context
-
-