Package org.apache.axis2.engine
Class AxisConfiguration
java.lang.Object
org.apache.axis2.description.AxisDescription
org.apache.axis2.engine.AxisConfiguration
- All Implemented Interfaces:
DescriptionConstants,ParameterInclude
Class AxisConfiguration
-
Field Summary
FieldsFields inherited from class org.apache.axis2.description.AxisDescription
engagedModules, parameterObservers, parentFields inherited from interface org.apache.axis2.description.DescriptionConstants
CLASSLOADER_KEY, CONTEXTPATH_KEY, EXECUTION_CHAIN_KEY, EXECUTION_FAULT_CHAIN_KEY, EXECUTION_OUT_CHAIN_KEY, IN_FAULTFLOW_KEY, INFLOW_KEY, MESSAGE_RECEIVER_KEY, MODULEREF_KEY, OPERATION_KEY, OUT_FAULTFLOW_KEY, OUTFLOW_KEY, PARAMETER_KEY, PHASES_KEY, SERVICE_CLASS_NAME, STYLE_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataLocator(String dialect, AxisDataLocator dataLocator) For internal used only!voidaddDataLocatorClassNames(String dialect, String classname) Allows to define/configure Data Locator for specified dialect at Axis 2 Configuration.voidaddDefaultModuleVersion(String moduleName, String moduleVersion) Adds a default module version, which can be done either programmatically or by using axis2.xml.voidaddFaultyServiceDuetoModule(String moduleName, FaultyServiceData faultyServiceData) Updates the map that keeps track of faulty services due to modulesvoidaddGlobalModuleRef(String moduleName) Add an AxisModule to the list of globally deployed modules.voidaddLocalPolicyAssertion(QName name) voidaddMessageBuilder(String contentType, Builder messageBuilder) Register a messageBuilder implementation against a content type.voidaddMessageFormatter(String contentType, MessageFormatter messageFormatter) Register a messageFormatter implementation against a content type.voidaddMessageReceiver(String mepURL, MessageReceiver messageReceiver) voidaddModule(AxisModule module) Add an available Module to this configurationvoidaddModuleConfig(ModuleConfiguration moduleConfiguration) Adds module configuration, if there is a moduleConfig tag in service.voidaddObservers(AxisObserver axisObserver) Register given AxisObserver object to theAxisConfiguration.voidaddService(AxisService service) Add an AxisService to our global configuration.voidaddServiceGroup(AxisServiceGroup axisServiceGroup) voidaddServiceToExistingServiceGroup(AxisService axisService, String serviceGroupName) This method is used to add a service to an existing active service group in the axis configurationvoidvoidaddToAllServicesMap(AxisService axisService) voidaddTransportIn(TransportInDescription transport) Add an incoming transport description (i.e. receiver) to our configuration.voidaddTransportOut(TransportOutDescription transport) Add an outgoing transport description (i.e. sender) to our configuration.voidcleanup()voiddeployModule(String moduleFileName) voidEngage all the previously added global modules.voidengageModule(String moduleref) Engages the default module version corresponding to given module name , or if the module name contains version number in it then it will engage the correct module.voidengageModule(String moduleName, String versionID) Engages a module using given name and its version ID.getDataLocator(String dialect) Return DataLocator instance for specified dialect.getDataLocatorClassName(String dialect) Return classname of DataLocator configured for specified dialect.getDefaultModule(String moduleName) getDefaultModuleVersion(String moduleName) getFaultyServicesDuetoModule(String moduleName) Returns a map which contains the faulty services due a particular module.Returns the map which keeps track of faulty services due to modules.getKey()getMessageBuilder(String contentType) Get a Builder for a particular content type.getMessageBuilder(String contentType, boolean defaultBuilder) getMessageFormatter(String contentType) Get a MessageFormatter for the specified content type.getMessageReceiver(String mepURL) Get an AxisModule by name.Return the module having name=moduleName & version=moduleVersionGet the class loader that becomes the parent of all the modulesgetModuleConfig(String moduleName) getModulesForPolicyNamesapce(String namesapce) This method returns read-only list of AxisObservers registered with thisAxisConfiguration.getService(String name) Method getService.getServiceForActivation(String serviceName) Service can start and stop, once stopped it cannot be accessed, so we need a way to get the service even if service is not active.getServiceGroup(String serviceNameAndGroupString) getTargetResolverChain returns an instance of TargetResolver which iterates over the registered TargetResolvers, calling each one in turn when resolveTarget is called.getTransportIn(String name) getTransportOut(String name) voidinsertPhase(Deployable d, int flow) This method can be used to insert a phase at the runtime for a given location And the relative location can be specified by beforePhase and afterPhase.booleanisAssertionLocal(QName name) booleanbooleanCheck if a given module is engaged at this level.booleanisEngaged(AxisModule axisModule) booleanisGlobalModulesRegistered(String moduleName) booleanisStart()voidnotifyObservers(AxisEvent event, AxisModule moule) voidnotifyObservers(AxisEvent event, AxisService service) voidnotifyObservers(AxisEvent event, AxisServiceGroup serviceGroup) voidonDisengage(AxisModule module) To dis-engage a module from the system.voidonEngage(AxisModule module, AxisDescription engager) voidregisterLocalPolicyAssertions(AxisModule axisModule) voidregisterModulePolicySupport(AxisModule axisModule) voidvoidremoveFaultyServiceDuetoModule(String moduleName, String serviceGroupName) Removes a faulty service for a given module from the internal map.voidvoidremoveModule(String moduleName, String moduleVersion) Remove a module with moduleName & moduleVersionvoidremoveModule(String moduleName, Version moduleVersion) Remove a module with moduleName & moduleVersionvoidremoveObserver(AxisObserver axisObserver) Unregister the given AxisObserver object if it is registered with theAxisConfiguration.voidremoveService(String name) Remove a service.removeServiceGroup(String serviceGroupName) voidsetClusteringAgent(ClusteringAgent clusteringAgent) voidsetConfigurator(AxisConfigurator configurator) voidsetGlobalOutPhase(List<Phase> outPhases) voidsetInFaultPhases(List<Phase> list) Set the inbound fault phases TODO: Passing mutable lists like this and using them directly is bad practice.voidsetInPhasesUptoAndIncludingPostDispatch(List<Phase> inPhasesUptoAndIncludingPostDispatch) voidsetModuleClassLoader(ClassLoader classLoader) voidsetOutFaultPhases(List<Phase> list) Set the outbound fault phases TODO: Passing mutable lists like this and using them directly is bad practice.voidsetPhasesInfo(PhasesInfo phasesInfo) voidsetRepository(URL axis2Repository) voidsetServiceClassLoader(ClassLoader classLoader) voidsetStart(boolean start) voidsetSystemClassLoader(ClassLoader classLoader) voidsetTransactionConfig(TransactionConfiguration transactionConfiguration) voidstartService(String serviceName) voidstopService(String serviceName) voidChecks whether the system pre-defined phases for all the flows, have been changed.Methods inherited from class org.apache.axis2.description.AxisDescription
addChild, addChild, addParameter, addParameter, addParameterObserver, applyPolicy, applyPolicy, deserializeParameters, disengageModule, engageModule, engageModule, getAxisConfiguration, getChild, getChildren, getDocumentation, getDocumentationNode, getEngagedModules, getParameter, getParameters, getParameterValue, getParent, getPolicyInclude, getPolicySubject, isParameterLocked, isParameterTrue, removeChild, removeParameter, removeParameterObserver, setDocumentation, setDocumentation, setParent, setPolicyInclude
-
Field Details
-
phasesinfo
-
-
Constructor Details
-
AxisConfiguration
public AxisConfiguration()Constructor AxisConfiguration.
-
-
Method Details
-
addMessageReceiver
-
addMessageBuilder
Register a messageBuilder implementation against a content type. This is used by Axis2 to support different message formats.- Parameters:
contentType- the relevant content-type (i.e. "text/xml")messageBuilder- a Builder implementation
-
addMessageFormatter
Register a messageFormatter implementation against a content type. This is used by Axis2 to support serialization of messages to different message formats. (Eg: JSON)- Parameters:
contentType- the relevant content-type (i.e. "text/xml")messageFormatter- a MessageFormatter implementation
-
addModule
Add an available Module to this configuration- Parameters:
module- an AxisModule- Throws:
AxisFault- in case of error
-
deployModule
- Throws:
DeploymentException
-
removeModule
Remove a module with moduleName & moduleVersion- Parameters:
moduleName- the name of the module to removemoduleVersion- the version of the module to remove
-
removeModule
Remove a module with moduleName & moduleVersion- Parameters:
moduleName- the name of the module to removemoduleVersion- the version of the module to remove
-
addModuleConfig
Adds module configuration, if there is a moduleConfig tag in service.- Parameters:
moduleConfiguration- a ModuleConfiguration to remember
-
addObservers
Register given AxisObserver object to theAxisConfiguration.- Parameters:
axisObserver- the axis observer
-
removeObserver
Unregister the given AxisObserver object if it is registered with theAxisConfiguration.- Parameters:
axisObserver- the axis observer
-
addService
Add an AxisService to our global configuration. Since services must be in ServiceGroups, we construct an anonymous AxisServiceGroup around the passed AxisService and then call addServiceGroup().- Parameters:
service- an AxisService to deploy.- Throws:
AxisFault- if something goes wrong (invalid service, service is already deployed, etc...)
-
addServiceGroup
- Throws:
AxisFault
-
addServiceToExistingServiceGroup
public void addServiceToExistingServiceGroup(AxisService axisService, String serviceGroupName) throws AxisFault This method is used to add a service to an existing active service group in the axis configuration- Parameters:
axisService- service to be added to the existing service group providedserviceGroupName- name of the service group which should be existing in the axis configuration- Throws:
AxisFault- in case of an error in adding the service to the group specified or if the group is not existing
-
addToAllServicesMap
- Throws:
AxisFault
-
removeServiceGroup
- Throws:
AxisFault
-
addTransportIn
Add an incoming transport description (i.e. receiver) to our configuration.- Parameters:
transport- TransportInDescription to add.- Throws:
AxisFault
-
addTransportOut
Add an outgoing transport description (i.e. sender) to our configuration.- Parameters:
transport- TransportOutDescription to add.- Throws:
AxisFault
-
engageModule
Engages the default module version corresponding to given module name , or if the module name contains version number in it then it will engage the correct module. Both of the below two cases are valid 1. engageModule("addressing"); 2. engageModule("addressing-1.23");- Parameters:
moduleref- name of module to engage- Throws:
AxisFault
-
engageModule
Engages a module using given name and its version ID.- Parameters:
moduleName- name of module to engageversionID- version of module to engage- Throws:
AxisFault
-
onEngage
- Overrides:
onEngagein classAxisDescription- Throws:
AxisFault
-
onDisengage
To dis-engage a module from the system. This will remove all the handlers belonging to this module from all the handler chains.- Overrides:
onDisengagein classAxisDescription- Parameters:
module- module to disengage- Throws:
AxisFault
-
notifyObservers
-
notifyObservers
-
notifyObservers
-
removeService
Remove a service.- Parameters:
name- name of service to remove- Throws:
AxisFault
-
addGlobalModuleRef
Add an AxisModule to the list of globally deployed modules. TODO: should this check for duplicate names?- Parameters:
moduleName- name of AxisModule to add to list.
-
engageGlobalModules
Engage all the previously added global modules.- Throws:
AxisFault- if an individual engageModule() fails
-
getFaultyModules
-
getFaultyServices
-
addFaultyServiceDuetoModule
Updates the map that keeps track of faulty services due to modules- Parameters:
moduleName- This service has become faulty due this module.faultyServiceData- Data that are required when recovering the faulty service.
-
getFaultyServicesDuetoModule
Returns a map which contains the faulty services due a particular module.- Parameters:
moduleName- name of the module about which to inquire- Returns:
- a Map<String, FaultyServiceData> mapping service name to data
-
getFaultyServicesDuetoModules
Returns the map which keeps track of faulty services due to modules.- Returns:
- a Map keyed by module name, containing Maps keyed by service name containing FaultyServiceData for each faulty service.
-
removeFaultyServiceDuetoModule
Removes a faulty service for a given module from the internal map. TODO: Doesn't this actually remove a faulty service *group*? And should this even be public?- Parameters:
moduleName- name of the module to look upserviceGroupName- name of the service group to remove
-
removeFaultyService
-
getOutFlowPhases
-
getInFaultFlowPhases
- Returns:
- Returns ArrayList.
-
getInFlowPhases
-
getMessageReceiver
-
getMessageBuilder
Get a Builder for a particular content type.- Parameters:
contentType- the desired content type- Returns:
- the configured message builder implementation class name against the given content type.
-
getMessageBuilder
-
getMessageFormatter
Get a MessageFormatter for the specified content type.- Parameters:
contentType- content type to look up- Returns:
- a MessageFormatter corresponding to the given content type, or null.
-
getModule
Get an AxisModule by name. If the exact name passed (which might contain a version) is present, we'll return that, otherwise we'll look for the default version *if* there is no version in the passed name.- Parameters:
name- module name to look up- Returns:
- an AxisModule if found, or null
-
getModule
Return the module having name=moduleName & version=moduleVersion- Parameters:
moduleName- The module namemoduleVersion- The version of the module- Returns:
- The AxisModule having name=moduleName & version=moduleVersion
-
getModuleClassLoader
Get the class loader that becomes the parent of all the modules- Returns:
- a ClassLoader
-
getModuleConfig
-
getModules
- Returns:
- Returns HashMap.
-
getOutFaultFlowPhases
- Returns:
- Returns ArrayList.
-
getPhasesInfo
-
getRepository
-
getService
Method getService.- Parameters:
name- the name of the service to look up- Returns:
- an AxisService if found, or null
- Throws:
AxisFault
-
getServiceForActivation
Service can start and stop, once stopped it cannot be accessed, so we need a way to get the service even if service is not active.- Parameters:
serviceName- name to look up- Returns:
- AxisService
-
getServiceClassLoader
-
getServiceGroup
-
getServiceGroups
-
getServices
-
getSystemClassLoader
-
getTransportIn
-
getTransportOut
-
getTransportsIn
-
getTransportsOut
-
isEngaged
Description copied from class:AxisDescriptionCheck if a given module is engaged at this level.- Overrides:
isEngagedin classAxisDescription- Parameters:
moduleId- module to investigate.- Returns:
- true if engaged, false if not. TODO: Handle versions? isEngaged("addressing") should be true even for versioned modulename...
-
isEngaged
- Overrides:
isEngagedin classAxisDescription
-
setGlobalOutPhase
-
setInFaultPhases
Set the inbound fault phases TODO: Passing mutable lists like this and using them directly is bad practice.- Parameters:
list- a List of Phases which will become our inbound fault flow
-
setInPhasesUptoAndIncludingPostDispatch
-
setModuleClassLoader
-
setOutFaultPhases
Set the outbound fault phases TODO: Passing mutable lists like this and using them directly is bad practice.- Parameters:
list- a List of Phases which will become our outbound fault flow
-
setPhasesInfo
-
setRepository
-
setServiceClassLoader
-
setSystemClassLoader
-
addDefaultModuleVersion
Adds a default module version, which can be done either programmatically or by using axis2.xml. The default module version is important if user asks to engage a module without given version ID, in which case, the default version is engaged. TODO: This currently does NOTHING if a default has already been set. Should either overwrite or throw.- Parameters:
moduleName- the name of the module for which we're setting the default versionmoduleVersion- the default version
-
getDefaultModuleVersion
-
getDefaultModule
-
getClusteringAgent
-
setClusteringAgent
-
getTransactionConfiguration
-
setTransactionConfig
-
getKey
- Specified by:
getKeyin classAxisDescription
-
stopService
- Throws:
AxisFault
-
startService
- Throws:
AxisFault
-
getModulesForPolicyNamesapce
-
registerModulePolicySupport
-
registerLocalPolicyAssertions
-
getObserversList
This method returns read-only list of AxisObservers registered with thisAxisConfiguration.- Returns:
- ArrayList
-
isStart
public boolean isStart() -
setStart
public void setStart(boolean start) -
getTargetResolverChain
getTargetResolverChain returns an instance of TargetResolver which iterates over the registered TargetResolvers, calling each one in turn when resolveTarget is called.- Returns:
- a TargetResolver which iterates over all registered TargetResolvers.
-
addTargetResolver
-
addLocalPolicyAssertion
-
getLocalPolicyAssertions
-
removeLocalPolicyAssertion
-
isAssertionLocal
-
addDataLocatorClassNames
Allows to define/configure Data Locator for specified dialect at Axis 2 Configuration.- Parameters:
dialect- - an absolute URI represents the format and version of dataclassname- - class name of the Data Locator configured to support retrieval for the specified dialect.
-
addDataLocator
For internal used only! To store instance of DataLocator when it is first loaded. This allows to reuse of the DataLocator after it is initially loaded.- Parameters:
dialect- - an absolute URI represents the format and version of datadataLocator- - specified an DataLocator instance to support retrieval of the specified dialect.
-
getDataLocator
Return DataLocator instance for specified dialect.- Parameters:
dialect- the dialect to look up- Returns:
- an AxisDataLocator, or null
-
getDataLocatorClassName
Return classname of DataLocator configured for specified dialect.- Parameters:
dialect- the dialect to look up- Returns:
- a String containing a class name, or null
-
validateSystemPredefinedPhases
Checks whether the system pre-defined phases for all the flows, have been changed. If they have been changed, throws a DeploymentException.- Throws:
DeploymentException
-
getConfigurator
-
setConfigurator
-
cleanup
public void cleanup() -
insertPhase
This method can be used to insert a phase at the runtime for a given location And the relative location can be specified by beforePhase and afterPhase. Parameters Either or both of them can be null , if both the parameters are null then the phase will be added some where in the global phase. If one of them are null then the phase will be added - If the beforePhase is null then the phase will be added after the afterPhase - If the after phase is null then the phase will be added before the beforePhase Type of the flow will be specified by the parameter flow. 1 - Inflow 2 - out flow 3 - fault in flow 4 - fault out flow- Parameters:
d- the Deployable representing the Phase to deployflow- the type of the flow- Throws:
AxisFault- : If something went wrong
-
isChildFirstClassLoading
public boolean isChildFirstClassLoading() -
isGlobalModulesRegistered
-