public class ConfigurationContext extends AbstractContext
Axis2 states are held in two information models, called description hierarchy and context hierarchy. Description hierarchy hold deployment configuration and it's values does not change unless deployment configuration change occurs where Context hierarchy hold run time information. Both hierarchies consists four levels, Global, Service Group, Operation and Message. Please look at "Information Model" section of "Axis2 Architecture Guide" for more information.
Configuration Context hold Global level run-time information. This allows same configurations to be used by two Axis2 instances and most Axis2 wide configurations can changed by setting name value pairs of the configurationContext. This hold all OperationContexts, ServiceGroups, Sessions, and ListenerManager.
Modifier and Type | Field and Description |
---|---|
protected List<ContextListener> |
contextListeners |
COPY_PROPERTIES, lastTouchedTime, parent, properties
Constructor and Description |
---|
ConfigurationContext(AxisConfiguration axisConfiguration)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addContextListener(ContextListener contextListener)
Register a
ContextListener to be notified of all sub-context events. |
void |
addServiceGroupContextIntoApplicationScopeTable(ServiceGroupContext serviceGroupContext)
Adds the given ServiceGroupContext into the Application Scope table
|
void |
addServiceGroupContextIntoSoapSessionTable(ServiceGroupContext serviceGroupContext)
Adds the given ServiceGroupContext into the SOAP session table
|
void |
cleanupContexts()
Called during shutdown to clean up all Contexts
|
MessageContext |
createMessageContext()
Create a MessageContext, and notify any registered ContextListener.
|
ServiceGroupContext |
createServiceGroupContext(AxisServiceGroup serviceGroup)
Create a ServiceGroupContext for the specified service group, and notify any registered
ContextListener.
|
void |
deployService(AxisService service)
Deploy a service to the embedded AxisConfiguration, and initialize it.
|
void |
fillServiceContextAndServiceGroupContext(MessageContext messageContext)
Searches for a ServiceGroupContext in the map with given id as the key.
|
OperationContext |
findOperationContext(String operationName,
String serviceName,
String serviceGroupName)
Finds the OperationContext given the Operation name, Service Name, and ServiceGroupName
|
AxisConfiguration |
getAxisConfiguration()
Returns the AxisConfiguration
|
String |
getContextRoot()
Retrieves the ContextRoot
|
ListenerManager |
getListenerManager()
Retrieve the ListenerManager
|
OperationContext |
getOperationContext(String messageID)
Gets a OperationContext given a Message ID.
|
File |
getRealPath(String path)
Allows users to resolve the path relative to the root directory.
|
ConfigurationContext |
getRootContext() |
String |
getServiceContextPath()
Retrieves the ServiceContext path
|
ServiceGroupContext |
getServiceGroupContext(String serviceGroupCtxId)
Returns a ServiceGroupContext object associated with the specified ID from the internal
table.
|
ServiceGroupContext |
getServiceGroupContextFromSoapSessionTable(String serviceGroupContextId,
MessageContext msgContext)
Retrieve the ServiceGroupContext from the SOAP session table
|
String[] |
getServiceGroupContextIDs()
Gets all service groups in the system.
|
long |
getServiceGroupContextTimeoutInterval()
This will be used to fetch the serviceGroupContextTimoutInterval from any place available.
|
String |
getServicePath()
Retrieves the ServicePath
|
ThreadFactory |
getThreadPool()
Returns the thread factory.
|
void |
initCluster()
Initializes the ClusterManager for this ConfigurationContext
|
boolean |
isAnyOperationContextRegistered() |
boolean |
registerOperationContext(String messageID,
OperationContext operationContext)
Registers a OperationContext with a given message ID.
|
boolean |
registerOperationContext(String messageID,
OperationContext mepContext,
boolean override)
Registers a OperationContext with a given message ID.
|
void |
removeContextListener(ContextListener contextListener)
Remove an already registered
ContextListener |
void |
removeServiceGroupContext(AxisServiceGroup serviceGroup)
Removes the given ServiceGroup from the ServiceGroup context
|
void |
removeServiceGroupContext(String serviceGroupContextId)
Remove a ServiceGroupContext
|
void |
setAxisConfiguration(AxisConfiguration configuration)
Set the AxisConfiguration to the specified configuration
|
void |
setContextRoot(String contextRoot)
Sets the context root to the given string
|
void |
setServicePath(String servicePath)
Sets the ServicePath to the given string
|
void |
setThreadPool(ThreadFactory pool)
Sets the thread factory.
|
void |
setTransportManager(ListenerManager listenerManager)
Set the TransportManager to the given ListenerManager
|
void |
shutdownModulesAndServices()
Called during shutdown to clean up all Contexts
|
void |
terminate()
Invoked during shutdown to stop the ListenerManager and perform configuration cleanup
|
void |
unregisterOperationContext(String messageID)
Unregisters the operation context associated with the given messageID
|
clearPropertyDifferences, flush, getLastTouchedTime, getLocalProperty, getParent, getProperties, getProperty, getPropertyDifferences, getPropertyNames, getPropertyNonReplicable, isAncestor, mergeProperties, removeProperty, removePropertyNonReplicable, setLastTouchedTime, setNonReplicableProperty, setParent, setProperties, setProperty, touch
protected List<ContextListener> contextListeners
public ConfigurationContext(AxisConfiguration axisConfiguration)
axisConfiguration
- - AxisConfiguration for which to create a contextpublic void initCluster() throws AxisFault
AxisFault
public void addContextListener(ContextListener contextListener)
ContextListener
to be notified of all sub-context events.contextListener
- A ContextListenerremoveContextListener(org.apache.axis2.context.ContextListener)
public void removeContextListener(ContextListener contextListener)
ContextListener
contextListener
- A ContextListeneraddContextListener(org.apache.axis2.context.ContextListener)
public void fillServiceContextAndServiceGroupContext(MessageContext messageContext) throws AxisFault
If(key != null && found) check for a service context for the intended service. if (!found) create one and hook up to ServiceGroupContext else create new ServiceGroupContext with the given key or if key is null with a new key create a new service context for the service
messageContext
- : MessageContextAxisFault
- : If something goes wrongpublic boolean registerOperationContext(String messageID, OperationContext operationContext)
messageID
- the message ID of the request message in the MEPoperationContext
- the OperationContextpublic boolean registerOperationContext(String messageID, OperationContext mepContext, boolean override)
messageID
- the message ID of the request message in the MEPmepContext
- the OperationContextoverride
- true if we should overwrite any existing OperationContextpublic void unregisterOperationContext(String messageID)
messageID
- the messageID to removepublic boolean isAnyOperationContextRegistered()
public void addServiceGroupContextIntoSoapSessionTable(ServiceGroupContext serviceGroupContext)
serviceGroupContext
- ServiceGroup Context to addpublic void addServiceGroupContextIntoApplicationScopeTable(ServiceGroupContext serviceGroupContext)
serviceGroupContext
- The Service Group Context to addpublic void deployService(AxisService service) throws AxisFault
service
- service to deployAxisFault
- if there's a problempublic AxisConfiguration getAxisConfiguration()
public OperationContext getOperationContext(String messageID)
messageID
- the message ID of an active OperationContextpublic OperationContext findOperationContext(String operationName, String serviceName, String serviceGroupName)
operationName
- - OperationName to findserviceName
- - ServiceName to findserviceGroupName
- - ServiceGroupName to findOperationContext
public MessageContext createMessageContext()
public ServiceGroupContext createServiceGroupContext(AxisServiceGroup serviceGroup)
serviceGroup
- an AxisServiceGrouppublic File getRealPath(String path)
path
- a relative pathpublic ServiceGroupContext getServiceGroupContextFromSoapSessionTable(String serviceGroupContextId, MessageContext msgContext) throws AxisFault
serviceGroupContextId
- Service Group Context ID to search onmsgContext
- Message Context to search onAxisFault
- if ServiceGroupContext cannot be foundpublic ServiceGroupContext getServiceGroupContext(String serviceGroupCtxId)
serviceGroupCtxId
- The ID string associated with the ServiceGroupContext objectpublic String[] getServiceGroupContextIDs()
public ThreadFactory getThreadPool()
public void setAxisConfiguration(AxisConfiguration configuration)
configuration
- an AxisConfigurationpublic void setThreadPool(ThreadFactory pool) throws AxisFault
pool
- The thread poolAxisFault
- If a thread pool has already been setpublic void removeServiceGroupContext(String serviceGroupContextId)
serviceGroupContextId
- The ID of the ServiceGroupContextpublic ListenerManager getListenerManager()
public void setTransportManager(ListenerManager listenerManager)
listenerManager
- The ListenerManager for which to set the TransportManagerpublic void cleanupContexts()
public void shutdownModulesAndServices() throws AxisFault
AxisFault
public void terminate() throws AxisFault
AxisFault
public String getServiceContextPath()
public String getServicePath()
public void setServicePath(String servicePath)
servicePath
- The service path for which to setpublic String getContextRoot()
public void setContextRoot(String contextRoot)
contextRoot
- The context root for which to setpublic long getServiceGroupContextTimeoutInterval()
public void removeServiceGroupContext(AxisServiceGroup serviceGroup)
serviceGroup
- the AxisServiceGroup to removepublic ConfigurationContext getRootContext()
getRootContext
in class AbstractContext
Copyright © The Apache Software Foundation. All Rights Reserved.