You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/09/13 13:30:00 UTC
svn commit: r280538 - in /webservices/axis2/trunk/java/modules:
core/src/org/apache/axis2/deployment/
core/src/org/apache/axis2/deployment/repository/util/
core/src/org/apache/axis2/engine/
core/test-resources/deployment/dispatch_repo/ core/test-resour...
Author: deepal
Date: Tue Sep 13 04:29:19 2005
New Revision: 280538
URL: http://svn.apache.org/viewcvs?rev=280538&view=rev
Log:
fixing Configurable dispatching order (Axis2 154)
Added:
webservices/axis2/trunk/java/modules/core/test-resources/deployment/dispatch_repo/
webservices/axis2/trunk/java/modules/core/test-resources/deployment/dispatch_repo/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/dispatch_repo/modules/
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/DispatchingTest.java
Modified:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.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/org/apache/axis2/engine/MessageContextInjectionTest.java
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=280538&r1=280537&r2=280538&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 Tue Sep 13 04:29:19 2005
@@ -1,13 +1,11 @@
package org.apache.axis2.deployment;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.engine.AxisConfigurationImpl;
-import org.apache.axis2.engine.AxisObserver;
+import org.apache.axis2.engine.*;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMAttribute;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.AxisFault;
+import org.apache.axis2.phaseresolver.PhaseMetadata;
import org.apache.axis2.storage.AxisStorage;
import org.apache.axis2.deployment.util.PhasesInfo;
import org.apache.axis2.transport.TransportSender;
@@ -74,6 +72,16 @@
mepAtt.getValue(),msgrecivere);
}
+ //processing Dispatching Order
+ OMElement dispatch_order = config_element.getFirstChildWithName(
+ new QName(DIPSTCH_ORDER));
+ if(dispatch_order !=null){
+ processDispatchingOrder(dispatch_order);
+ log.info("found the custom disptaching order and continue with that order");
+ } else {
+ ((AxisConfigurationImpl)axisConfiguration).setDefaultDispatchers();
+ log.info("no custom diaptching order found continue with default dispatcing order");
+ }
//Process Module refs
@@ -110,6 +118,43 @@
}
}
+
+ private void processDispatchingOrder(OMElement dispatch_order) throws DeploymentException {
+ Iterator dispatchers = dispatch_order.getChildrenWithName(new QName(DIPSTCHER));
+ boolean foundDiaptcher= false;
+ Phase dispatchPhae = new Phase(PhaseMetadata.PHASE_DISPATCH);
+ int count =0;
+ while (dispatchers.hasNext()) {
+ foundDiaptcher = true;
+ OMElement dispchter = (OMElement) dispatchers.next();
+ String clssName = dispchter.getAttribute(new QName(CLASSNAME)).getValue();
+ AbstractDispatcher disptachClas;
+ Class classInstance;
+ try {
+ classInstance = Class.forName(
+ clssName,true,Thread.currentThread().getContextClassLoader());
+ disptachClas =(AbstractDispatcher)classInstance.newInstance();
+ disptachClas.initDispatcher();
+ disptachClas.getHandlerDesc().setParent(axisConfiguration);
+ dispatchPhae.addHandler(disptachClas, count);
+ count ++;
+ } catch (ClassNotFoundException e) {
+ throw new DeploymentException(e);
+ } catch (IllegalAccessException e) {
+ throw new DeploymentException(e);
+ } catch (InstantiationException e) {
+ throw new DeploymentException(e);
+ }
+ }
+
+ if(!foundDiaptcher){
+ throw new DeploymentException("No dispatcher found , can not continue ....");
+ } else {
+ ((AxisConfigurationImpl)axisConfiguration).setDispatchPhase(dispatchPhae);
+ }
+
+ }
+
private void processAxisStorage(OMElement storageElement) throws DeploymentException {
AxisStorage axisStorage;
if(storageElement !=null){
@@ -420,7 +465,7 @@
}
protected void processModuleConfig(Iterator moduleConfigs ,
- ParameterInclude parent, AxisConfiguration config)
+ ParameterInclude parent, AxisConfiguration config)
throws DeploymentException {
while (moduleConfigs.hasNext()) {
OMElement moduleConfig = (OMElement) moduleConfigs.next();
@@ -434,7 +479,7 @@
new ModuleConfiguration(new QName(module),parent);
Iterator paramters= moduleConfig.getChildrenWithName(new QName(PARAMETERST));
processParameters(paramters,moduleConfiguration,parent);
- ((AxisConfigurationImpl)config).addModuleConfig(moduleConfiguration);
+ ((AxisConfigurationImpl)config).addModuleConfig(moduleConfiguration);
}
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java Tue Sep 13 04:29:19 2005
@@ -52,7 +52,6 @@
String AXIS2CONFIG = "axisconfig";
// for serviemetadat
- String PROVIDERNAME = "provider";
String STYLENAME = "style";
String CONTEXTPATHNAME = "contextPath";
@@ -88,6 +87,8 @@
String HOTDEPLOYMENT = "hotdeployment";
String HOTUPDATE = "hotupdate";
String EXTRACTSERVICEARCHIVE = "extractServiceArchive";
+ String DIPSTCH_ORDER ="dispatchOrder";
+ String DIPSTCHER ="dispatcher";
String AXIS_STORAGE = "axisStorage";
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Tue Sep 13 04:29:19 2005
@@ -43,6 +43,7 @@
* To create a ServiceDescrption <code>ServiceDescription</code> using given wsdl , if the
* service.wsdl there in the arcive file ServiceDescription will be creted using that else
* default ServiceDescription will be crated
+ *
* @param file
* @return
* @throws DeploymentException
@@ -61,7 +62,10 @@
.iterator();
if (iterator.hasNext()) {
foundservice = true;
- WSDLServiceImpl serviceimpl = (WSDLServiceImpl)womDescription.getServices().get(iterator.next());
+ // remove <wsdl:service> and <wsdl:binding> elements from the service
+ // description we read in as we will be replacing them anyway.
+
+ WSDLServiceImpl serviceimpl = (WSDLServiceImpl) womDescription.getServices().get(iterator.next());
service = new ServiceDescription(serviceimpl);
// service =
// (ServiceDescription) womDescription.getServices()
@@ -95,7 +99,7 @@
*/
public void processServiceDescriptor(String filename,
DeploymentEngine engine,
- ServiceDescription service, boolean extarctService)throws DeploymentException {
+ ServiceDescription service, boolean extarctService) throws DeploymentException {
// get attribute values
boolean foundServiceXML = false;
ServiceBuilder builder;
@@ -107,7 +111,7 @@
while ((entry = zin.getNextEntry()) != null) {
if (entry.getName().equals(SERVICEXML)) {
foundServiceXML = true;
- builder = new ServiceBuilder(zin,engine,service);
+ builder = new ServiceBuilder(zin, engine, service);
builder.populateService();
break;
}
@@ -121,19 +125,19 @@
throw new DeploymentException(e);
}
} else {
- File file = new File(filename , SERVICEXML);
- if(file.exists()){
+ File file = new File(filename, SERVICEXML);
+ if (file.exists()) {
InputStream in = null;
try {
in = new FileInputStream(file);
- builder = new ServiceBuilder(in,engine,service);
+ builder = new ServiceBuilder(in, engine, service);
builder.populateService();
} catch (FileNotFoundException e) {
throw new DeploymentException("FileNotFound : " + e);
- }finally {
+ } finally {
try {
- if (in !=null) {
+ if (in != null) {
in.close();
}
} catch (IOException e) {
@@ -152,14 +156,14 @@
ModuleDescription module) throws DeploymentException {
// get attribute values
boolean foundmoduleXML = false;
- ZipInputStream zin ;
+ ZipInputStream zin;
try {
zin = new ZipInputStream(new FileInputStream(filename));
ZipEntry entry;
while ((entry = zin.getNextEntry()) != null) {
if (entry.getName().equals(MODULEXML)) {
foundmoduleXML = true;
- ModuleBuilder builder = new ModuleBuilder(zin, engine,module);
+ ModuleBuilder builder = new ModuleBuilder(zin, engine, module);
builder.populateModule();
break;
}
@@ -175,7 +179,6 @@
}
-
/**
* This method first check whether the given module is there in the user home dirctory if so return
* that , else try to read the given module form classpath (from resources ) if found first get the module.mar
@@ -188,7 +191,7 @@
public File creatModuleArchivefromResource(String moduleName,
String axis2repository) throws DeploymentException {
File modulearchiveFile;
- File modules ;
+ File modules;
try {
int BUFFER = 2048;
if (axis2repository == null) {
@@ -201,7 +204,7 @@
modules.mkdirs();
} else {
modules = new File(repository, "modules");
- if(!modules.exists()){
+ if (!modules.exists()) {
modules.mkdirs();
}
}
@@ -236,7 +239,7 @@
ZipOutputStream out = new ZipOutputStream(new
BufferedOutputStream(dest));
byte data[] = new byte[BUFFER];
- ZipInputStream zin ;
+ ZipInputStream zin;
zin = new ZipInputStream(in);
ZipEntry entry;
while ((entry = zin.getNextEntry()) != null) {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java Tue Sep 13 04:29:19 2005
@@ -32,7 +32,7 @@
* Axis2 service dispatching is model via a Chain of diapatchers, each trying to
* Diaptach but let go without throwing a execption in case they fail.
*/
-public abstract class AbstractDispatcher extends AbstractHandler implements Handler {
+public abstract class AbstractDispatcher extends AbstractHandler {
/**
* Field NAME
*/
@@ -48,6 +48,9 @@
public AbstractDispatcher() {
init(new HandlerDescription(NAME));
}
+
+ //just to put the parent
+ public abstract void initDispatcher();
/**
* This is final, obivously not for overiding
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java Tue Sep 13 04:29:19 2005
@@ -36,10 +36,13 @@
new QName("http://axis.ws.apache.org",
"AddressingBasedDispatcher");
- public AddressingBasedDispatcher() {
+// public AddressingBasedDispatcher() {
+// init(new HandlerDescription(NAME));
+// }
+
+ public void initDispatcher() {
init(new HandlerDescription(NAME));
}
-
//TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
public OperationDescription findOperation(ServiceDescription service,
MessageContext messageContext)
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java Tue Sep 13 04:29:19 2005
@@ -118,6 +118,40 @@
inPhasesUptoAndIncludingPostDispatch.add(
new Phase(PhaseMetadata.PHASE_PRE_DISPATCH));
+// Phase dispatch = new Phase(PhaseMetadata.PHASE_DISPATCH);
+// AddressingBasedDispatcher add_dispatch = new AddressingBasedDispatcher();
+// add_dispatch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(add_dispatch, 0);
+//
+// RequestURIBasedDispatcher uri_diaptch = new RequestURIBasedDispatcher();
+// uri_diaptch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(uri_diaptch, 1);
+//
+// SOAPActionBasedDispatcher soapActionBased_dispatch = new SOAPActionBasedDispatcher();
+// soapActionBased_dispatch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(soapActionBased_dispatch, 2);
+//
+// SOAPMessageBodyBasedDispatcher soapMessageBodybased_dispatch =
+// new SOAPMessageBodyBasedDispatcher();
+// soapMessageBodybased_dispatch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(soapMessageBodybased_dispatch, 3);
+//
+// inPhasesUptoAndIncludingPostDispatch.add(dispatch);
+//
+// Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
+// DispatchingChecker dispatchingChecker = new DispatchingChecker();
+// dispatchingChecker.getHandlerDesc().setParent(this);
+//
+// postDispatch.addHandler(dispatchingChecker);
+// inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
+ }
+
+
+ /**
+ * setting the default dispatching order
+ */
+ public void setDefaultDispatchers(){
+
Phase dispatch = new Phase(PhaseMetadata.PHASE_DISPATCH);
AddressingBasedDispatcher add_dispatch = new AddressingBasedDispatcher();
add_dispatch.getHandlerDesc().setParent(this);
@@ -148,6 +182,21 @@
postDispatch.addHandler(dispatchingChecker,0);
postDispatch.addHandler(instanceDispatcher,1);
+ inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
+ }
+
+
+ /**
+ * Setting the custom dispatching order
+ * @param dispatch
+ */
+ public void setDispatchPhase(Phase dispatch){
+ inPhasesUptoAndIncludingPostDispatch.add(dispatch);
+ Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
+ DispatchingChecker dispatchingChecker = new DispatchingChecker();
+ dispatchingChecker.getHandlerDesc().setParent(this);
+
+ postDispatch.addHandler(dispatchingChecker);
inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java Tue Sep 13 04:29:19 2005
@@ -38,12 +38,6 @@
QName serviceName = null;
QName operationName = null;
- /**
- * Constructor Dispatcher
- */
- public RequestURIBasedDispatcher() {
- init(new HandlerDescription(NAME));
- }
public OperationDescription findOperation(ServiceDescription service,
MessageContext messageContext)
@@ -75,5 +69,9 @@
}
}
return null;
+ }
+
+ public void initDispatcher() {
+ init(new HandlerDescription(NAME));
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java Tue Sep 13 04:29:19 2005
@@ -34,10 +34,13 @@
new QName("http://axis.ws.apache.org",
"SOAPActionBasedDispatcher");
- public SOAPActionBasedDispatcher() {
+// public SOAPActionBasedDispatcher() {
+// init(new HandlerDescription(NAME));
+// }
+
+ public void initDispatcher() {
init(new HandlerDescription(NAME));
}
-
public OperationDescription findOperation(ServiceDescription service,
MessageContext messageContext)
throws AxisFault {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java Tue Sep 13 04:29:19 2005
@@ -43,7 +43,11 @@
/**
* Constructor Dispatcher
*/
- public SOAPMessageBodyBasedDispatcher() {
+// public SOAPMessageBodyBasedDispatcher() {
+// init(new HandlerDescription(NAME));
+// }
+
+ public void initDispatcher() {
init(new HandlerDescription(NAME));
}
Added: webservices/axis2/trunk/java/modules/core/test-resources/deployment/dispatch_repo/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test-resources/deployment/dispatch_repo/axis2.xml?rev=280538&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test-resources/deployment/dispatch_repo/axis2.xml (added)
+++ webservices/axis2/trunk/java/modules/core/test-resources/deployment/dispatch_repo/axis2.xml Tue Sep 13 04:29:19 2005
@@ -0,0 +1,90 @@
+<axisconfig name="AxisJava2.0">
+ <!-- ================================================= -->
+ <!-- Parameters -->
+ <!-- ================================================= -->
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">false</parameter>
+ <parameter name="enableMTOM" locked="false">true</parameter>
+ <!-- Uncomment this to enable REST support -->
+ <!-- <parameter name="enableREST" locked="false">true</parameter>-->
+
+
+ <parameter name="userName" locked="false">admin</parameter>
+ <parameter name="password" locked="false">axis2</parameter>
+
+
+ <dispatchOrder>
+ <dispatcher name="AddressingBasedDispatcher"class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
+ <dispatcher name="SOAPActionBasedDispatcher"class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
+ <dispatcher name="SOAPMessageBodyBasedDispatcher"class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
+ </dispatchOrder>
+ <axisStorage class="org.apache.axis2.storage.impl.AxisMemoryStorage">
+ <parameter name="StoreLocation" locked="false">N:S</parameter>
+ </axisStorage>
+
+
+
+ <!-- ================================================= -->
+ <!-- Message Receivers -->
+ <!-- ================================================= -->
+ <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <!-- ================================================= -->
+ <!-- Transport Ins -->
+ <!-- ================================================= -->
+ <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+ <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+ <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">
+ <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>
+ <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>
+ <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>
+ <parameter name="transport.mail.pop3.port" locked="false">110</parameter>
+ <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>
+ </transportReceiver> -->
+
+ <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+ <!-- ================================================= -->
+ <!-- Transport Outs -->
+ <!-- ================================================= -->
+
+ <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+ <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
+ <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">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+ </transportSender>
+
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="TransportIn"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch"/>
+ <phase name="PostDispatch"/>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+</axisconfig>
+
Added: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/DispatchingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/DispatchingTest.java?rev=280538&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/DispatchingTest.java (added)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/DispatchingTest.java Tue Sep 13 04:29:19 2005
@@ -0,0 +1,70 @@
+package org.apache.axis2.engine;
+
+import junit.framework.TestCase;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.phaseresolver.PhaseMetadata;
+
+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, 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.
+*
+*
+*/
+
+/**
+ * Author: Deepal Jayasinghe
+ * Date: Sep 13, 2005
+ * Time: 4:34:27 PM
+ */
+public class DispatchingTest extends TestCase {
+
+ AxisConfiguration ar;
+ String repo ="./test-resources/deployment/dispatch_repo";
+
+
+
+ public void testDispatch() throws Exception {
+ ConfigurationContextFactory builder = new ConfigurationContextFactory();
+ ar = builder.buildConfigurationContext(repo).getAxisConfiguration();
+ ArrayList list = ar.getInPhasesUptoAndIncludingPostDispatch();
+ for (int i = 0; i < list.size(); i++) {
+ Phase phase = (Phase) list.get(i);
+ if(PhaseMetadata.PHASE_DISPATCH.equals(phase.getPhaseName())){
+ assertEquals(3,phase.getHandlerCount());
+ ArrayList handler = phase.getHandlers();
+ for (int j = 0; j < handler.size(); j++) {
+ Handler handler1 = (Handler) handler.get(j);
+ switch(j){
+ case 0: {
+ assertEquals(handler1.getHandlerDesc().getName().
+ getLocalPart(),"AddressingBasedDispatcher");
+ break;
+ }
+ case 1 : {
+ assertEquals(handler1.getHandlerDesc().getName().
+ getLocalPart(),"SOAPActionBasedDispatcher");
+ break;
+ }
+ case 2 : {
+ assertEquals(handler1.getHandlerDesc().getName().
+ getLocalPart(),"SOAPMessageBodyBasedDispatcher");
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java Tue Sep 13 04:29:19 2005
@@ -47,6 +47,7 @@
super(arg0);
executedHandlers = new ArrayList();
AxisConfiguration engineRegistry = new AxisConfigurationImpl();
+ ((AxisConfigurationImpl)engineRegistry).setDefaultDispatchers();
engineContext = new ConfigurationContext(engineRegistry);
transportOut = new TransportOutDescription(new QName("null"));
transportOut.setSender(new CommonsHTTPTransportSender());
Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java Tue Sep 13 04:29:19 2005
@@ -31,6 +31,7 @@
//TODO fix me
phaserul = new PhaseRuleTest("");
axisSytem = new AxisConfigurationImpl();
+ ((AxisConfigurationImpl)axisSytem).setDefaultDispatchers();
ArrayList inPhase = axisSytem.getInPhasesUptoAndIncludingPostDispatch();
Handler han = null;//(Handler)Class.forName("org.apache.axis2.handlers.AbstractHandler",true, Thread.currentThread().getContextClassLoader()).newInstance();
Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java Tue Sep 13 04:29:19 2005
@@ -47,6 +47,7 @@
//TODO Fix me
phaserul = new PreDispatchPhaseRuleTest("");
axisSytem = new AxisConfigurationImpl();
+ ((AxisConfigurationImpl)axisSytem).setDefaultDispatchers();
ArrayList inPhase = axisSytem.getInPhasesUptoAndIncludingPostDispatch();
Handler han = null;
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java Tue Sep 13 04:29:19 2005
@@ -71,8 +71,10 @@
}
protected void setUp() throws Exception {
+ AxisConfiguration config = new AxisConfigurationImpl();
+ ((AxisConfigurationImpl)config).setDefaultDispatchers();
LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(
- new AxisConfigurationImpl());
+ config);
ServiceDescription service = new ServiceDescription(serviceName);
service.addParameter(