You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/12/16 18:18:08 UTC
svn commit: r357187 [11/25] - in
/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: ./
addressing/ client/ client/async/ context/ deployment/ deployment/listener/
deployment/repository/util/ deployment/scheduler/ deployment/util/
descript...
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -20,7 +21,16 @@
import org.apache.axis2.deployment.DeploymentEngine;
import org.apache.axis2.deployment.repository.util.ArchiveReader;
import org.apache.axis2.deployment.util.PhasesInfo;
-import org.apache.axis2.description.*;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.ModuleConfiguration;
+import org.apache.axis2.description.ModuleDescription;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.ParameterInclude;
+import org.apache.axis2.description.ParameterIncludeImpl;
+import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.util.HostConfiguration;
import org.apache.commons.logging.Log;
@@ -28,74 +38,71 @@
import javax.xml.namespace.QName;
import java.io.File;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
/**
* Class AxisConfigurationImpl
*/
public class AxisConfiguration implements ParameterInclude {
- /**
- * To store faulty services
- */
- private Hashtable faultyServices;
-
- private HashMap moduleConfigmap;
-
- private Hashtable faultyModules;
private Log log = LogFactory.getLog(getClass());
- //to store hots configuration if any
- HostConfiguration hostConfiguration;
-
/**
* Field modules
*/
private final HashMap modules = new HashMap();
-
private final HashMap serviceGroups = new HashMap();
private final HashMap transportsIn = new HashMap();
-
private final HashMap transportsOut = new HashMap();
+ // to store AxisObserver Objects
+ private ArrayList observersList = null;
+ private String axis2Repository = null;
+ private HashMap allservices = new HashMap();
+
/**
- * Field phases
+ * Field engagedModules
*/
- // private ArrayList inPhases;
- private ArrayList outPhases;
- private ArrayList inFaultPhases;
- private ArrayList outFaultPhases;
-
- private ArrayList inPhasesUptoAndIncludingPostDispatch;
+ protected final List engagedModules;
+ private Hashtable faultyModules;
- /////////////////////// From AxisGlobal /////////////////////////////////////
/**
- * Field paramInclude
+ * To store faulty services
*/
- protected final ParameterInclude paramInclude;
+ private Hashtable faultyServices;
+ // to store hots configuration if any
+ HostConfiguration hostConfiguration;
+ private ArrayList inFaultPhases;
+ private ArrayList inPhasesUptoAndIncludingPostDispatch;
+ protected HashMap messagReceivers;
- protected PhasesInfo phasesinfo;
+ // ///////////////////// From AxisGlobal /////////////////////////////////////
+
+ private ClassLoader moduleClassLoader;
+ private HashMap moduleConfigmap;
+ private ArrayList outFaultPhases;
/**
- * Field engagedModules
+ * Field phases
*/
- protected final List engagedModules;
-
- private String axis2Repository = null;
-
- //to store AxisObserver Objects
- private ArrayList observersList = null;
- private HashMap allservices = new HashMap();
+ // private ArrayList inPhases;
+ private ArrayList outPhases;
+ // ///////////////////// From AxisGlobal /////////////////////////////////////
- private ClassLoader systemClassLoader;
+ /**
+ * Field paramInclude
+ */
+ protected final ParameterInclude paramInclude;
+ protected PhasesInfo phasesinfo;
private ClassLoader serviceClassLoader;
- private ClassLoader moduleClassLoader;
-
-
- protected HashMap messagReceivers;
- /////////////////////// From AxisGlobal /////////////////////////////////////
+ private ClassLoader systemClassLoader;
/**
* Constructor AxisConfigurationImpl
@@ -105,64 +112,27 @@
paramInclude = new ParameterIncludeImpl();
engagedModules = new ArrayList();
messagReceivers = new HashMap();
-
outPhases = new ArrayList();
inFaultPhases = new ArrayList();
outFaultPhases = new ArrayList();
faultyServices = new Hashtable();
faultyModules = new Hashtable();
observersList = new ArrayList();
-
inPhasesUptoAndIncludingPostDispatch = new ArrayList();
systemClassLoader = Thread.currentThread().getContextClassLoader();
serviceClassLoader = Thread.currentThread().getContextClassLoader();
moduleClassLoader = Thread.currentThread().getContextClassLoader();
+
// setting the dafualt flow , if some one creat AxisConfig programatically
- // most requird handles will be there in the flow.
+ // most requird handles will be there in the flow.
- //todo we need to fix this , we know that we are doing wrong thing here
+ // todo we need to fix this , we know that we are doing wrong thing here
createDefaultChain();
-
- }
-
- private void createDefaultChain() {
- Phase transportIN = new Phase("TransportIn");
- Phase preDispatch = new Phase("PreDispatch");
- DispatchPhase dispatchPhase = new DispatchPhase();
- dispatchPhase.setName("Dispatch");
- AddressingBasedDispatcher abd = new AddressingBasedDispatcher();
- abd.initDispatcher();
-
- RequestURIBasedDispatcher rud = new RequestURIBasedDispatcher();
- rud.initDispatcher();
-
- SOAPActionBasedDispatcher sabd = new SOAPActionBasedDispatcher();
- sabd.initDispatcher();
-
- SOAPMessageBodyBasedDispatcher smbd = new SOAPMessageBodyBasedDispatcher();
- smbd.initDispatcher();
-
- InstanceDispatcher id = new InstanceDispatcher();
- id.init(new HandlerDescription(new QName("InstanceDispatcher")));
-
-
- dispatchPhase.addHandler(abd);
- dispatchPhase.addHandler(rud);
- dispatchPhase.addHandler(sabd);
- dispatchPhase.addHandler(smbd);
- dispatchPhase.addHandler(id);
- inPhasesUptoAndIncludingPostDispatch.add(transportIN);
- inPhasesUptoAndIncludingPostDispatch.add(preDispatch);
- inPhasesUptoAndIncludingPostDispatch.add(dispatchPhase);
- }
-
-
- public Hashtable getFaultyServices() {
- return faultyServices;
}
- public Hashtable getFaultyModules() {
- return faultyModules;
+ // //////////////////////// Form Axis Global
+ public void addMessageReceiver(String key, MessageReceiver messageReceiver) {
+ messagReceivers.put(key, messageReceiver);
}
/**
@@ -177,6 +147,32 @@
}
/**
+ * Adds module configuration, if there is moduleConfig tag in service.
+ *
+ * @param moduleConfiguration
+ */
+ public void addModuleConfig(ModuleConfiguration moduleConfiguration) {
+ moduleConfigmap.put(moduleConfiguration.getModuleName(), moduleConfiguration);
+ }
+
+ public void addObservers(AxisObserver axisObserver) {
+ observersList.add(axisObserver);
+ }
+
+ /**
+ * Method addParameter.
+ *
+ * @param param
+ */
+ public void addParameter(Parameter param) throws AxisFault {
+ if (isParameterLocked(param.getName())) {
+ throw new AxisFault("Parmter is locked can not overide: " + param.getName());
+ } else {
+ paramInclude.addParameter(param);
+ }
+ }
+
+ /**
* Method addService.
*
* @param service
@@ -184,6 +180,7 @@
*/
public synchronized void addService(AxisService service) throws AxisFault {
AxisServiceGroup axisServiceGroup = new AxisServiceGroup();
+
axisServiceGroup.setServiceGroupName(service.getName());
axisServiceGroup.setParent(this);
axisServiceGroup.addService(service);
@@ -192,72 +189,37 @@
public void addServiceGroup(AxisServiceGroup axisServiceGroup) throws AxisFault {
Iterator services = axisServiceGroup.getServices();
+
axisServiceGroup.setParent(this);
+
AxisService description;
+
while (services.hasNext()) {
description = (AxisService) services.next();
+
if (allservices.get(description.getName()) != null) {
- throw new AxisFault("Two services can not have same name, a service with " +
- description.getName() + " alredy exist in the system");
+ throw new AxisFault("Two services can not have same name, a service with "
+ + description.getName() + " alredy exist in the system");
}
}
+
services = axisServiceGroup.getServices();
+
while (services.hasNext()) {
description = (AxisService) services.next();
allservices.put(description.getName(), description);
notifyObservers(AxisEvent.SERVICE_DEPLOY, description);
}
+
Iterator enModule = engagedModules.iterator();
+
while (enModule.hasNext()) {
QName moduleDescription = (QName) enModule.next();
- axisServiceGroup.engageModuleToGroup(moduleDescription);
- }
- serviceGroups.put(axisServiceGroup.getServiceGroupName(), axisServiceGroup);
- }
-
- /**
- * Method getModule.
- *
- * @param name
- * @return Returns ModuleDescription.
- */
- public ModuleDescription getModule(QName name) {
- return (ModuleDescription) modules.get(name);
- }
-
- /**
- * @return Returns HashMap.
- */
- public HashMap getModules() {
- return modules;
- }
-
- /**
- * Method getService.
- *
- * @param name
- * @return Returns AxisService.
- * @throws AxisFault
- */
- public AxisService getService(String name) throws AxisFault {
- return (AxisService) allservices.get(name);
- }
- /**
- * Method removeService.
- *
- * @param name
- * @throws AxisFault
- */
- public synchronized void removeService(String name) throws AxisFault {
- AxisService service = (AxisService) allservices.remove(name);
- if (service != null) {
- log.info("Removed service " + name);
+ axisServiceGroup.engageModuleToGroup(moduleDescription);
}
- }
- public TransportInDescription getTransportIn(QName name) throws AxisFault {
- return (TransportInDescription) transportsIn.get(name);
+ serviceGroups.put(axisServiceGroup.getServiceGroupName(), axisServiceGroup);
}
/**
@@ -266,109 +228,162 @@
* @param transport
* @throws AxisFault
*/
- public synchronized void addTransportIn(TransportInDescription transport)
- throws AxisFault {
+ public synchronized void addTransportIn(TransportInDescription transport) throws AxisFault {
transportsIn.put(transport.getName(), transport);
}
- public TransportOutDescription getTransportOut(QName name) throws AxisFault {
- return (TransportOutDescription) transportsOut.get(name);
- }
-
/**
* Method addTransportOut.
*
* @param transport
* @throws AxisFault
*/
- public synchronized void addTransportOut(TransportOutDescription transport)
- throws AxisFault {
+ public synchronized void addTransportOut(TransportOutDescription transport) throws AxisFault {
transportsOut.put(transport.getName(), transport);
}
- public HashMap getTransportsIn() {
- return transportsIn;
- }
+ private void createDefaultChain() {
+ Phase transportIN = new Phase("TransportIn");
+ Phase preDispatch = new Phase("PreDispatch");
+ DispatchPhase dispatchPhase = new DispatchPhase();
- public HashMap getTransportsOut() {
- return transportsOut;
- }
+ dispatchPhase.setName("Dispatch");
- /**
- * Checks whether a given parameter is locked.
- *
- * @param parameterName
- * @return Returns boolean
- */
- public boolean isParameterLocked(String parameterName) {
- Parameter parameter = getParameter(parameterName);
- return parameter != null && parameter.isLocked();
- }
+ AddressingBasedDispatcher abd = new AddressingBasedDispatcher();
- public void deserializeParameters(OMElement parameters) throws AxisFault {
- this.paramInclude.deserializeParameters(parameters);
- }
+ abd.initDispatcher();
- public AxisServiceGroup getServiceGroup(String serviceNameAndGroupString) {
- return (AxisServiceGroup) serviceGroups.get(serviceNameAndGroupString);
- }
+ RequestURIBasedDispatcher rud = new RequestURIBasedDispatcher();
- public Iterator getServiceGroups() {
- return serviceGroups.values().iterator();
- }
+ rud.initDispatcher();
- public ArrayList getInPhasesUptoAndIncludingPostDispatch() {
- return inPhasesUptoAndIncludingPostDispatch;
- }
+ SOAPActionBasedDispatcher sabd = new SOAPActionBasedDispatcher();
- //to get the out flow correpodning to the global out flow;
- public ArrayList getGlobalOutPhases() {
- return this.outPhases;
- }
+ sabd.initDispatcher();
- public void setGlobalOutPhase(ArrayList outPhases) {
- this.outPhases = outPhases;
- }
+ SOAPMessageBodyBasedDispatcher smbd = new SOAPMessageBodyBasedDispatcher();
- public void setInPhasesUptoAndIncludingPostDispatch(ArrayList inPhasesUptoAndIncludingPostDispatch) {
- this.inPhasesUptoAndIncludingPostDispatch = inPhasesUptoAndIncludingPostDispatch;
- }
+ smbd.initDispatcher();
+ InstanceDispatcher id = new InstanceDispatcher();
- /**
- * @return Returns ArrayList
- */
- public ArrayList getInFaultFlow() {
- return inFaultPhases;
+ id.init(new HandlerDescription(new QName("InstanceDispatcher")));
+ dispatchPhase.addHandler(abd);
+ dispatchPhase.addHandler(rud);
+ dispatchPhase.addHandler(sabd);
+ dispatchPhase.addHandler(smbd);
+ dispatchPhase.addHandler(id);
+ inPhasesUptoAndIncludingPostDispatch.add(transportIN);
+ inPhasesUptoAndIncludingPostDispatch.add(preDispatch);
+ inPhasesUptoAndIncludingPostDispatch.add(dispatchPhase);
}
-
- /**
- * @return Returns ArrayList
- */
- public ArrayList getOutFaultFlow() {
- return outFaultPhases;
+ public void deserializeParameters(OMElement parameters) throws AxisFault {
+ this.paramInclude.deserializeParameters(parameters);
+ }
+
+ public void engageModule(QName moduleref) throws AxisFault {
+ ModuleDescription module = getModule(moduleref);
+ boolean isNewmodule = false;
+
+ if (module == null) {
+ File file =
+ new ArchiveReader().creatModuleArchivefromResource(moduleref.getLocalPart(),
+ getRepository());
+
+ module = new DeploymentEngine().buildModule(file, this);
+ isNewmodule = true;
+ }
+
+ if (module != null) {
+ for (Iterator iterator = engagedModules.iterator(); iterator.hasNext();) {
+ QName qName = (QName) iterator.next();
+
+ if (moduleref.equals(qName)) {
+ log.info("Attempt to engage an already engaged module " + qName);
+
+ return;
+ }
+ }
+ } else {
+ throw new AxisFault(this + " Refer to invalid module " + moduleref.getLocalPart()
+ + " has not bean deployed yet !");
+ }
+
+ Iterator servicegroups = getServiceGroups();
+
+ while (servicegroups.hasNext()) {
+ AxisServiceGroup serviceGroup = (AxisServiceGroup) servicegroups.next();
+
+ serviceGroup.engageModuleToGroup(module.getName());
+ }
+
+ if (isNewmodule) {
+ addModule(module);
+ }
+
+ engagedModules.add(moduleref);
+ }
+
+ public void notifyObservers(int event_type, AxisService service) {
+ AxisEvent event = new AxisEvent(service, event_type);
+
+ for (int i = 0; i < observersList.size(); i++) {
+ AxisObserver axisObserver = (AxisObserver) observersList.get(i);
+
+ axisObserver.update(event);
+ }
}
/**
- * @param list
+ * Method removeService.
+ *
+ * @param name
+ * @throws AxisFault
*/
- public void setInFaultPhases(ArrayList list) {
- inFaultPhases = list;
+ public synchronized void removeService(String name) throws AxisFault {
+ AxisService service = (AxisService) allservices.remove(name);
+
+ if (service != null) {
+ log.info("Removed service " + name);
+ }
}
/**
- * @param list
+ * Method getEngagedModules.
+ *
+ * @return Collection
*/
- public void setOutFaultPhases(ArrayList list) {
- outFaultPhases = list;
+ public Collection getEngagedModules() {
+ return engagedModules;
}
- ////////////////////////// Form Axis Global
+ public Hashtable getFaultyModules() {
+ return faultyModules;
+ }
- public void addMessageReceiver(String key,
- MessageReceiver messageReceiver) {
- messagReceivers.put(key, messageReceiver);
+ public Hashtable getFaultyServices() {
+ return faultyServices;
+ }
+
+ // to get the out flow correpodning to the global out flow;
+ public ArrayList getGlobalOutPhases() {
+ return this.outPhases;
+ }
+
+ public HostConfiguration getHostConfiguration() {
+ return this.hostConfiguration;
+ }
+
+ /**
+ * @return Returns ArrayList
+ */
+ public ArrayList getInFaultFlow() {
+ return inFaultPhases;
+ }
+
+ public ArrayList getInPhasesUptoAndIncludingPostDispatch() {
+ return inPhasesUptoAndIncludingPostDispatch;
}
public MessageReceiver getMessageReceiver(String key) {
@@ -376,6 +391,39 @@
}
/**
+ * Method getModule.
+ *
+ * @param name
+ * @return Returns ModuleDescription.
+ */
+ public ModuleDescription getModule(QName name) {
+ return (ModuleDescription) modules.get(name);
+ }
+
+ // the class loder that become the paranet of all the moduels
+ public ClassLoader getModuleClassLoader() {
+ return this.moduleClassLoader;
+ }
+
+ public ModuleConfiguration getModuleConfig(QName moduleName) {
+ return (ModuleConfiguration) moduleConfigmap.get(moduleName);
+ }
+
+ /**
+ * @return Returns HashMap.
+ */
+ public HashMap getModules() {
+ return modules;
+ }
+
+ /**
+ * @return Returns ArrayList
+ */
+ public ArrayList getOutFaultFlow() {
+ return outFaultPhases;
+ }
+
+ /**
* Method getParameter.
*
* @param name
@@ -389,156 +437,138 @@
return paramInclude.getParameters();
}
- /**
- * Method addParameter.
- *
- * @param param
- */
- public void addParameter(Parameter param) throws AxisFault {
- if (isParameterLocked(param.getName())) {
- throw new AxisFault("Parmter is locked can not overide: " + param.getName());
- } else {
- paramInclude.addParameter(param);
- }
+ public PhasesInfo getPhasesInfo() {
+ return phasesinfo;
+ }
+
+ public String getRepository() {
+ return axis2Repository;
}
/**
- * Method getEngagedModules.
+ * Method getService.
*
- * @return Collection
+ * @param name
+ * @return Returns AxisService.
+ * @throws AxisFault
*/
- public Collection getEngagedModules() {
- return engagedModules;
+ public AxisService getService(String name) throws AxisFault {
+ return (AxisService) allservices.get(name);
}
- public void engageModule(QName moduleref) throws AxisFault {
- ModuleDescription module = getModule(moduleref);
- boolean isNewmodule = false;
- if (module == null) {
- File file = new ArchiveReader().creatModuleArchivefromResource(
- moduleref.getLocalPart(), getRepository());
- module = new DeploymentEngine().buildModule(file, this);
- isNewmodule = true;
- }
- if (module != null) {
- for (Iterator iterator = engagedModules.iterator();
- iterator.hasNext();) {
- QName qName = (QName) iterator.next();
- if (moduleref.equals(qName)) {
- log.info("Attempt to engage an already engaged module " + qName);
- return;
- }
- }
- } else {
- throw new AxisFault(
- this + " Refer to invalid module "
- + moduleref.getLocalPart() +
- " has not bean deployed yet !");
- }
- Iterator servicegroups = getServiceGroups();
- while (servicegroups.hasNext()) {
- AxisServiceGroup serviceGroup = (AxisServiceGroup) servicegroups.next();
- serviceGroup.engageModuleToGroup(module.getName());
- }
- if (isNewmodule) {
- addModule(module);
- }
- engagedModules.add(moduleref);
+ // the class loder that become the paranet of all the services
+ public ClassLoader getServiceClassLoader() {
+ return this.serviceClassLoader;
+ }
+
+ public AxisServiceGroup getServiceGroup(String serviceNameAndGroupString) {
+ return (AxisServiceGroup) serviceGroups.get(serviceNameAndGroupString);
}
- //to get all the services in the system
+ public Iterator getServiceGroups() {
+ return serviceGroups.values().iterator();
+ }
+
+ // to get all the services in the system
public HashMap getServices() {
Iterator sgs = getServiceGroups();
+
while (sgs.hasNext()) {
AxisServiceGroup axisServiceGroup = (AxisServiceGroup) sgs.next();
Iterator servics = axisServiceGroup.getServices();
+
while (servics.hasNext()) {
AxisService axisService = (AxisService) servics.next();
+
allservices.put(axisService.getName(), axisService);
}
}
+
return allservices;
}
- public boolean isEngaged(QName moduleName) {
- return engagedModules.contains(moduleName);
+ // the class loder which become the top most parent of all the modules and services
+ public ClassLoader getSystemClassLoader() {
+ return this.systemClassLoader;
}
- public PhasesInfo getPhasesInfo() {
- return phasesinfo;
+ public TransportInDescription getTransportIn(QName name) throws AxisFault {
+ return (TransportInDescription) transportsIn.get(name);
}
- public void setPhasesinfo(PhasesInfo phasesInfo) {
- this.phasesinfo = phasesInfo;
+ public TransportOutDescription getTransportOut(QName name) throws AxisFault {
+ return (TransportOutDescription) transportsOut.get(name);
}
- public String getRepository() {
- return axis2Repository;
+ public HashMap getTransportsIn() {
+ return transportsIn;
}
- public void setRepository(String axis2Repository) {
- this.axis2Repository = axis2Repository;
+ public HashMap getTransportsOut() {
+ return transportsOut;
}
- public void notifyObservers(int event_type, AxisService service) {
- AxisEvent event = new AxisEvent(service, event_type);
- for (int i = 0; i < observersList.size(); i++) {
- AxisObserver axisObserver = (AxisObserver) observersList.get(i);
- axisObserver.update(event);
- }
+ public boolean isEngaged(QName moduleName) {
+ return engagedModules.contains(moduleName);
}
- //the class loder which become the top most parent of all the modules and services
- public ClassLoader getSystemClassLoader() {
- return this.systemClassLoader;
+ /**
+ * Checks whether a given parameter is locked.
+ *
+ * @param parameterName
+ * @return Returns boolean
+ */
+ public boolean isParameterLocked(String parameterName) {
+ Parameter parameter = getParameter(parameterName);
+
+ return (parameter != null) && parameter.isLocked();
}
- public void setSystemClassLoader(ClassLoader classLoader) {
- this.systemClassLoader = classLoader;
+ public void setGlobalOutPhase(ArrayList outPhases) {
+ this.outPhases = outPhases;
}
- // the class loder that become the paranet of all the services
- public ClassLoader getServiceClassLoader() {
- return this.serviceClassLoader;
+ // to set and get host configuration
+ public void setHostConfiguration(HostConfiguration hostConfiguration) {
+ this.hostConfiguration = hostConfiguration;
}
- public void setServiceClassLoader(ClassLoader classLoader) {
- this.serviceClassLoader = classLoader;
+ /**
+ * @param list
+ */
+ public void setInFaultPhases(ArrayList list) {
+ inFaultPhases = list;
}
- // the class loder that become the paranet of all the moduels
- public ClassLoader getModuleClassLoader() {
- return this.moduleClassLoader;
+ public void setInPhasesUptoAndIncludingPostDispatch(
+ ArrayList inPhasesUptoAndIncludingPostDispatch) {
+ this.inPhasesUptoAndIncludingPostDispatch = inPhasesUptoAndIncludingPostDispatch;
}
public void setModuleClassLoader(ClassLoader classLoader) {
this.moduleClassLoader = classLoader;
}
- //to set and get host configuration
- public void setHostConfiguration(HostConfiguration hostConfiguration) {
- this.hostConfiguration = hostConfiguration;
+ /**
+ * @param list
+ */
+ public void setOutFaultPhases(ArrayList list) {
+ outFaultPhases = list;
}
- public HostConfiguration getHostConfiguration() {
- return this.hostConfiguration;
+ public void setPhasesinfo(PhasesInfo phasesInfo) {
+ this.phasesinfo = phasesInfo;
}
- public void addObservers(AxisObserver axisObserver) {
- observersList.add(axisObserver);
+ public void setRepository(String axis2Repository) {
+ this.axis2Repository = axis2Repository;
}
-
- /**
- * Adds module configuration, if there is moduleConfig tag in service.
- *
- * @param moduleConfiguration
- */
- public void addModuleConfig(ModuleConfiguration moduleConfiguration) {
- moduleConfigmap.put(moduleConfiguration.getModuleName(), moduleConfiguration);
+ public void setServiceClassLoader(ClassLoader classLoader) {
+ this.serviceClassLoader = classLoader;
}
- public ModuleConfiguration getModuleConfig(QName moduleName) {
- return (ModuleConfiguration) moduleConfigmap.get(moduleName);
+ public void setSystemClassLoader(ClassLoader classLoader) {
+ this.systemClassLoader = classLoader;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationCreator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationCreator.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationCreator.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationCreator.java Fri Dec 16 09:13:57 2005
@@ -21,10 +21,11 @@
*/
public interface AxisConfigurationCreator {
+
/**
* Configurationcontextfactory will call this method to get the AxisConfiguration
*
* @return AxisConfigurationCreator
*/
- AxisConfiguration getAxisConfiguration() throws AxisFault ;
+ AxisConfiguration getAxisConfiguration() throws AxisFault;
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -25,7 +26,15 @@
import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.om.OMAbstractFactory;
-import org.apache.axis2.soap.*;
+import org.apache.axis2.soap.SOAP11Constants;
+import org.apache.axis2.soap.SOAP12Constants;
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.axis2.soap.SOAPFault;
+import org.apache.axis2.soap.SOAPFaultCode;
+import org.apache.axis2.soap.SOAPFaultDetail;
+import org.apache.axis2.soap.SOAPFaultReason;
+import org.apache.axis2.soap.SOAPHeaderBlock;
+import org.apache.axis2.soap.SOAPProcessingException;
import org.apache.axis2.transport.TransportSender;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -38,6 +47,7 @@
* Methods are the basic operations the Sync, Async messageing are build on top.
*/
public class AxisEngine {
+
/**
* Field log
*/
@@ -52,72 +62,17 @@
this.engineContext = engineContext;
}
- /**
- * This methods represents the outflow of the Axis, this could be either at the server side or the client side.
- * Here the <code>ExecutionChain</code> is created using the Phases. The Handlers at the each Phases is ordered in
- * deployment time by the deployment module
- *
- * @param msgContext
- * @throws AxisFault
- * @see MessageContext
- * @see Phase
- * @see Handler
- */
- public void send(MessageContext msgContext) throws AxisFault {
- //find and invoke the Phases
- OperationContext operationContext = msgContext.getOperationContext();
- ArrayList executionChain = operationContext.getAxisOperation().getPhasesOutFlow();
- msgContext.setExecutionChain((ArrayList) executionChain.clone());
- msgContext.invoke();
- msgContext.setExecutionChain((ArrayList)msgContext.getConfigurationContext().
- getAxisConfiguration().getGlobalOutPhases().clone());
- msgContext.invoke();
-
- if (!msgContext.isPaused()) {
- //write the Message to the Wire
- TransportOutDescription transportOut = msgContext.getTransportOut();
- TransportSender sender = transportOut.getSender();
- sender.invoke(msgContext);
- }
- }
-
- /**
- * This methods represents the inflow of the Axis, this could be either at the server side or the client side.
- * Here the <code>ExecutionChain</code> is created using the Phases. The Handlers at the each Phases is ordered in
- * deployment time by the deployment module
- *
- * @throws AxisFault
- * @see MessageContext
- * @see Phase
- * @see Handler
- */
- public void receive(MessageContext msgContext) throws AxisFault {
-
- ConfigurationContext confContext = msgContext.getConfigurationContext();
- ArrayList preCalculatedPhases = confContext.getAxisConfiguration()
- .getInPhasesUptoAndIncludingPostDispatch();
-
- // Set the initial execution chain in the MessageContext to a *copy* of what
- // we got above. This allows individual message processing to change the chain without
- // affecting later messages.
- msgContext.setExecutionChain((ArrayList) preCalculatedPhases.clone());
- msgContext.invoke();
-
- if (msgContext.isServerSide() && !msgContext.isPaused()) {
- // invoke the Message Receivers
- checkMustUnderstand(msgContext);
- MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
- receiver.receive(msgContext);
- }
- }
-
private void checkMustUnderstand(MessageContext msgContext) throws AxisFault {
- //todo : need to move this to pre-condiftion of the MessageReciver-Phase
+
+ // todo : need to move this to pre-condiftion of the MessageReciver-Phase
SOAPEnvelope se = msgContext.getEnvelope();
+
if (se.getHeader() == null) {
return;
}
+
Iterator hbs = se.getHeader().examineAllHeaderBlocks();
+
while (hbs.hasNext()) {
SOAPHeaderBlock hb = (SOAPHeaderBlock) hbs.next();
@@ -126,71 +81,39 @@
if (hb.isProcessed() || !hb.getMustUnderstand()) {
continue;
}
+
// if this header block is not targetted to me then its not my
// problem. Currently this code only supports the "next" role; we
// need to fix this to allow the engine/service to be in one or more
// additional roles and then to check that any headers targetted for
// that role too have been dealt with.
-
String role = hb.getRole();
if (!msgContext.isSOAP11()) {
- //if must understand and soap 1.2 the Role should be NEXT , if it is null we considerr
+
+ // if must understand and soap 1.2 the Role should be NEXT , if it is null we considerr
// it to be NEXT
- if (role != null && !SOAP12Constants.SOAP_ROLE_NEXT.equals(role)) {
- throw new AxisFault("Must Understand check failed", SOAP11Constants.FAULT_CODE_MUST_UNDERSTAND);
+ if ((role != null) && !SOAP12Constants.SOAP_ROLE_NEXT.equals(role)) {
+ throw new AxisFault("Must Understand check failed",
+ SOAP11Constants.FAULT_CODE_MUST_UNDERSTAND);
}
- //TODO what should be do with the Ulitmate Receiver? Axis2 is ultimate Receiver most of the time
- //should we support that as well
+ // TODO what should be do with the Ulitmate Receiver? Axis2 is ultimate Receiver most of the time
+ // should we support that as well
} else {
- //if must understand and soap 1.1 the actor should be NEXT , if it is null we considerr
+
+ // if must understand and soap 1.1 the actor should be NEXT , if it is null we considerr
// it to be NEXT
- if (role != null && !SOAP11Constants.SOAP_ACTOR_NEXT.equals(role)) {
- throw new AxisFault("Must Understand check failed", SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND);
+ if ((role != null) && !SOAP11Constants.SOAP_ACTOR_NEXT.equals(role)) {
+ throw new AxisFault("Must Understand check failed",
+ SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND);
}
}
-
}
}
/**
- * Sends the SOAP Fault to another SOAP node.
- *
- * @param msgContext
- * @throws AxisFault
- */
- public void sendFault(MessageContext msgContext) throws AxisFault {
- OperationContext opContext = msgContext.getOperationContext();
- //find and execute the Fault Out Flow Handlers
- if (opContext != null) {
- AxisOperation axisOperation = opContext.getAxisOperation();
- ArrayList faultExecutionChain = axisOperation.getPhasesOutFaultFlow();
- msgContext.setExecutionChain((ArrayList) faultExecutionChain.clone());
- msgContext.invoke();
- }
-
- // TODO: Make this clearer - should we have transport senders and messagereceivers as Handlers?
- if (!msgContext.isPaused()) {
- //Actually send the SOAP Fault
- TransportSender sender = msgContext.getTransportOut().getSender();
- sender.invoke(msgContext);
- }
- }
-
- /**
- * This is invoked when a SOAP Fault is received from a Other SOAP Node
- * Receives a SOAP fault from another SOAP node.
- *
- * @param msgContext
- * @throws AxisFault
- */
- public void receiveFault(MessageContext msgContext) throws AxisFault {
- // TODO : rationalize fault handling!
- }
-
- /**
* This method is called to handle any error that occurs at inflow or outflow. But if the
* method is called twice, it implies that sending the error handling has failed, in which case
* the method logs the error and exists.
@@ -199,29 +122,26 @@
* @param e
* @throws AxisFault
*/
- public MessageContext createFaultMessageContext(
- MessageContext processingContext,
- Throwable e)
+ public MessageContext createFaultMessageContext(MessageContext processingContext, Throwable e)
throws AxisFault {
if (processingContext.isProcessingFault()) {
- //We get the error file processing the fault. nothing we can do
- throw new AxisFault(
- Messages.getMessage("errorwhileProcessingFault"));
+
+ // We get the error file processing the fault. nothing we can do
+ throw new AxisFault(Messages.getMessage("errorwhileProcessingFault"));
}
- MessageContext faultContext =
- new MessageContext(
- engineContext,
- processingContext.getSessionContext(),
- processingContext.getTransportIn(),
- processingContext.getTransportOut());
+ MessageContext faultContext = new MessageContext(engineContext,
+ processingContext.getSessionContext(),
+ processingContext.getTransportIn(),
+ processingContext.getTransportOut());
faultContext.setProcessingFault(true);
+
if (processingContext.getFaultTo() != null) {
faultContext.setFaultTo(processingContext.getFaultTo());
} else {
- Object writer =
- processingContext.getProperty(MessageContext.TRANSPORT_OUT);
+ Object writer = processingContext.getProperty(MessageContext.TRANSPORT_OUT);
+
if (writer != null) {
faultContext.setProperty(MessageContext.TRANSPORT_OUT, writer);
} else {
@@ -232,31 +152,29 @@
faultContext.setOperationContext(processingContext.getOperationContext());
faultContext.setProcessingFault(true);
faultContext.setServerSide(true);
+
SOAPEnvelope envelope;
faultContext.setProperty(Constants.OUT_TRANSPORT_INFO,
processingContext.getProperty(Constants.OUT_TRANSPORT_INFO));
if (processingContext.isSOAP11()) {
- envelope =
- OMAbstractFactory.getSOAP11Factory().getDefaultFaultEnvelope();
+ envelope = OMAbstractFactory.getSOAP11Factory().getDefaultFaultEnvelope();
} else {
+
// Following will make SOAP 1.2 as the default, too.
- envelope =
- OMAbstractFactory.getSOAP12Factory().getDefaultFaultEnvelope();
+ envelope = OMAbstractFactory.getSOAP12Factory().getDefaultFaultEnvelope();
}
// TODO do we need to set old Headers back?
-
- // body.addFault(new AxisFault(e.getMessage(), e));
- // body.getFault().setException(new AxisFault(e));
- extractFaultInformationFromMessageContext(
- processingContext,
- envelope.getBody().getFault(),
+ // body.addFault(new AxisFault(e.getMessage(), e));
+ // body.getFault().setException(new AxisFault(e));
+ extractFaultInformationFromMessageContext(processingContext, envelope.getBody().getFault(),
e);
-
faultContext.setEnvelope(envelope);
- faultContext.setProperty(Constants.OUT_TRANSPORT_INFO, processingContext.getProperty(Constants.OUT_TRANSPORT_INFO));
+ faultContext.setProperty(Constants.OUT_TRANSPORT_INFO,
+ processingContext.getProperty(Constants.OUT_TRANSPORT_INFO));
+
return faultContext;
}
@@ -292,15 +210,14 @@
* @param fault
* @param e
*/
- private void extractFaultInformationFromMessageContext(
- MessageContext context,
- SOAPFault fault,
- Throwable e) {
+ private void extractFaultInformationFromMessageContext(MessageContext context, SOAPFault fault,
+ Throwable e) {
SOAPProcessingException soapException = null;
String soapNamespaceURI;
// get the current SOAP version
if (!context.isSOAP11()) {
+
// defaulting to SOAP 1.2
soapNamespaceURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
} else {
@@ -314,12 +231,13 @@
soapException = (SOAPProcessingException) e.getCause();
}
} else {
+
// we have recd an instance of just the Exception class
}
- Object faultCode =
- context.getProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME);
+ Object faultCode = context.getProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME);
String soapFaultCode = "";
+
if (faultCode != null) {
fault.setCode((SOAPFaultCode) faultCode);
} else if (soapException != null) {
@@ -329,15 +247,14 @@
}
// defaulting to fault code Sender, if no message is available
- soapFaultCode =
- ("".equals(soapFaultCode) || soapFaultCode == null)
- ? getSenderFaultCode(soapNamespaceURI)
- : soapFaultCode;
+ soapFaultCode = ("".equals(soapFaultCode) || (soapFaultCode == null))
+ ? getSenderFaultCode(soapNamespaceURI)
+ : soapFaultCode;
fault.getCode().getValue().setText(soapFaultCode);
- Object faultReason =
- context.getProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME);
+ Object faultReason = context.getProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME);
String message = "";
+
if (faultReason != null) {
fault.setReason((SOAPFaultReason) faultReason);
} else if (soapException != null) {
@@ -347,31 +264,33 @@
}
// defaulting to reason, unknown, if no reason is available
- message =
- ("".equals(message) || message == null) ? "unknown" : message;
+ message = ("".equals(message) || (message == null))
+ ? "unknown"
+ : message;
fault.getReason().getSOAPText().setText(message);
- Object faultRole =
- context.getProperty(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME);
+ Object faultRole = context.getProperty(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME);
+
if (faultRole != null) {
fault.getRole().setText((String) faultRole);
} else {
+
// TODO : get the role of this server and assign it here
fault.getRole().setText("http://myAxisServer/role/default");
}
- Object faultNode =
- context.getProperty(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME);
+ Object faultNode = context.getProperty(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME);
+
if (faultNode != null) {
fault.getNode().setText((String) faultNode);
} else {
+
// TODO : get the node of this server and assign it here
fault.getNode().setText("http://myAxisServer/role/default");
-
}
- Object faultDetail =
- context.getProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
+ Object faultDetail = context.getProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
+
if (faultDetail != null) {
fault.setDetail((SOAPFaultDetail) faultDetail);
} else if (fault.getException() == null) {
@@ -380,27 +299,128 @@
} else {
fault.setException(new Exception(e));
}
+ }
+ }
+
+ /**
+ * This methods represents the inflow of the Axis, this could be either at the server side or the client side.
+ * Here the <code>ExecutionChain</code> is created using the Phases. The Handlers at the each Phases is ordered in
+ * deployment time by the deployment module
+ *
+ * @throws AxisFault
+ * @see MessageContext
+ * @see Phase
+ * @see Handler
+ */
+ public void receive(MessageContext msgContext) throws AxisFault {
+ ConfigurationContext confContext = msgContext.getConfigurationContext();
+ ArrayList preCalculatedPhases =
+ confContext.getAxisConfiguration().getInPhasesUptoAndIncludingPostDispatch();
+ // Set the initial execution chain in the MessageContext to a *copy* of what
+ // we got above. This allows individual message processing to change the chain without
+ // affecting later messages.
+ msgContext.setExecutionChain((ArrayList) preCalculatedPhases.clone());
+ msgContext.invoke();
+
+ if (msgContext.isServerSide() && !msgContext.isPaused()) {
+
+ // invoke the Message Receivers
+ checkMustUnderstand(msgContext);
+
+ MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
+
+ receiver.receive(msgContext);
}
}
+ /**
+ * This is invoked when a SOAP Fault is received from a Other SOAP Node
+ * Receives a SOAP fault from another SOAP node.
+ *
+ * @param msgContext
+ * @throws AxisFault
+ */
+ public void receiveFault(MessageContext msgContext) throws AxisFault {
- public void resume(MessageContext msgctx)
- throws AxisFault {
+ // TODO : rationalize fault handling!
+ }
+
+ public void resume(MessageContext msgctx) throws AxisFault {
msgctx.resume();
}
- private String getSenderFaultCode(String soapNamespace) {
- return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(
- soapNamespace)
- ? SOAP12Constants.FAULT_CODE_SENDER
- : SOAP11Constants.FAULT_CODE_SENDER;
+ /**
+ * This methods represents the outflow of the Axis, this could be either at the server side or the client side.
+ * Here the <code>ExecutionChain</code> is created using the Phases. The Handlers at the each Phases is ordered in
+ * deployment time by the deployment module
+ *
+ * @param msgContext
+ * @throws AxisFault
+ * @see MessageContext
+ * @see Phase
+ * @see Handler
+ */
+ public void send(MessageContext msgContext) throws AxisFault {
+
+ // find and invoke the Phases
+ OperationContext operationContext = msgContext.getOperationContext();
+ ArrayList executionChain = operationContext.getAxisOperation().getPhasesOutFlow();
+
+ msgContext.setExecutionChain((ArrayList) executionChain.clone());
+ msgContext.invoke();
+ msgContext
+ .setExecutionChain((ArrayList) msgContext.getConfigurationContext()
+ .getAxisConfiguration().getGlobalOutPhases().clone());
+ msgContext.invoke();
+
+ if (!msgContext.isPaused()) {
+
+ // write the Message to the Wire
+ TransportOutDescription transportOut = msgContext.getTransportOut();
+ TransportSender sender = transportOut.getSender();
+
+ sender.invoke(msgContext);
+ }
+ }
+
+ /**
+ * Sends the SOAP Fault to another SOAP node.
+ *
+ * @param msgContext
+ * @throws AxisFault
+ */
+ public void sendFault(MessageContext msgContext) throws AxisFault {
+ OperationContext opContext = msgContext.getOperationContext();
+
+ // find and execute the Fault Out Flow Handlers
+ if (opContext != null) {
+ AxisOperation axisOperation = opContext.getAxisOperation();
+ ArrayList faultExecutionChain = axisOperation.getPhasesOutFaultFlow();
+
+ msgContext.setExecutionChain((ArrayList) faultExecutionChain.clone());
+ msgContext.invoke();
+ }
+
+ // TODO: Make this clearer - should we have transport senders and messagereceivers as Handlers?
+ if (!msgContext.isPaused()) {
+
+ // Actually send the SOAP Fault
+ TransportSender sender = msgContext.getTransportOut().getSender();
+
+ sender.invoke(msgContext);
+ }
}
private String getReceiverFaultCode(String soapNamespace) {
- return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(
- soapNamespace)
+ return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespace)
? SOAP12Constants.FAULT_CODE_RECEIVER
: SOAP11Constants.FAULT_CODE_RECEIVER;
+ }
+
+ private String getSenderFaultCode(String soapNamespace) {
+ return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespace)
+ ? SOAP12Constants.FAULT_CODE_SENDER
+ : SOAP11Constants.FAULT_CODE_SENDER;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisError.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisError.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisError.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisError.java Fri Dec 16 09:13:57 2005
@@ -1,9 +1,7 @@
package org.apache.axis2.engine;
public class AxisError extends RuntimeException {
-
public AxisError() {
-
}
/**
@@ -20,6 +18,4 @@
public AxisError(String message, Throwable cause) {
super(message, cause);
}
-
-
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEvent.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -21,28 +22,24 @@
public class AxisEvent {
/**
- * An Axis event is sent to registered listeners whenever anything significant
+ * An Axis event is sent to registered listeners whenever anything significant
* happens to <code>AxisConfiguration</code>.
*/
-
public static final int SERVICE_DEPLOY = 1;
public static final int SERVICE_REMOVE = 0;
-
- private AxisService service;
-
private int EVENT_TYPE;
+ private AxisService service;
public AxisEvent(AxisService service, int EVENT_TYPE) {
this.service = service;
this.EVENT_TYPE = EVENT_TYPE;
}
- public AxisService getService() {
- return service;
- }
-
public int getEventType() {
return EVENT_TYPE;
}
+ public AxisService getService() {
+ return service;
+ }
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisObserver.java Fri Dec 16 09:13:57 2005
@@ -1,28 +1,30 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
import org.apache.axis2.description.ParameterInclude;
public interface AxisObserver extends ParameterInclude {
- //The initilization code will go here
+
+ // The initilization code will go here
void init();
void update(AxisEvent event);
- //there can be parameters for the Observers
+ // there can be parameters for the Observers
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -29,8 +30,7 @@
public class DependencyManager {
private final static String MESSAGE_CONTEXT_INJECTION_METHOD = "init";
- public static void configureBusinessLogicProvider(Object obj,
- MessageContext requestMsgCtx,
+ public static void configureBusinessLogicProvider(Object obj, MessageContext requestMsgCtx,
MessageContext responseMsgCtx)
throws AxisFault {
try {
@@ -38,17 +38,14 @@
Method[] methods = classToLoad.getMethods();
for (int i = 0; i < methods.length; i++) {
- if (MESSAGE_CONTEXT_INJECTION_METHOD.equals(
- methods[i].getName()) &&
- methods[i].getParameterTypes().length == 1 &&
- methods[i].getParameterTypes()[0] ==
- MessageContext.class) {
+ if (MESSAGE_CONTEXT_INJECTION_METHOD.equals(methods[i].getName())
+ && (methods[i].getParameterTypes().length == 1)
+ && (methods[i].getParameterTypes()[0] == MessageContext.class)) {
methods[i].invoke(obj, new Object[]{requestMsgCtx});
- } else if (MESSAGE_CONTEXT_INJECTION_METHOD.equals(
- methods[i].getName()) &&
- methods[i].getParameterTypes().length == 2 &&
- methods[i].getParameterTypes()[0] == MessageContext.class &&
- methods[i].getParameterTypes()[1] == MessageContext.class) {
+ } else if (MESSAGE_CONTEXT_INJECTION_METHOD.equals(methods[i].getName())
+ && (methods[i].getParameterTypes().length == 2)
+ && (methods[i].getParameterTypes()[0] == MessageContext.class)
+ && (methods[i].getParameterTypes()[1] == MessageContext.class)) {
methods[i].invoke(obj, new Object[]{requestMsgCtx, responseMsgCtx});
}
}
@@ -62,5 +59,4 @@
throw new AxisFault(e);
}
}
-
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java Fri Dec 16 09:13:57 2005
@@ -6,6 +6,7 @@
import org.apache.axis2.i18n.Messages;
import java.util.ArrayList;
+
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -26,48 +27,45 @@
*/
public class DispatchPhase extends Phase {
+ public DispatchPhase() {
+ }
public DispatchPhase(String phaseName) {
super(phaseName);
}
- public DispatchPhase() {
-
- }
-
public void checkPostConditions(MessageContext msgContext) throws AxisFault {
-
EndpointReference toEPR = msgContext.getTo();
+
if (msgContext.getAxisService() == null) {
- throw new AxisFault(
- "Service Not found EPR is " +
- ((toEPR != null) ? toEPR.getAddress() : ""));
+ throw new AxisFault("Service Not found EPR is " + ((toEPR != null)
+ ? toEPR.getAddress()
+ : ""));
} else if (msgContext.getAxisOperation() == null) {
- throw new AxisFault(
- "Operation Not found EPR is " +
- ((toEPR != null) ? toEPR.getAddress() : "") +
- " and WSA Action = " +
- msgContext.getWSAAction());
+ throw new AxisFault("Operation Not found EPR is " + ((toEPR != null)
+ ? toEPR.getAddress()
+ : "") + " and WSA Action = " + msgContext.getWSAAction());
}
-
+
if (msgContext.getOperationContext() == null) {
- throw new AxisFault(
- Messages.getMessage("cannotBeNullOperationContext"));
+ throw new AxisFault(Messages.getMessage("cannotBeNullOperationContext"));
}
+
if (msgContext.getServiceContext() == null) {
- throw new AxisFault(
- Messages.getMessage("cannotBeNullServiceContext"));
+ throw new AxisFault(Messages.getMessage("cannotBeNullServiceContext"));
}
- if (msgContext.getAxisOperation() == null && msgContext.getOperationContext() != null) {
+
+ if ((msgContext.getAxisOperation() == null) && (msgContext.getOperationContext() != null)) {
msgContext.setAxisOperation(msgContext.getOperationContext().getAxisOperation());
}
- if (msgContext.getAxisService() == null && msgContext.getServiceContext() != null) {
+ if ((msgContext.getAxisService() == null) && (msgContext.getServiceContext() != null)) {
msgContext.setAxisService(msgContext.getServiceContext().getAxisService());
}
// TODO : do post-dispatch execution chain setup...
ArrayList operationChain = msgContext.getAxisOperation().getRemainingPhasesInFlow();
+
msgContext.setExecutionChain(operationChain);
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Handler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Handler.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Handler.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Handler.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -28,6 +29,14 @@
* Interface Handler
*/
public interface Handler extends Serializable {
+
+ /**
+ * Method cleanup.
+ *
+ * @throws AxisFault
+ */
+ public void cleanup() throws AxisFault;
+
/**
* Method init.
*
@@ -50,6 +59,12 @@
*/
public void invoke(MessageContext msgContext) throws AxisFault;
+ /**
+ * Gets the HandlerDescription of a handler. This is used as an input to get phaseRule of a handler.
+ *
+ * @return Returns HandlerDescription.
+ */
+ public HandlerDescription getHandlerDesc();
/**
* Method getName.
@@ -58,8 +73,6 @@
*/
public QName getName();
-
-
/**
* Method getParameter.
*
@@ -67,18 +80,4 @@
* @return Returns Parameter.
*/
public Parameter getParameter(String name);
-
- /**
- * Method cleanup.
- *
- * @throws AxisFault
- */
- public void cleanup() throws AxisFault;
-
- /**
- * Gets the HandlerDescription of a handler. This is used as an input to get phaseRule of a handler.
- *
- * @return Returns HandlerDescription.
- */
- public HandlerDescription getHandlerDesc();
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -32,7 +33,6 @@
*/
public class InstanceDispatcher extends AbstractHandler {
-
/**
* Post Condition : All the Contexts must be populated.
*
@@ -40,37 +40,47 @@
* @throws org.apache.axis2.AxisFault
*/
public void invoke(MessageContext msgContext) throws AxisFault {
+ if ((msgContext.getOperationContext() != null)
+ && (msgContext.getServiceContext() != null)) {
+ msgContext.setServiceGroupContextId(
+ ((ServiceGroupContext) msgContext.getServiceContext().getParent()).getId());
- if (msgContext.getOperationContext() != null && msgContext.getServiceContext() != null) {
- msgContext.setServiceGroupContextId(((ServiceGroupContext) msgContext.getServiceContext().getParent()).getId());
return;
}
AxisOperation axisOperation = msgContext.getAxisOperation();
- // 1. look up opCtxt using mc.addressingHeaders.relatesTo[0]
- if (axisOperation == null)
+ // 1. look up opCtxt using mc.addressingHeaders.relatesTo[0]
+ if (axisOperation == null) {
return;
- OperationContext operationContext = axisOperation.findForExistingOperationContext(msgContext);
+ }
+
+ OperationContext operationContext =
+ axisOperation.findForExistingOperationContext(msgContext);
if (operationContext != null) {
+
// register operation context and message context
axisOperation.registerOperationContext(msgContext, operationContext);
+
ServiceContext serviceContext = (ServiceContext) operationContext.getParent();
- ServiceGroupContext serviceGroupContext = (ServiceGroupContext) serviceContext.getParent();
+ ServiceGroupContext serviceGroupContext =
+ (ServiceGroupContext) serviceContext.getParent();
+
msgContext.setServiceContext(serviceContext);
msgContext.setServiceGroupContext(serviceGroupContext);
msgContext.setServiceGroupContextId(serviceGroupContext.getId());
- return;
- } else { // 2. if null, create new opCtxt
+ return;
+ } else { // 2. if null, create new opCtxt
operationContext = new OperationContext(axisOperation);
-// operationContext = OperationContextFactory.createOrFindOperationContext(axisOperation.getAxisSpecifMEPConstant(), axisOperation);
+
+// operationContext = OperationContextFactory.createOrFindOperationContext(axisOperation.getAxisSpecifMEPConstant(), axisOperation);
axisOperation.registerOperationContext(msgContext, operationContext);
- // fill the service group context and service context info
- msgContext.getConfigurationContext().
- fillServiceContextAndServiceGroupContext(msgContext);
+ // fill the service group context and service context info
+ msgContext.getConfigurationContext().fillServiceContextAndServiceGroupContext(
+ msgContext);
}
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/MessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/MessageReceiver.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/MessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/MessageReceiver.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -21,7 +22,7 @@
/**
* An instance of MessageReceiver can be setup to receive messages. The application logic has no impact
- * on the Axis Engine iself. It is upto the application logic to do whatever it needs. For e.g.
+ * on the Axis Engine iself. It is upto the application logic to do whatever it needs. For e.g.
* the MessageReceiver can handle a message, send a response back and/or send other messages.
*/
public interface MessageReceiver {