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 de...@apache.org on 2005/12/11 06:18:13 UTC
svn commit: r355917 [1/3] - in /webservices/axis2/trunk/java/modules:
addressing/test-resources/ codegen/test-resources/xmls/
core/src/org/apache/axis2/context/ core/src/org/apache/axis2/deployment/
core/src/org/apache/axis2/description/ core/src/org/a...
Author: deepal
Date: Sat Dec 10 21:17:41 2005
New Revision: 355917
URL: http://svn.apache.org/viewcvs?rev=355917&view=rev
Log:
WARNING, DANGER WILL ROBINSON!! THIS BREAKS THE BUILD! (whoop, whoop, sirens, etc...)
OK, with that out of the way...
This is a work in progress - Deepal and Glen have been working on cleaning up a couple of
areas, in particular the Handler/Phase/deployment code, and the AxisConfiguration
code. This is the first part.
* Refactor Phase so it implements Handler. This allows deploying Handlers
in parallel with Phases, in addition to inside them.
* The "execution chain" now lives in the MessageContext and is run by calling
MessageContext.invoke(). This keeps track of the current (integer) indexes
into the top-level execution chain (a list of Handlers/Phases), and the
current Phase, if any. Adjust pause/resume logic appropriately.
* Phases have preConditions and postConditions, which are checked by Phase.
invoke().
* Phases now may optionally have sub-classes specified in the axis2.xml, the
only one we currently use is DispatchPhase, which implements post-conditions
which check the contexts and service/operations in the MessageContext for
validity. Other types of Phases may be built with custom checks.
* Move InstanceDispatcher into the Dispatch phase, and get rid of Post-Dispatch
Phase.
* Fix phase rule tests to more accurately test the real constraints specified in
the rules.
* Various changes necessary to accommodate the above.
Added:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java
Removed:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchingChecker.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPProcessingModelChecker.java
Modified:
webservices/axis2/trunk/java/modules/addressing/test-resources/axis2.xml
webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Handler.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractRobustInMessageReceiver.java
webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/ParaLockedRepo/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/ServiceGroup/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/hostConfigrepo/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/moduleConfig/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/server-transport.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/server1.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/serviceGroupRepo/axis2.xml
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/BeforeAfterTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/BeforeTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/BeforeWithNoFirstHandlerTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseFirstTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseLastTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleHandlers.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java
webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s1.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s1.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s2.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s2.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s2a.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s2a.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s3.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s3.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s4.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s4.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s5.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s5.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s6.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s6.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s7.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/s7.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/sST1.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/sST1.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.client.axis2.xml
webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.service.axis2.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/chuncking-enabled-axis2.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/commons-http-enabled-axis2.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/mail-enabled-axis2.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/mail-enabled-client-axis2.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/mail-enabled-server-axis2.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-enabled-axis2.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-fileCache-enabled-axis2.xml
webservices/axis2/trunk/java/modules/samples/resources/security/client.axis2.xml
webservices/axis2/trunk/java/modules/samples/resources/security/service.axis2.xml
webservices/axis2/trunk/java/modules/security/test-resources/axis2.xml
Modified: webservices/axis2/trunk/java/modules/addressing/test-resources/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/test-resources/axis2.xml?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test-resources/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/addressing/test-resources/axis2.xml Sat Dec 10 21:17:41 2005
@@ -11,33 +11,31 @@
</transportSender>
<module ref="addressing"/>
+
<phaseOrder type="inflow">
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="RequestURIBasedDispatcher"
+
+ <handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPActionBasedDispatcher"
+
+ <handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="org.apache.axis2.engine.DispatchingChecker">
- <order phase="PostDispatch"/>
- </handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
<order phase="PostDispatch"/>
@@ -51,6 +49,7 @@
<!-- user can add his own phases to this area -->
<phase name="userphase1"/>
<!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
@@ -64,6 +63,5 @@
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
-
</axisconfig>
Modified: webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml Sat Dec 10 21:17:41 2005
@@ -30,29 +30,26 @@
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="RequestURIBasedDispatcher"
+
+ <handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPActionBasedDispatcher"
+
+ <handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="org.apache.axis2.engine.DispatchingChecker">
- <order phase="PostDispatch"/>
- </handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
<order phase="PostDispatch"/>
@@ -66,6 +63,7 @@
<!-- user can add his own phases to this area -->
<phase name="userphase1"/>
<!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java Sat Dec 10 21:17:41 2005
@@ -22,11 +22,13 @@
import org.apache.axis2.addressing.RelatesTo;
import org.apache.axis2.description.*;
import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.Handler;
import org.apache.axis2.soap.SOAP11Constants;
import org.apache.axis2.soap.SOAP12Constants;
import org.apache.axis2.soap.SOAPEnvelope;
import javax.xml.namespace.QName;
+import java.util.ArrayList;
/**
* MessageContext holds service specific state information.
@@ -144,9 +146,20 @@
private String serviceContextID;
- private String pausedPhaseName;
+ /**
+ * The chain of Handlers/Phases for processing this message
+ */
+ private ArrayList executionChain = new ArrayList();
- private QName pausedHandlerName;
+ /**
+ * Index into the execution chain of the currently executing handler
+ */
+ private int currentHandlerIndex;
+
+ /**
+ * Index into the current Phase of the currently executing handler (if any)
+ */
+ private int currentPhaseIndex;
private String soapAction;
@@ -245,6 +258,35 @@
this.transportOutname = transportOut.getName();
}
+ public void invoke() throws AxisFault {
+ if (currentHandlerIndex == -1) currentHandlerIndex = 0;
+ while (currentHandlerIndex < executionChain.size()) {
+ Handler currentHandler = (Handler) executionChain.get(currentHandlerIndex);
+ currentHandler.invoke(this);
+ if (paused) {
+ break;
+ }
+ currentHandlerIndex++;
+ }
+ }
+
+ public ArrayList getExecutionChain() {
+ return executionChain;
+ }
+
+ /**
+ * Set the execution chain of Handler in this MessageContext. Doing this causes
+ * the current handler/phase indexes to reset to 0, since we have new Handlers to
+ * execute (this usually only happens at initialization and when a fault occurs).
+ *
+ * @param executionChain
+ */
+ public void setExecutionChain(ArrayList executionChain) {
+ this.executionChain = executionChain;
+ currentHandlerIndex = -1;
+ currentPhaseIndex = 0;
+ }
+
/**
* @return Returns EndpointReference.
*/
@@ -465,14 +507,15 @@
}
/**
+ * Pause the execution of the current handler chain
*/
- public void setPausedTrue(QName handlerName) {
+ public void pause() {
paused = true;
- this.pausedHandlerName = handlerName;
}
- public void setPausedFalse() {
+ public void resume() throws AxisFault {
paused = false;
+ invoke();
}
/**
@@ -766,25 +809,20 @@
return obj;
}
- /**
- * @return Returns QName.
- */
- public QName getPausedHandlerName() {
- return pausedHandlerName;
+ public int getCurrentHandlerIndex() {
+ return currentHandlerIndex;
}
- /**
- * @return Returns paused phase name.
- */
- public String getPausedPhaseName() {
- return pausedPhaseName;
+ public void setCurrentHandlerIndex(int currentHandlerIndex) {
+ this.currentHandlerIndex = currentHandlerIndex;
}
- /**
- * @param name
- */
- public void setPausedPhaseName(String name) {
- pausedPhaseName = name;
+ public int getCurrentPhaseIndex() {
+ return currentPhaseIndex;
+ }
+
+ public void setCurrentPhaseIndex(int currentPhaseIndex) {
+ this.currentPhaseIndex = currentPhaseIndex;
}
/**
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java Sat Dec 10 21:17:41 2005
@@ -129,24 +129,21 @@
}
}
-
- private ArrayList getPhaseList(OMElement phaseOrders) {
- ArrayList phaselist = new ArrayList();
- Iterator phases = phaseOrders.getChildrenWithName(new QName(PHASE));
- while (phases.hasNext()) {
- OMElement phase = (OMElement) phases.next();
- phaselist.add(phase.getAttribute(new QName(ATTNAME)).getAttributeValue());
- }
- return phaselist;
- }
-
private ArrayList processPhaseList(OMElement phaseOrders) throws DeploymentException {
ArrayList phaselist = new ArrayList();
Iterator phases = phaseOrders.getChildrenWithName(new QName(PHASE));
while (phases.hasNext()) {
OMElement phaseelement = (OMElement) phases.next();
String phaseName = phaseelement.getAttribute(new QName(ATTNAME)).getAttributeValue();
- Phase phase = new Phase(phaseName);
+ String phaseClass = phaseelement.getAttributeValue(new QName(CLASSNAME));
+ Phase phase;
+ try {
+ phase = getPhase(phaseClass);
+ } catch (Exception e) {
+ throw new DeploymentException("Couldn't find phase class : " + phaseClass, e);
+ }
+ phase.setName(phaseName);
+
Iterator handlers = phaseelement.getChildrenWithName(new QName(HANDERST));
while (handlers.hasNext()) {
OMElement omElement = (OMElement) handlers.next();
@@ -164,6 +161,15 @@
return phaselist;
}
+ private Phase getPhase(String className)
+ throws ClassNotFoundException, IllegalAccessException, InstantiationException {
+ if (className == null) {
+ return new Phase();
+ }
+// Class phaseClass = Class.forName(className);
+ Class phaseClass = axisConfiguration.getSystemClassLoader().loadClass(className);
+ return (Phase) phaseClass.newInstance();
+ }
private void processTransportSenders(Iterator trs_senders) throws DeploymentException {
while (trs_senders.hasNext()) {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java Sat Dec 10 21:17:41 2005
@@ -27,12 +27,7 @@
import org.apache.axis2.deployment.scheduler.SchedulerTask;
import org.apache.axis2.deployment.util.PhasesInfo;
import org.apache.axis2.deployment.util.Utils;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.Flow;
-import org.apache.axis2.description.ModuleDescription;
-import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.*;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.Phase;
import org.apache.axis2.i18n.Messages;
@@ -42,19 +37,8 @@
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
+import java.io.*;
+import java.util.*;
public class DeploymentEngine implements DeploymentConstants {
@@ -358,17 +342,15 @@
String phase1 = ((Phase) inPhases.get(0)).getPhaseName();
String phases = ((Phase) inPhases.get(1)).getPhaseName();
String phase3 = ((Phase) inPhases.get(2)).getPhaseName();
- String phase4 = ((Phase) inPhases.get(3)).getPhaseName();
if (!(phase1.equals(PhaseMetadata.PHASE_TRANSPORTIN) &&
phases.equals(PhaseMetadata.PHASE_PRE_DISPATCH) &&
- phase3.equals(PhaseMetadata.PHASE_DISPATCH) &&
- phase4.equals(PhaseMetadata.PHASE_POST_DISPATCH))) {
+ phase3.equals(PhaseMetadata.PHASE_DISPATCH))) {
throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_PHASE));
}
} catch (Exception e) {
throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_PHASE));
}
- axisConfig.setInPhasesUptoAndIncludingPostDispatch(
+ axisConfig.setInPhasesUptoAndIncludingPostDispatch(
phasesinfo.getGlobalInflow());
axisConfig.setInFaultPhases(phasesinfo.getIN_FaultPhases());
axisConfig.setGlobalOutPhase(phasesinfo.getGlobalOutPhaseList());
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml Sat Dec 10 21:17:41 2005
@@ -58,7 +58,8 @@
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.SimpleJMSListener">
<parameter name="transport.jms.Destination" locked="false">dynamicQueues/FOO</parameter>
- <parameter name="java.naming.factory.initial" locked="false">org.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.factory.initial" locked="false">
+ org.activemq.jndi.ActiveMQInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
</transportReceiver>
@@ -105,38 +106,28 @@
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
-
- <handler name="RequestURIBasedDispatcher"
+
+ <handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
-
+
<handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
-
- <handler name="SOAPMessageBodyBasedDispatcher"
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="org.apache.axis2.engine.DispatchingChecker">
- <order phase="PostDispatch"/>
- </handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
- <order phase="PostDispatch"/>
- </handler>
- <handler name="SOAPProcessingModelChecker"
- class="org.apache.axis2.engine.SOAPProcessingModelChecker">
<order phase="PostDispatch"/>
</handler>
</phase>
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java Sat Dec 10 21:17:41 2005
@@ -31,12 +31,12 @@
public class AxisMessage implements ParameterInclude {
private ParameterInclude parameterinclude;
- private ArrayList operationFlow;
+ private ArrayList handlerChain;
private AxisOperation parent;
public AxisMessage() {
parameterinclude = new ParameterIncludeImpl();
- operationFlow = new ArrayList();
+ handlerChain = new ArrayList();
}
public void addParameter(Parameter param) throws AxisFault {
@@ -77,11 +77,11 @@
}
public ArrayList getMessageFlow() {
- return operationFlow;
+ return handlerChain;
}
public void setMessageFlow(ArrayList operationFlow) {
- this.operationFlow = operationFlow;
+ this.handlerChain = operationFlow;
}
public AxisOperation getParent() {
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=355917&r1=355916&r2=355917&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 Sat Dec 10 21:17:41 2005
@@ -22,24 +22,18 @@
import org.apache.axis2.deployment.util.PhasesInfo;
import org.apache.axis2.description.*;
import org.apache.axis2.om.OMElement;
-import org.apache.axis2.phaseresolver.PhaseMetadata;
import org.apache.axis2.util.HostConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.xml.namespace.QName;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
/**
* Class AxisConfigurationImpl
*/
-public class AxisConfiguration implements ParameterInclude{
+public class AxisConfiguration implements ParameterInclude {
/**
* To store faulty services
*/
@@ -120,61 +114,49 @@
observersList = new ArrayList();
inPhasesUptoAndIncludingPostDispatch = new ArrayList();
- inPhasesUptoAndIncludingPostDispatch.add(
- new Phase(PhaseMetadata.PHASE_TRANSPORTIN));
- inPhasesUptoAndIncludingPostDispatch.add(
- new Phase(PhaseMetadata.PHASE_PRE_DISPATCH));
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.
- setDefaultGlobalFlow();
- }
-
+ //todo we need to fix this , we know that we are doing wrong thing here
+ createDefaultChain();
- /**
- * to set the default global flow if some one create a AxisConfiguration by hand.
- */
- private void setDefaultGlobalFlow() {
- Phase dispatch = new Phase(PhaseMetadata.PHASE_DISPATCH);
- AddressingBasedDispatcher add_dispatch = new AddressingBasedDispatcher();
- add_dispatch.initDispatcher();
- add_dispatch.getHandlerDesc().setParent(this);
- dispatch.addHandler(add_dispatch, 0);
-
- RequestURIBasedDispatcher uri_diaptch = new RequestURIBasedDispatcher();
- uri_diaptch.getHandlerDesc().setParent(this);
- uri_diaptch.initDispatcher();
- dispatch.addHandler(uri_diaptch, 1);
+ }
- SOAPActionBasedDispatcher soapActionBased_dispatch = new SOAPActionBasedDispatcher();
- soapActionBased_dispatch.getHandlerDesc().setParent(this);
- soapActionBased_dispatch.initDispatcher();
- dispatch.addHandler(soapActionBased_dispatch, 2);
+ 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();
- SOAPMessageBodyBasedDispatcher soapMessageBodybased_dispatch =
- new SOAPMessageBodyBasedDispatcher();
- soapMessageBodybased_dispatch.getHandlerDesc().setParent(this);
- soapMessageBodybased_dispatch.initDispatcher();
- dispatch.addHandler(soapMessageBodybased_dispatch, 3);
+ RequestURIBasedDispatcher rud = new RequestURIBasedDispatcher();
+ rud.initDispatcher();
- inPhasesUptoAndIncludingPostDispatch.add(dispatch);
+ SOAPActionBasedDispatcher sabd = new SOAPActionBasedDispatcher();
+ sabd.initDispatcher();
- Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
+ SOAPMessageBodyBasedDispatcher smbd = new SOAPMessageBodyBasedDispatcher();
+ smbd.initDispatcher();
- DispatchingChecker dispatchingChecker = new DispatchingChecker();
- dispatchingChecker.getHandlerDesc().setParent(this);
+ InstanceDispatcher id = new InstanceDispatcher();
+ id.init(new HandlerDescription(new QName("InstanceDispatcher")));
- InstanceDispatcher instanceDispatcher = new org.apache.axis2.engine.InstanceDispatcher();
- instanceDispatcher.getHandlerDesc().setParent(this);
- postDispatch.addHandler(dispatchingChecker, 0);
- postDispatch.addHandler(instanceDispatcher, 1);
- inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
+ 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;
}
@@ -341,7 +323,7 @@
//to get the out flow correpodning to the global out flow;
public ArrayList getGlobalOutPhases() {
- return this.outPhases;
+ return this.outPhases;
}
public void setGlobalOutPhase(ArrayList outPhases) {
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=355917&r1=355916&r2=355917&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 Sat Dec 10 21:17:41 2005
@@ -31,6 +31,7 @@
import org.apache.commons.logging.LogFactory;
import java.util.ArrayList;
+import java.util.Iterator;
/**
* There is one engine for the Server and the Client. the send() and receive()
@@ -63,28 +64,14 @@
* @see Handler
*/
public void send(MessageContext msgContext) throws AxisFault {
- verifyContextBuilt(msgContext);
-
//find and invoke the Phases
OperationContext operationContext = msgContext.getOperationContext();
- ArrayList phases =
- operationContext.getAxisOperation().getPhasesOutFlow();
- if (msgContext.isPaused()) {
- // the message has paused, so rerun them from the position they stoped. The Handler
- //who paused the Message will be the first one to run
- //resume fixed, global precalulated phases
- resumeInvocationPhases(phases, msgContext);
- ArrayList globaleOutphase = msgContext.getConfigurationContext().
- getAxisConfiguration().getGlobalOutPhases();
- //invoking global phase.
- invokePhases(globaleOutphase, msgContext);
- } else {
- invokePhases(phases, msgContext);
- ArrayList globaleOutphase = msgContext.getConfigurationContext().
- getAxisConfiguration().getGlobalOutPhases();
- //invoking global phase.
- invokePhases(globaleOutphase, msgContext);
- }
+ 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
@@ -106,59 +93,68 @@
*/
public void receive(MessageContext msgContext) throws AxisFault {
- ConfigurationContext sysCtx = msgContext.getConfigurationContext();
- AxisOperation axisOperation;
- ArrayList preCalculatedPhases =
- sysCtx
- .getAxisConfiguration()
- .getInPhasesUptoAndIncludingPostDispatch();
- ArrayList operationSpecificPhases;
-
- if (msgContext.isPaused()) {
- // the message has paused, so rerun them from the position they stoped. The Handler
- //who paused the Message will be the first one to run
- //resume fixed, global precalulated phases
- resumeInvocationPhases(preCalculatedPhases, msgContext);
- if (msgContext.isPaused()) {
- return;
- }
- verifyContextBuilt(msgContext);
- //resume operation specific phases
- OperationContext operationContext =
- msgContext.getOperationContext();
- axisOperation = operationContext.getAxisOperation();
- operationSpecificPhases =
- axisOperation.getRemainingPhasesInFlow();
- resumeInvocationPhases(operationSpecificPhases, msgContext);
- if (msgContext.isPaused()) {
- return;
- }
- } else {
- invokePhases(preCalculatedPhases, msgContext);
- if (msgContext.isPaused()) {
- return;
- }
-
- verifyContextBuilt(msgContext); // TODO : Chinthaka remove me. I'm redundant
- OperationContext operationContext =
- msgContext.getOperationContext();
- axisOperation = operationContext.getAxisOperation();
- operationSpecificPhases =
- axisOperation.getRemainingPhasesInFlow();
- invokePhases(operationSpecificPhases, msgContext);
- if (msgContext.isPaused()) {
- return;
- }
- }
+ 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
- MessageReceiver receiver =
- axisOperation.getMessageReceiver();
+ 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
+ SOAPEnvelope se = msgContext.getEnvelope();
+ if (se.getHeader() == null) {
+ return;
+ }
+ Iterator hbs = se.getHeader().examineAllHeaderBlocks();
+ while (hbs.hasNext()) {
+ SOAPHeaderBlock hb = (SOAPHeaderBlock) hbs.next();
+
+ // if this header block has been processed or mustUnderstand isn't
+ // turned on then its cool
+ 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
+ // 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);
+ }
+
+ //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
+ // 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);
+ }
+ }
+
+ }
+ }
+
/**
* Sends the SOAP Fault to another SOAP node.
*
@@ -170,16 +166,12 @@
//find and execute the Fault Out Flow Handlers
if (opContext != null) {
AxisOperation axisOperation = opContext.getAxisOperation();
- ArrayList phases = axisOperation.getPhasesOutFaultFlow();
- if (msgContext.isPaused()) {
- resumeInvocationPhases(phases, msgContext);
- } else {
- invokePhases(phases, msgContext);
- }
+ ArrayList faultExecutionChain = axisOperation.getPhasesOutFaultFlow();
+ msgContext.setExecutionChain((ArrayList) faultExecutionChain.clone());
+ msgContext.invoke();
}
- //it is possible that Operation Context is Null as the error occered before the
- //Dispatcher. We do not run Handlers in that case
+ // 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();
@@ -195,35 +187,7 @@
* @throws AxisFault
*/
public void receiveFault(MessageContext msgContext) throws AxisFault {
-
- OperationContext opContext = msgContext.getOperationContext();
- if (opContext == null) {
- //If we do not have a OperationContext that means this may be a incoming
- //Dual Channel response. So try to dispatch the Service
- ConfigurationContext sysCtx = msgContext.getConfigurationContext();
- ArrayList phases =
- sysCtx
- .getAxisConfiguration()
- .getInPhasesUptoAndIncludingPostDispatch();
-
- if (msgContext.isPaused()) {
- resumeInvocationPhases(phases, msgContext);
- } else {
- invokePhases(phases, msgContext);
- }
- verifyContextBuilt(msgContext);
- }
- opContext = msgContext.getOperationContext();
- //find and execute the Fault In Flow Handlers
- if (opContext != null) {
- AxisOperation axisOperation = opContext.getAxisOperation();
- ArrayList phases = axisOperation.getPhasesInFaultFlow();
- if (msgContext.isPaused()) {
- resumeInvocationPhases(phases, msgContext);
- } else {
- invokePhases(phases, msgContext);
- }
- }
+ // TODO : rationalize fault handling!
}
/**
@@ -379,7 +343,7 @@
} else if (soapException != null) {
message = soapException.getMessage();
} else if (e instanceof AxisFault) {
- message = ((AxisFault) e).getMessage();
+ message = e.getMessage();
}
// defaulting to reason, unknown, if no reason is available
@@ -420,50 +384,10 @@
}
}
- private void verifyContextBuilt(MessageContext msgctx) throws AxisFault {
- if (msgctx.getConfigurationContext() == null) {
- throw new AxisFault(
- Messages.getMessage("cannotBeNullConfigurationContext"));
- }
- if (msgctx.getOperationContext() == null) {
- throw new AxisFault(
- Messages.getMessage("cannotBeNullOperationContext"));
- }
- if (msgctx.getServiceContext() == null) {
- throw new AxisFault(
- Messages.getMessage("cannotBeNullServiceContext"));
- }
- }
-
- private void invokePhases(ArrayList phases, MessageContext msgctx)
- throws AxisFault {
- int count = phases.size();
- for (int i = 0; (i < count && !msgctx.isPaused()); i++) {
- Phase phase = (Phase) phases.get(i);
- phase.invoke(msgctx);
- }
- }
- public void resumeInvocationPhases(ArrayList phases, MessageContext msgctx)
+ public void resume(MessageContext msgctx)
throws AxisFault {
- msgctx.setPausedFalse();
- int count = phases.size();
- boolean foundMatch = false;
-
- for (int i = 0; i < count && !msgctx.isPaused(); i++) {
- Phase phase = (Phase) phases.get(i);
- if (phase.getPhaseName().equals(msgctx.getPausedPhaseName())) {
- foundMatch = true;
- phase.invokeStartFromHandler(
- msgctx.getPausedHandlerName(),
- msgctx);
- } else {
- if (foundMatch) {
- phase.invoke(msgctx);
- }
-
- }
- }
+ msgctx.resume();
}
private String getSenderFaultCode(String soapNamespace) {
Added: 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=355917&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java (added)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java Sat Dec 10 21:17:41 2005
@@ -0,0 +1,73 @@
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.i18n.Messages;
+
+import java.util.ArrayList;
+/*
+* 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, softwar
+* 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.
+*
+* @author : Deepal Jayasinghe (deepal@apache.org)
+*
+*/
+
+public class DispatchPhase extends Phase {
+
+ 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() : ""));
+ } else if (msgContext.getAxisOperation() == null) {
+ 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"));
+ }
+ if (msgContext.getServiceContext() == null) {
+ throw new AxisFault(
+ Messages.getMessage("cannotBeNullServiceContext"));
+ }
+ if (msgContext.getAxisOperation() == null && msgContext.getOperationContext() != null) {
+ msgContext.setAxisOperation(msgContext.getOperationContext().getAxisOperation());
+ }
+
+ 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=355917&r1=355916&r2=355917&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 Sat Dec 10 21:17:41 2005
@@ -58,6 +58,8 @@
*/
public QName getName();
+
+
/**
* Method getParameter.
*
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=355917&r1=355916&r2=355917&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 Sat Dec 10 21:17:41 2005
@@ -31,7 +31,6 @@
* This will then try to find the Contexts of ServiceGroup, Service and the Operation.
*/
public class InstanceDispatcher extends AbstractHandler {
-
/**
@@ -42,7 +41,7 @@
*/
public void invoke(MessageContext msgContext) throws AxisFault {
- if(msgContext.getOperationContext() != null && msgContext.getServiceContext() != null){
+ if (msgContext.getOperationContext() != null && msgContext.getServiceContext() != null) {
msgContext.setServiceGroupContextId(((ServiceGroupContext) msgContext.getServiceContext().getParent()).getId());
return;
}
@@ -50,6 +49,8 @@
AxisOperation axisOperation = msgContext.getAxisOperation();
// 1. look up opCtxt using mc.addressingHeaders.relatesTo[0]
+ if (axisOperation == null)
+ return;
OperationContext operationContext = axisOperation.findForExistingOperationContext(msgContext);
if (operationContext != null) {
@@ -63,7 +64,7 @@
return;
} else { // 2. if null, create new opCtxt
- operationContext =new OperationContext(axisOperation);
+ operationContext = new OperationContext(axisOperation);
// operationContext = OperationContextFactory.createOrFindOperationContext(axisOperation.getAxisSpecifMEPConstant(), axisOperation);
axisOperation.registerOperationContext(msgContext, operationContext);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java Sat Dec 10 21:17:41 2005
@@ -19,6 +19,7 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.Parameter;
import org.apache.axis2.phaseresolver.PhaseException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -30,7 +31,7 @@
/**
* A Phase is an ordered collection of Handlers.
*/
-public class Phase {
+public class Phase implements Handler {
/**
* Field phaseName
*/
@@ -47,21 +48,11 @@
private Log log = LogFactory.getLog(getClass());
/**
- * to keet info about phase first handler
- */
- private Handler phaseFirst = null;
-
- /**
* Field phasefirstset
*/
private boolean phasefirstset;
/**
- * to keet info about phase last handler
- */
- private Handler phaseLast = null;
-
- /**
* Field phaselastset
*/
private boolean phaselastset;
@@ -102,6 +93,18 @@
this.phaseName = phaseName;
}
+ public Phase() {
+ this(null);
+ }
+
+ public void checkPreconditions(MessageContext msgContext) throws AxisFault {
+ // Default version does nothing
+ }
+
+ public void checkPostConditions(MessageContext msgContext) throws AxisFault {
+ // Default version does nothing
+ }
+
/**
* Method addHandler.
*
@@ -110,7 +113,7 @@
*/
public void addHandler(Handler handler, int index) {
log.debug(
- "Handler " + handler.getName() + "Added to place " + 1 +
+ "Handler " + handler.getName() + "Added to place " + index +
" At the Phase " +
phaseName);
handlers.add(index, handler);
@@ -122,10 +125,12 @@
* @param handler
*/
public void addHandler(Handler handler) {
- log.debug(
- "Handler " + handler.getName() + " Added to the Phase " +
- phaseName);
- handlers.add(handler);
+ log.debug("Handler " + handler.getName() + " added to Phase " + phaseName);
+ if (phaselastset) {
+ handlers.add(handlers.size() - 2, handler); // add before phaseLast
+ } else {
+ handlers.add(handler);
+ }
}
/**
@@ -134,53 +139,38 @@
* @param msgctx
* @throws org.apache.axis2.AxisFault
*/
- public void invoke(MessageContext msgctx) throws AxisFault {
+ public final void invoke(MessageContext msgctx) throws AxisFault {
+ if (log.isDebugEnabled()) {
+ log.debug("Checking pre-condition for Phase \"" + phaseName + "\"");
+ }
+ int currentIndex = msgctx.getCurrentPhaseIndex();
+ if (currentIndex == 0)
+ checkPreconditions(msgctx);
+
if (log.isDebugEnabled()) {
log.debug("Invoking phase \"" + phaseName + "\"");
}
- msgctx.setPausedPhaseName(this.getPhaseName());
- //If phase first Handler is there then it should run first
- if (phaseFirst != null) {
- if (msgctx.isPaused()) {
+
+ while (currentIndex < handlers.size()) {
+ Handler handler = (Handler) handlers.get(currentIndex);
+ log.info("Invoking Handler '"
+ + handler.getName()
+ + "' in Phase '"
+ + phaseName + "'");
+ handler.invoke(msgctx);
+
+ if (msgctx.isPaused())
return;
- } else {
- log.info("Invoke PhaseFirst handler '"
- + phaseFirst.getName()
- + "' in Phase '"
- + phaseName + "'");
- phaseFirst.invoke(msgctx);
- }
- }
- //Invoking the rest of handler except phaseFirst and phaseLast
- int indexOfHandlerToExecute = 0;
- while (indexOfHandlerToExecute < handlers.size()) {
- if (msgctx.isPaused()) {
- break;
- } else {
- Handler handler = (Handler) handlers.get(
- indexOfHandlerToExecute);
- if (handler != null) {
- log.info("Invoking Handler '"
- + handler.getName()
- + "' in Phase '"
- + phaseName + "'");
- handler.invoke(msgctx);
- //This line should be after the invoke as if the invocation failed this handlers is takn care of and
- //no need to revoke agien
- indexOfHandlerToExecute++;
- }
- }
+
+ currentIndex++;
+ msgctx.setCurrentPhaseIndex(currentIndex);
}
- //If phase last handler is there will invoke that here
- if (phaseLast != null) {
- if (!msgctx.isPaused()) {
- log.info("Invoke PhaseLast handler '"
- + phaseLast.getName()
- + "' in Phase '"
- + phaseName + "'");
- phaseLast.invoke(msgctx);
- }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Checking post-conditions for phase \"" + phaseName + "\"");
}
+ msgctx.setCurrentPhaseIndex(0);
+ checkPostConditions(msgctx);
}
/**
@@ -238,14 +228,15 @@
" phaseFirst Handler for same phase "
+ this.getPhaseName());
} else {
+ handlers.add(0, phaseFirst);
+ phasefirstset = true;
+
+ // TODO: move this error check to where we read the rules
if (getBeforeAfter(phaseFirst) != ANYWHERE) {
throw new PhaseException("Handler with PhaseFirst can not have " +
"any before or after proprty error in "
+ phaseFirst.getName());
- } else {
- this.phaseFirst = phaseFirst;
}
- phasefirstset = true;
}
}
@@ -260,15 +251,19 @@
throw new PhaseException("PhaseLast already has been set," +
" cannot have two PhaseLast Handler for same phase "
+ this.getPhaseName());
+ }
+ if (handlers.size() == 0) {
+ handlers.add(phaseLast);
} else {
- if (getBeforeAfter(phaseLast) != ANYWHERE) {
- throw new PhaseException("Handler with PhaseLast property " +
- "can not have any before or after property error in "
- + phaseLast.getName());
- } else {
- this.phaseLast = phaseLast;
- }
- phaselastset = true;
+ handlers.add(handlers.size() - 1, phaseLast);
+ }
+ phaselastset = true;
+
+ // TODO: Move this check to where we read the rules
+ if (getBeforeAfter(phaseLast) != ANYWHERE) {
+ throw new PhaseException("Handler with PhaseLast property " +
+ "can not have any before or after property error in "
+ + phaseLast.getName());
}
}
@@ -283,7 +278,7 @@
while (handlers_itr.hasNext()) {
Handler hand = (Handler) handlers_itr.next();
HandlerDescription handlerDesc = hand.getHandlerDesc();
- if( handler.getName().getLocalPart().equals(handlerDesc.getName().getLocalPart())){
+ if (handler.getName().getLocalPart().equals(handlerDesc.getName().getLocalPart())) {
// if (handler.equals(handlerDesc)) {
//tryting to add the same handler twice to the phase
// this is can happen due to we are allowing service specifc module
@@ -292,67 +287,31 @@
}
}
if (isOneHanlder) {
+ // TODO : should we allow both phaseFirst and phaseLast to be true for one Handler??
throw new PhaseException(
this.getPhaseName()
+ "can only have one handler, since there is a "
+ "handler with both phaseFirst and PhaseLast true ");
- } else {
- if (handler.getRules().isPhaseFirst() &&
- handler.getRules().isPhaseLast()) {
- if (handlers.size() > 0) {
- throw new PhaseException(
- this.getPhaseName()
- + " can not have more than one handler "
- + handler.getName()
- + " is invalid or incorrect phase rules");
- } else {
- handlers.add(handler.getHandler());
- isOneHanlder = true;
- }
- } else if (handler.getRules().isPhaseFirst()) {
- setPhaseFirst(handler.getHandler());
- } else if (handler.getRules().isPhaseLast()) {
- setPhaseLast(handler.getHandler());
- } else {
- insertHandler(handler);
- }
}
- }
- /**
- * If the user tries to add a handler before the phase first handler, then throw an exception.
- *
- * @throws PhaseException
- */
- private void validatebefore(Handler handler) throws PhaseException {
- if (phaseFirst != null) {
- String phasFirstname = phaseFirst.getHandlerDesc().getName()
- .getLocalPart();
- if (handler.getHandlerDesc().getRules().getBefore().equals(
- phasFirstname)) {
- throw new PhaseException("Trying to insert a Handler "
- + handler.getName()
- + " before phaseFirst "
- + phasFirstname);
- }
- }
- }
-
- /**
- * If the user tries to add a handler after the phase last handler, then throw an exception.
- *
- * @throws PhaseException
- */
- private void validateafter(Handler handler) throws PhaseException {
- if (phaseLast != null) {
- String phaseLastName = phaseLast.getHandlerDesc().getName()
- .getLocalPart();
- if (handler.getName().equals(phaseLastName)) {
- throw new PhaseException("Try to insert a Handler "
- + handler.getName()
- + " after phaseLast "
- + phaseLastName);
+ if (handler.getRules().isPhaseFirst() &&
+ handler.getRules().isPhaseLast()) {
+ if (handlers.size() > 0) {
+ throw new PhaseException(
+ this.getPhaseName()
+ + " can not have more than one handler "
+ + handler.getName()
+ + " is invalid or incorrect phase rules");
+ } else {
+ handlers.add(handler.getHandler());
+ isOneHanlder = true;
}
+ } else if (handler.getRules().isPhaseFirst()) {
+ setPhaseFirst(handler.getHandler());
+ } else if (handler.getRules().isPhaseLast()) {
+ setPhaseLast(handler.getHandler());
+ } else {
+ insertHandler(handler);
}
}
@@ -361,30 +320,26 @@
*
* @param handler
*/
- private void insertBefore(Handler handler) {
+ private void insertBefore(Handler handler) throws PhaseException {
String beforename = handler.getHandlerDesc().getRules().getBefore();
- if (phaseLast != null) {
- if (phaseLast.getHandlerDesc().getName().getLocalPart().equals(
- beforename)) {
- handlers.add(handler);
- return;
- }
- }
+
for (int i = 0; i < handlers.size(); i++) {
Handler temphandler = (Handler) handlers.get(i);
- if (temphandler.getHandlerDesc().getName().getLocalPart().equals(
- beforename)) {
+ if (temphandler.getName().getLocalPart().equals(beforename)) {
if (i == 0) {
+ if (phasefirstset) {
+ throw new PhaseException("Can't insert handler before handler '" +
+ temphandler.getName() + "', which is marked phaseFirst");
+ }
handlers.add(0, handler);
return;
- } else {
- handlers.add(i - 1, handler);
- return;
}
+ handlers.add(i - 1, handler);
}
}
+
//added as last handler
- handlers.add(handler);
+ addHandler(handler);
}
/**
@@ -392,27 +347,18 @@
*
* @param handler
*/
- private void insertAfter(Handler handler) {
+ private void insertAfter(Handler handler) throws PhaseException {
String afterName = handler.getHandlerDesc().getRules().getAfter();
- if (phaseFirst != null) {
- if (phaseFirst.getHandlerDesc().getName().getLocalPart().equals(
- afterName)) {
- handlers.add(0, handler);
- return;
- }
- }
- int count = handlers.size();
- for (int i = 0; i < count; i++) {
+
+ for (int i = 0; i < handlers.size(); i++) {
Handler temphandler = (Handler) handlers.get(i);
- if (temphandler.getHandlerDesc().getName().getLocalPart().equals(
- afterName)) {
- if (i == count - 1) {
- handlers.add(handler);
- return;
- } else {
- handlers.add(i + 1, handler);
- return;
+ if (temphandler.getName().getLocalPart().equals(afterName)) {
+ if (phaselastset && (i == handlers.size() - 1)) {
+ throw new PhaseException("Can't insert handler after handler '" +
+ temphandler.getName() + "', which is marked phaseLast");
}
+ handlers.add(i + 1, handler);
+ return;
}
}
if (handlers.size() > 0) {
@@ -432,100 +378,69 @@
int before = -1;
int after = -1;
- /**
- * if hander.after = PhaseFirts and hnder.before = phaselast then
- * just add the entery to vector
- */
- if ((phaseFirst != null) && (phaseLast != null)) {
- if ((phaseFirst
- .getHandlerDesc()
- .getName()
- .getLocalPart()
- .equals(handler.getHandlerDesc().getRules().getAfter()))
- && (phaseLast
- .getHandlerDesc()
- .getName()
- .getLocalPart()
- .equals(handler.getHandlerDesc().getRules().getBefore()))) {
- handlers.add(handler);
- return;
- }
- }
-
- if (phaseFirst != null
- && (phaseFirst
- .getHandlerDesc()
- .getName()
- .getLocalPart()
- .equals(handler.getHandlerDesc().getRules().getAfter()))) {
- after = 0;
- }
- if (phaseLast != null
- && (phaseLast
- .getHandlerDesc()
- .getName()
- .getLocalPart()
- .equals(handler.getHandlerDesc().getRules().getBefore()))) {
- before = handlers.size();
- }
+ String beforeName = handler.getHandlerDesc().getRules().getBefore();
+ String afterName = handler.getHandlerDesc().getRules().getAfter();
for (int i = 0; i < handlers.size(); i++) {
Handler temphandler = (Handler) handlers.get(i);
- if (handler
- .getHandlerDesc()
- .getRules()
- .getAfter()
- .equals(
- temphandler.getHandlerDesc().getName()
- .getLocalPart())) {
+ if (afterName.equals(temphandler.getName().getLocalPart())) {
after = i;
- } else if (
- handler.getHandlerDesc().getRules().getBefore().equals(
- temphandler.getHandlerDesc().getName()
- .getLocalPart())) {
- before = i;
+ } else {
+ if (beforeName.equals(temphandler.getName().getLocalPart())) {
+ before = i;
+ }
}
if ((after >= 0) && (before >= 0)) {
- // no point of continue since both the before and after index has found
- if (after > before) {
- //TODO fix me Deepal , (have to check this)
- throw new PhaseException(
- "incorrect handler order for " +
- handler.getHandlerDesc().getName());
- } else {
- if (after + 1 <= handlers.size()) {
- handlers.add(after + 1, handler);
- return;
- } else {
- handlers.add(after, handler);
- return;
- }
- }
+ break;
}
}
- handlers.add(handler);
+
+ // no point of continue since both the before and after index has found
+ if (after > before) {
+ //TODO fix me Deepal , (have to check this)
+ throw new PhaseException(
+ "incorrect handler order for " +
+ handler.getHandlerDesc().getName());
+ }
+
+ if (before == -1 && after == -1) {
+ addHandler(handler);
+ return;
+ }
+
+ if (before == -1) {
+ addHandler(handler);
+ return;
+ }
+
+ if (after == -1) {
+ if (phasefirstset && before == 0) {
+ throw new PhaseException("Can't insert handler before handler '" +
+ ((Handler) handlers.get(0)).getName() + "', which is marked phaseFirst");
+ }
+ }
+
+ handlers.add(before, handler);
}
- private void insertHandler(HandlerDescription handler) throws PhaseException {
- Handler han = handler.getHandler();
- int type = getBeforeAfter(han);
- validateafter(han);
- validatebefore(han);
+ private void insertHandler(HandlerDescription handlerDesc) throws PhaseException {
+ Handler handler = handlerDesc.getHandler();
+ int type = getBeforeAfter(handler);
switch (type) {
case BOTH_BEFORE_AFTER: {
- insertBeforeandAfter(han);
+ insertBeforeandAfter(handler);
break;
}
case BEFORE: {
- insertBefore(han);
+ insertBefore(handler);
break;
}
case AFTER: {
- insertAfter(han);
+ insertAfter(handler);
break;
}
case ANYWHERE: {
- handlers.add(han);
+ addHandler(handler);
break;
}
}
@@ -537,38 +452,34 @@
* @return Returns an ArrayList of Handlers
*/
public ArrayList getHandlers() {
- ArrayList phaseHandlers = new ArrayList();
- if (phaseFirst != null) {
- phaseHandlers.add(phaseFirst);
- }
- for (int i = 0; i < handlers.size(); i++) {
- Handler handler = (Handler) handlers.get(i);
- phaseHandlers.add(handler);
- }
- if (phaseLast != null) {
- phaseHandlers.add(phaseLast);
- }
- return phaseHandlers;
+ return handlers;
}
- public void invokeStartFromHandler(QName name, MessageContext msgctx) throws AxisFault {
- msgctx.setPausedPhaseName(this.getPhaseName());
- boolean foudMatch = false;
- ArrayList phaseHandlers = getHandlers();
- for (int i = 0; i < phaseHandlers.size(); i++) {
- Handler handler = (Handler) handlers.get(i);
- if (handler != null && handler.getName().equals(name)) {
- foudMatch = true;
- }
+ public void init(HandlerDescription handlerdesc) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
- if (handler != null && foudMatch) {
- handler.invoke(msgctx);
- }
- }
+ public QName getName() {
+ return new QName(phaseName);
+ }
+
+ public Parameter getParameter(String name) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void cleanup() throws AxisFault {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HandlerDescription getHandlerDesc() {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
}
public String toString() {
return this.getPhaseName();
}
+ public void setName(String phaseName) {
+ this.phaseName = phaseName;
+ }
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractRobustInMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractRobustInMessageReceiver.java?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractRobustInMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractRobustInMessageReceiver.java Sat Dec 10 21:17:41 2005
@@ -31,15 +31,6 @@
public abstract void invokeBusinessLogic(MessageContext inMessage) throws AxisFault;
public final void receive(final MessageContext messgeCtx) throws AxisFault {
- try {
- invokeBusinessLogic(messgeCtx);
- } catch (AxisFault e) {
- AxisEngine engine =
- new AxisEngine(
- messgeCtx.getOperationContext().getServiceContext().getConfigurationContext());
- MessageContext faultContext = engine.createFaultMessageContext(messgeCtx, e);
- engine.sendFault(faultContext);
- }
+ invokeBusinessLogic(messgeCtx);
}
-
}
Modified: webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/axis2.xml?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/axis2.xml Sat Dec 10 21:17:41 2005
@@ -51,35 +51,28 @@
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
+
<handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
+
<handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
+
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="org.apache.axis2.engine.DispatchingChecker">
- <order phase="PostDispatch"/>
- </handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
- <order phase="PostDispatch"/>
- </handler>
- <handler name="SOAPProcessingModelChecker"
- class="org.apache.axis2.engine.SOAPProcessingModelChecker">
<order phase="PostDispatch"/>
</handler>
</phase>
Modified: webservices/axis2/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/test-resources/deployment/ConfigWithObservers/axis2.xml Sat Dec 10 21:17:41 2005
@@ -11,13 +11,12 @@
<parameter name="userName" locked="false">admin</parameter>
<parameter name="password" locked="false">axis2</parameter>
-<!-- The way of adding listener to the system-->
+ <!-- The way of adding listener to the system-->
<listener class="org.apache.axis2.deployment.AxisObserverImpl">
<parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>
</listener>
-
<!-- ================================================= -->
<!-- Message Receivers -->
<!-- ================================================= -->
@@ -73,33 +72,30 @@
<!-- ================================================= -->
<!-- Phases -->
<!-- ================================================= -->
- <phaseOrder type="inflow">
+ <phaseOrder type="inflow">
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="RequestURIBasedDispatcher"
+
+ <handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPActionBasedDispatcher"
+
+ <handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="org.apache.axis2.engine.DispatchingChecker">
- <order phase="PostDispatch"/>
- </handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
<order phase="PostDispatch"/>
@@ -113,6 +109,7 @@
<!-- user can add his own phases to this area -->
<phase name="userphase1"/>
<!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
@@ -126,6 +123,5 @@
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
-
</axisconfig>
Modified: webservices/axis2/trunk/java/modules/core/test-resources/deployment/ParaLockedRepo/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test-resources/deployment/ParaLockedRepo/axis2.xml?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test-resources/deployment/ParaLockedRepo/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/test-resources/deployment/ParaLockedRepo/axis2.xml Sat Dec 10 21:17:41 2005
@@ -8,33 +8,30 @@
<parameter name="modulePara1" locked="false">true</parameter>
<parameter name="modulePara2" locked="true">true</parameter>
- <phaseOrder type="inflow">
+ <phaseOrder type="inflow">
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="RequestURIBasedDispatcher"
+
+ <handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPActionBasedDispatcher"
+
+ <handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="org.apache.axis2.engine.DispatchingChecker">
- <order phase="PostDispatch"/>
- </handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
<order phase="PostDispatch"/>
@@ -48,6 +45,7 @@
<!-- user can add his own phases to this area -->
<phase name="userphase1"/>
<!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
Modified: webservices/axis2/trunk/java/modules/core/test-resources/deployment/ServiceGroup/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test-resources/deployment/ServiceGroup/axis2.xml?rev=355917&r1=355916&r2=355917&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test-resources/deployment/ServiceGroup/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/test-resources/deployment/ServiceGroup/axis2.xml Sat Dec 10 21:17:41 2005
@@ -13,9 +13,6 @@
<parameter name="password" locked="false">axis2</parameter>
-
-
-
<!-- ================================================= -->
<!-- Message Receivers -->
<!-- ================================================= -->
@@ -54,37 +51,35 @@
<transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
</transportSender>
- <transportSender name="https" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <transportSender name="https"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
</transportSender>
- <phaseOrder type="inflow">
+ <phaseOrder type="inflow">
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="RequestURIBasedDispatcher"
+
+ <handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPActionBasedDispatcher"
+
+ <handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="org.apache.axis2.engine.DispatchingChecker">
- <order phase="PostDispatch"/>
- </handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
<order phase="PostDispatch"/>
@@ -98,6 +93,7 @@
<!-- user can add his own phases to this area -->
<phase name="userphase1"/>
<!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
@@ -111,6 +107,5 @@
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
-
</axisconfig>