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 di...@apache.org on 2005/02/20 18:57:02 UTC
svn commit: r154537 [3/6] - in webservices/axis/trunk/java/modules:
core/src/java/org/apache/axis/ core/src/java/org/apache/axis/addressing/
core/src/java/org/apache/axis/addressing/miheaders/
core/src/java/org/apache/axis/addressing/om/
core/src/java/org/apache/axis/clientapi/
core/src/java/org/apache/axis/context/
core/src/java/org/apache/axis/description/
core/src/java/org/apache/axis/engine/ core/src/java/org/apache/axis/handlers/
core/src/java/org/apache/axis/phaseresolver/
core/src/java/org/apache/axis/providers/
core/src/java/org/apache/axis/receivers/
core/src/java/org/apache/axis/transport/
core/src/java/org/apache/axis/transport/http/
core/src/java/org/apache/axis/util/
deployment/src/samples/deployment/service1/org/apache/axis/sample/echo/
samples/src/java/encoding/sample1/
samples/src/java/encoding/sample2/benchMark/
samples/src/java/org/apache/axis/testUtils/
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java Sun Feb 20 09:56:49 2005
@@ -1,12 +1,12 @@
/*
* 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.
@@ -27,72 +27,97 @@
import javax.xml.namespace.QName;
+/**
+ * Class Dispatcher
+ */
public class Dispatcher extends AbstractHandler implements Handler {
- public static final QName NAME = new QName("http://axis.ws.apache.org", "Disapatcher");
-
+ /**
+ * Field NAME
+ */
+ public static final QName NAME = new QName("http://axis.ws.apache.org",
+ "Disapatcher");
+
+ /**
+ * Constructor Dispatcher
+ */
public Dispatcher() {
init(new HandlerMetadata(NAME));
}
+ /**
+ * Method invoke
+ *
+ * @param msgctx
+ * @throws AxisFault
+ */
public void invoke(MessageContext msgctx) throws AxisFault {
if (msgctx.isServerSide()) {
EndpointReference toEPR = msgctx.getTo();
String filePart = toEPR.getAddress();
- String soapAction = (String) msgctx.getProperty(MessageContext.SOAP_ACTION);
+ String soapAction =
+ (String) msgctx.getProperty(MessageContext.SOAP_ACTION);
int index = filePart.lastIndexOf('/');
String serviceAndMethodStr = null;
if (index > 0) {
serviceAndMethodStr = filePart.substring(index + 1);
-
}
if (serviceAndMethodStr == null) {
serviceAndMethodStr = soapAction;
}
- index = serviceAndMethodStr.lastIndexOf(Constants.METHOD_NAME_ESCAPE_CHARACTOR);
+ index = serviceAndMethodStr.lastIndexOf(
+ Constants.METHOD_NAME_ESCAPE_CHARACTOR);
QName serviceName = null;
QName operationName = null;
if (index > 0) {
- serviceName = new QName(serviceAndMethodStr.substring(0, index - 1));
- operationName = new QName(serviceAndMethodStr.substring(index + 1));
+ serviceName = new QName(serviceAndMethodStr.substring(0,
+ index - 1));
+ operationName = new QName(serviceAndMethodStr.substring(index
+ + 1));
} else {
serviceName = new QName(serviceAndMethodStr);
}
if (serviceName != null) {
- EngineRegistry registry = msgctx.getGlobalContext().getRegistry();
+ EngineRegistry registry =
+ msgctx.getGlobalContext().getRegistry();
AxisService service = registry.getService(serviceName);
if (service != null) {
msgctx.setService(service);
msgctx.setMessageStyle(service.getStyle());
- if (!WSDLService.STYLE_RPC.equals(msgctx.getMessageStyle())) {
+ if (!WSDLService.STYLE_RPC.equals(
+ msgctx.getMessageStyle())) {
if (operationName != null) {
- AxisOperation op = service.getOperation(operationName);
+ AxisOperation op =
+ service.getOperation(operationName);
if (op != null) {
msgctx.setOperation(op);
} else {
- throw new AxisFault("Operation not found " + operationName);
+ throw new AxisFault("Operation not found "
+ + operationName);
}
} else {
throw new AxisFault("Operation Name not specifed");
}
}
-
- //let add the Handlers
+ // let add the Handlers
ExecutionChain chain = msgctx.getExecutionChain();
chain.addPhases(service.getPhases(EngineRegistry.INFLOW));
- //add invoke Phase
+
+ // add invoke Phase
Phase invokePhase = new Phase(Phase.SERVICE_INVOCATION);
invokePhase.addHandler(new OpNameFinder());
- invokePhase.addHandler(ReceiverLocator.locateReceiver(msgctx));
+ invokePhase.addHandler(
+ ReceiverLocator.locateReceiver(msgctx));
chain.addPhase(invokePhase);
} else {
- throw new AxisFault("Service " + serviceName + " is not found");
+ throw new AxisFault("Service " + serviceName
+ + " is not found");
}
} else {
throw new AxisFault("Both the URI and SOAP_ACTION Is Null");
}
} else {
- //TODO client side service Dispatch ,, What this really mean?
+ // TODO client side service Dispatch ,, What this really mean?
}
}
}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java Sun Feb 20 09:56:49 2005
@@ -1,12 +1,12 @@
/*
* 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.
@@ -31,35 +31,107 @@
* artifacts does not keep states foward from the execution.
*/
public interface EngineRegistry {
+ /**
+ * Field INFLOW
+ */
public static final int INFLOW = 10003;
+
+ /**
+ * Field OUTFLOW
+ */
public static final int OUTFLOW = 10004;
+
+ /**
+ * Field FAULTFLOW
+ */
public static final int FAULTFLOW = 10005;
+ /**
+ * Method getGlobal
+ *
+ * @return
+ * @throws AxisFault
+ */
public AxisGlobal getGlobal() throws AxisFault;
+ /**
+ * Method getService
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
+ */
public AxisService getService(QName name) throws AxisFault;
+ /**
+ * Method addService
+ *
+ * @param service
+ * @throws AxisFault
+ */
public void addService(AxisService service) throws AxisFault;
+ /**
+ * Method removeService
+ *
+ * @param name
+ * @throws AxisFault
+ */
public void removeService(QName name) throws AxisFault;
/**
* Modules is read only as they can not deployed while runing
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
*/
public AxisModule getModule(QName name) throws AxisFault;
+ /**
+ * Method addMdoule
+ *
+ * @param module
+ * @throws AxisFault
+ */
public void addMdoule(AxisModule module) throws AxisFault;
+ /**
+ * Method getTransport
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
+ */
public AxisTransport getTransport(QName name) throws AxisFault;
+ /**
+ * Method addTransport
+ *
+ * @param transport
+ * @throws AxisFault
+ */
public void addTransport(AxisTransport transport) throws AxisFault;
+ /**
+ * Method getTransports
+ *
+ * @return
+ * @throws AxisFault
+ */
public HashMap getTransports() throws AxisFault;
/**
* Ordred list of phases
+ *
+ * @return
*/
public ArrayList getPhases();
+ /**
+ * Method getServices
+ *
+ * @return
+ */
public HashMap getServices();
}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryFactory.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryFactory.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryFactory.java Sun Feb 20 09:56:49 2005
@@ -1,20 +1,30 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.engine;
-
-public interface EngineRegistryFactory {
- public EngineRegistry createEngineRegistry(String file) throws AxisFault;
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.engine;
+
+/**
+ * Interface EngineRegistryFactory
+ */
+public interface EngineRegistryFactory {
+ /**
+ * Method createEngineRegistry
+ *
+ * @param file
+ * @return
+ * @throws AxisFault
+ */
+ public EngineRegistry createEngineRegistry(String file) throws AxisFault;
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java Sun Feb 20 09:56:49 2005
@@ -1,92 +1,182 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.engine;
-
-import org.apache.axis.description.AxisGlobal;
-import org.apache.axis.description.AxisModule;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.AxisTransport;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-public class EngineRegistryImpl implements EngineRegistry {
- private final HashMap modules = new HashMap();
- private final HashMap services = new HashMap();
- private final HashMap transports = new HashMap();
- private final AxisGlobal global;
- private ArrayList phases;
-
- public EngineRegistryImpl(AxisGlobal global) {
- this.global = global;
- phases = new ArrayList();
- }
-
- public HashMap getServices() {
- return services;
- }
-
- public synchronized void addMdoule(AxisModule module) throws AxisFault {
- modules.put(module.getName(), module);
- }
-
- public synchronized void addService(AxisService service) throws AxisFault {
- services.put(service.getName(), service);
- }
-
- public AxisGlobal getGlobal() throws AxisFault {
- return global;
- }
-
- public AxisModule getModule(QName name) throws AxisFault {
- return (AxisModule) modules.get(name);
- }
-
- public AxisService getService(QName name) throws AxisFault {
- return (AxisService) services.get(name);
- }
-
- public synchronized void removeService(QName name) throws AxisFault {
- services.remove(name);
- }
-
- public AxisTransport getTransport(QName name) throws AxisFault {
- return (AxisTransport) transports.get(name);
- }
-
- public synchronized void addTransport(AxisTransport transport) throws AxisFault {
- transports.put(transport.getName(), transport);
- }
-
- public HashMap getTransports() throws AxisFault {
- return transports;
- }
-
- /**
- * @return
- */
- public ArrayList getPhases() {
- return phases;
- }
-
- /**
- * @param list
- */
- public void setPhases(ArrayList list) {
- phases = list;
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.engine;
+
+import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.AxisModule;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.AxisTransport;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * Class EngineRegistryImpl
+ */
+public class EngineRegistryImpl implements EngineRegistry {
+ /**
+ * Field modules
+ */
+ private final HashMap modules = new HashMap();
+
+ /**
+ * Field services
+ */
+ private final HashMap services = new HashMap();
+
+ /**
+ * Field transports
+ */
+ private final HashMap transports = new HashMap();
+
+ /**
+ * Field global
+ */
+ private final AxisGlobal global;
+
+ /**
+ * Field phases
+ */
+ private ArrayList phases;
+
+ /**
+ * Constructor EngineRegistryImpl
+ *
+ * @param global
+ */
+ public EngineRegistryImpl(AxisGlobal global) {
+ this.global = global;
+ phases = new ArrayList();
+ }
+
+ /**
+ * Method getServices
+ *
+ * @return
+ */
+ public HashMap getServices() {
+ return services;
+ }
+
+ /**
+ * Method addMdoule
+ *
+ * @param module
+ * @throws AxisFault
+ */
+ public synchronized void addMdoule(AxisModule module) throws AxisFault {
+ modules.put(module.getName(), module);
+ }
+
+ /**
+ * Method addService
+ *
+ * @param service
+ * @throws AxisFault
+ */
+ public synchronized void addService(AxisService service) throws AxisFault {
+ services.put(service.getName(), service);
+ }
+
+ /**
+ * Method getGlobal
+ *
+ * @return
+ * @throws AxisFault
+ */
+ public AxisGlobal getGlobal() throws AxisFault {
+ return global;
+ }
+
+ /**
+ * Method getModule
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
+ */
+ public AxisModule getModule(QName name) throws AxisFault {
+ return (AxisModule) modules.get(name);
+ }
+
+ /**
+ * Method getService
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
+ */
+ public AxisService getService(QName name) throws AxisFault {
+ return (AxisService) services.get(name);
+ }
+
+ /**
+ * Method removeService
+ *
+ * @param name
+ * @throws AxisFault
+ */
+ public synchronized void removeService(QName name) throws AxisFault {
+ services.remove(name);
+ }
+
+ /**
+ * Method getTransport
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
+ */
+ public AxisTransport getTransport(QName name) throws AxisFault {
+ return (AxisTransport) transports.get(name);
+ }
+
+ /**
+ * Method addTransport
+ *
+ * @param transport
+ * @throws AxisFault
+ */
+ public synchronized void addTransport(AxisTransport transport)
+ throws AxisFault {
+ transports.put(transport.getName(), transport);
+ }
+
+ /**
+ * Method getTransports
+ *
+ * @return
+ * @throws AxisFault
+ */
+ public HashMap getTransports() throws AxisFault {
+ return transports;
+ }
+
+ /**
+ * @return
+ */
+ public ArrayList getPhases() {
+ return phases;
+ }
+
+ /**
+ * @param list
+ */
+ public void setPhases(ArrayList list) {
+ phases = list;
+ }
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ExecutionChain.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ExecutionChain.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ExecutionChain.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ExecutionChain.java Sun Feb 20 09:56:49 2005
@@ -1,82 +1,118 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.engine;
-
-import org.apache.axis.context.MessageContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Stack;
-
-/**
- * <p> This is the ordered Collection of Phases as specified by the Server.xml file.
- * this has the execution logic as well. If something goes wrong inside the
- * Execution Chain then the exeution chain itself revoke them.
- * </p>
- */
-public class ExecutionChain {
- private final HashMap phases;
- private final ArrayList executionList;
- private Log log = LogFactory.getLog(getClass());
-
- public ExecutionChain() {
- phases = new HashMap();
- executionList = new ArrayList();
- }
-
- public void addPhase(Phase phase) {
- log.info("Phase " + phase.getPhaseName() + "Added ");
- phases.put(phase.getPhaseName(), phase);
- executionList.add(phase);
- }
-
- public void addPhases(ArrayList phases) {
- if (phases != null && !phases.isEmpty()) {
- for (int i = 0; i < phases.size(); i++) {
- addPhase((Phase) phases.get(i));
- }
- }
- }
-
- public Phase getPhase(QName name) {
- return (Phase) phases.get(name);
- }
-
- public void invoke(MessageContext msgctx) throws AxisFault {
- Stack executionStack = new Stack();
- try {
- for (int i = 0; i < executionList.size(); i++) {
- Phase phase = (Phase) executionList.get(i);
- if (phase != null) {
- log.info("Invoke the Phase " + phase.getPhaseName());
- executionStack.push(phase);
- phase.invoke(msgctx);
- }
- }
- } catch (Exception e) {
- log.info("Execution Chain failed with the " + e.getMessage());
- while (!executionStack.isEmpty()) {
- Phase phase = (Phase) executionStack.pop();
- phase.revoke(msgctx);
- log.info("revoke the Phase " + phase.getPhaseName());
- }
- throw AxisFault.makeFault(e);
- }
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.engine;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Stack;
+
+/**
+ * <p> This is the ordered Collection of Phases as specified by the Server.xml file.
+ * this has the execution logic as well. If something goes wrong inside the
+ * Execution Chain then the exeution chain itself revoke them.
+ * </p>
+ */
+public class ExecutionChain {
+ /**
+ * Field phases
+ */
+ private final HashMap phases;
+
+ /**
+ * Field executionList
+ */
+ private final ArrayList executionList;
+
+ /**
+ * Field log
+ */
+ private Log log = LogFactory.getLog(getClass());
+
+ /**
+ * Constructor ExecutionChain
+ */
+ public ExecutionChain() {
+ phases = new HashMap();
+ executionList = new ArrayList();
+ }
+
+ /**
+ * Method addPhase
+ *
+ * @param phase
+ */
+ public void addPhase(Phase phase) {
+ log.info("Phase " + phase.getPhaseName() + "Added ");
+ phases.put(phase.getPhaseName(), phase);
+ executionList.add(phase);
+ }
+
+ /**
+ * Method addPhases
+ *
+ * @param phases
+ */
+ public void addPhases(ArrayList phases) {
+ if ((phases != null) && !phases.isEmpty()) {
+ for (int i = 0; i < phases.size(); i++) {
+ addPhase((Phase) phases.get(i));
+ }
+ }
+ }
+
+ /**
+ * Method getPhase
+ *
+ * @param name
+ * @return
+ */
+ public Phase getPhase(QName name) {
+ return (Phase) phases.get(name);
+ }
+
+ /**
+ * Method invoke
+ *
+ * @param msgctx
+ * @throws AxisFault
+ */
+ public void invoke(MessageContext msgctx) throws AxisFault {
+ Stack executionStack = new Stack();
+ try {
+ for (int i = 0; i < executionList.size(); i++) {
+ Phase phase = (Phase) executionList.get(i);
+ if (phase != null) {
+ log.info("Invoke the Phase " + phase.getPhaseName());
+ executionStack.push(phase);
+ phase.invoke(msgctx);
+ }
+ }
+ } catch (Exception e) {
+ log.info("Execution Chain failed with the " + e.getMessage());
+ while (!executionStack.isEmpty()) {
+ Phase phase = (Phase) executionStack.pop();
+ phase.revoke(msgctx);
+ log.info("revoke the Phase " + phase.getPhaseName());
+ }
+ throw AxisFault.makeFault(e);
+ }
+ }
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Handler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Handler.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Handler.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Handler.java Sun Feb 20 09:56:49 2005
@@ -1,12 +1,12 @@
/*
* 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.
@@ -22,7 +22,15 @@
import javax.xml.namespace.QName;
import java.io.Serializable;
+/**
+ * Interface Handler
+ */
public interface Handler extends Serializable {
+ /**
+ * Method init
+ *
+ * @param handlerdesc
+ */
public void init(HandlerMetadata handlerdesc);
/**
@@ -48,9 +56,25 @@
*/
public void revoke(MessageContext msgContext);
+ /**
+ * Method getName
+ *
+ * @return
+ */
public QName getName();
+ /**
+ * Method getParameter
+ *
+ * @param name
+ * @return
+ */
public Parameter getParameter(String name);
+ /**
+ * Method cleanup
+ *
+ * @throws AxisFault
+ */
public void cleanup() throws AxisFault;
}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Phase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Phase.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Phase.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Phase.java Sun Feb 20 09:56:49 2005
@@ -1,115 +1,164 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.engine;
-
-import org.apache.axis.context.MessageContext;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.handlers.AbstractHandler;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.Stack;
-
-/**
- * <p>This is Phase, a orderd collection of Handlers.
- * seems this is Handler Chain with order.</p>
- * Should this exttends Hanlders?
- */
-public class Phase extends AbstractHandler implements Handler {
- public static final String DISPATCH_PHASE = "DispatchPhase";
- public static final String SERVICE_INVOCATION = "ServiceInvocationPhase";
- public static final String SENDING_PHASE = "SendPhase";
- public static final QName NAME = new QName("http://axis.ws.apache.org", "Phase");
-
- private String phaseName;
- private ArrayList handlers;
- private Log log = LogFactory.getLog(getClass());
-
- public Phase(String phaseName) {
- handlers = new ArrayList();
- this.phaseName = phaseName;
- init(new HandlerMetadata(NAME));
- }
-
- public void addHandler(Handler handler, int index) {
- log.info("Handler " + handler.getName() + "Added to place " + 1 + " At the Phase " + phaseName);
- handlers.add(index, handler);
- }
-
- /**
- * add to next empty handler
- *
- * @param handler
- */
- public void addHandler(Handler handler) {
- log.info("Handler " + handler.getName() + " Added to the Phase " + phaseName);
- handlers.add(handler);
- }
-
- /**
- * If need to see how this works look at the stack!
- *
- * @param msgctx
- * @throws AxisFault
- */
- public void invoke(MessageContext msgctx) throws AxisFault {
- Stack executionStack = new Stack();
- try {
- for (int i = 0; i < handlers.size(); i++) {
- Handler handler = (Handler) handlers.get(i);
- if (handler != null) {
- log.info("Invoke the Handler " + handler.getName() + "with in the Phase " + phaseName);
- executionStack.push(handler);
- handler.invoke(msgctx);
- }
- }
- } catch (Exception e) {
- log.info("Phase " + phaseName + " failed with the " + e.getMessage());
- while (!executionStack.isEmpty()) {
- Handler handler = (Handler) executionStack.pop();
- log.info("revoke the Handler " + handler.getName() + " with in the Phase " + phaseName);
- handler.revoke(msgctx);
- }
- throw AxisFault.makeFault(e);
- }
- }
-
- public void revoke(MessageContext msgctx) {
- for (int i = handlers.size() - 1; i > -1; i--) {
- Handler handler = (Handler) handlers.get(i);
- log.info("revoke the Handler " + handler.getName() + " with in the Phase " + phaseName);
- if (handler != null) {
- handler.revoke(msgctx);
- }
- }
- }
-
- /**
- * @return Returns the name.
- */
- public String getPhaseName() {
- return phaseName;
- }
-
- /**
- * @param phaseName The name to set.
- */
- public void setName(String phaseName) {
- this.phaseName = phaseName;
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.engine;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.handlers.AbstractHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Stack;
+
+/**
+ * <p>This is Phase, a orderd collection of Handlers.
+ * seems this is Handler Chain with order.</p>
+ * Should this exttends Hanlders?
+ */
+public class Phase extends AbstractHandler implements Handler {
+ /**
+ * Field DISPATCH_PHASE
+ */
+ public static final String DISPATCH_PHASE = "DispatchPhase";
+
+ /**
+ * Field SERVICE_INVOCATION
+ */
+ public static final String SERVICE_INVOCATION = "ServiceInvocationPhase";
+
+ /**
+ * Field SENDING_PHASE
+ */
+ public static final String SENDING_PHASE = "SendPhase";
+
+ /**
+ * Field NAME
+ */
+ public static final QName NAME = new QName("http://axis.ws.apache.org",
+ "Phase");
+
+ /**
+ * Field phaseName
+ */
+ private String phaseName;
+
+ /**
+ * Field handlers
+ */
+ private ArrayList handlers;
+
+ /**
+ * Field log
+ */
+ private Log log = LogFactory.getLog(getClass());
+
+ /**
+ * Constructor Phase
+ *
+ * @param phaseName
+ */
+ public Phase(String phaseName) {
+ handlers = new ArrayList();
+ this.phaseName = phaseName;
+ init(new HandlerMetadata(NAME));
+ }
+
+ /**
+ * Method addHandler
+ *
+ * @param handler
+ * @param index
+ */
+ public void addHandler(Handler handler, int index) {
+ log.info("Handler " + handler.getName() + "Added to place " + 1
+ + " At the Phase " + phaseName);
+ handlers.add(index, handler);
+ }
+
+ /**
+ * add to next empty handler
+ *
+ * @param handler
+ */
+ public void addHandler(Handler handler) {
+ log.info("Handler " + handler.getName() + " Added to the Phase "
+ + phaseName);
+ handlers.add(handler);
+ }
+
+ /**
+ * If need to see how this works look at the stack!
+ *
+ * @param msgctx
+ * @throws AxisFault
+ */
+ public void invoke(MessageContext msgctx) throws AxisFault {
+ Stack executionStack = new Stack();
+ try {
+ for (int i = 0; i < handlers.size(); i++) {
+ Handler handler = (Handler) handlers.get(i);
+ if (handler != null) {
+ log.info("Invoke the Handler " + handler.getName()
+ + "with in the Phase " + phaseName);
+ executionStack.push(handler);
+ handler.invoke(msgctx);
+ }
+ }
+ } catch (Exception e) {
+ log.info("Phase " + phaseName + " failed with the "
+ + e.getMessage());
+ while (!executionStack.isEmpty()) {
+ Handler handler = (Handler) executionStack.pop();
+ log.info("revoke the Handler " + handler.getName()
+ + " with in the Phase " + phaseName);
+ handler.revoke(msgctx);
+ }
+ throw AxisFault.makeFault(e);
+ }
+ }
+
+ /**
+ * Method revoke
+ *
+ * @param msgctx
+ */
+ public void revoke(MessageContext msgctx) {
+ for (int i = handlers.size() - 1; i > -1; i--) {
+ Handler handler = (Handler) handlers.get(i);
+ log.info("revoke the Handler " + handler.getName()
+ + " with in the Phase " + phaseName);
+ if (handler != null) {
+ handler.revoke(msgctx);
+ }
+ }
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getPhaseName() {
+ return phaseName;
+ }
+
+ /**
+ * @param phaseName The name to set.
+ */
+ public void setName(String phaseName) {
+ this.phaseName = phaseName;
+ }
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Provider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Provider.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Provider.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Provider.java Sun Feb 20 09:56:49 2005
@@ -1,29 +1,35 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.engine;
-
-import org.apache.axis.context.MessageContext;
-
-import java.io.Serializable;
-
-/**
- * This Provider is the workhorse who locate the implementation of the Web Service and
- * invoke the Web Service.
- */
-public interface Provider extends Serializable {
- public MessageContext invoke(MessageContext msgCtx) throws AxisFault;
-
-}
\ No newline at end of file
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.engine;
+
+import org.apache.axis.context.MessageContext;
+
+import java.io.Serializable;
+
+/**
+ * This Provider is the workhorse who locate the implementation of the Web Service and
+ * invoke the Web Service.
+ */
+public interface Provider extends Serializable {
+ /**
+ * Method invoke
+ *
+ * @param msgCtx
+ * @return
+ * @throws AxisFault
+ */
+ public MessageContext invoke(MessageContext msgCtx) throws AxisFault;
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Receiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Receiver.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Receiver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Receiver.java Sun Feb 20 09:56:49 2005
@@ -1,12 +1,12 @@
/*
* 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.
@@ -15,5 +15,8 @@
*/
package org.apache.axis.engine;
+/**
+ * Interface Receiver
+ */
public interface Receiver extends Handler {
}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ReceiverLocator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ReceiverLocator.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ReceiverLocator.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/ReceiverLocator.java Sun Feb 20 09:56:49 2005
@@ -1,12 +1,12 @@
/*
* 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.
@@ -18,12 +18,24 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.receivers.InOutSyncReceiver;
+/**
+ * Class ReceiverLocator
+ */
public class ReceiverLocator {
- public static Receiver locateReceiver(MessageContext msgCtx) throws AxisFault {
- //TODO
- //File wsdlFile = msgCtx.getService().getParameter("wsdlFile");
- //parse the WSDL find the patterns
- //create a receiver
+ /**
+ * Method locateReceiver
+ *
+ * @param msgCtx
+ * @return
+ * @throws AxisFault
+ */
+ public static Receiver locateReceiver(MessageContext msgCtx)
+ throws AxisFault {
+
+ // TODO
+ // File wsdlFile = msgCtx.getService().getParameter("wsdlFile");
+ // parse the WSDL find the patterns
+ // create a receiver
return new InOutSyncReceiver();
}
}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Sender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Sender.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Sender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Sender.java Sun Feb 20 09:56:49 2005
@@ -1,25 +1,35 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.engine;
-
-import org.apache.axis.context.MessageContext;
-
-public class Sender {
- public void send(MessageContext msgCtx) throws AxisFault {
- AxisEngine engine = new AxisEngine(msgCtx.getGlobalContext().getRegistry());
- engine.send(msgCtx);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.engine;
+
+import org.apache.axis.context.MessageContext;
+
+/**
+ * Class Sender
+ */
+public class Sender {
+ /**
+ * Method send
+ *
+ * @param msgCtx
+ * @throws AxisFault
+ */
+ public void send(MessageContext msgCtx) throws AxisFault {
+ AxisEngine engine =
+ new AxisEngine(msgCtx.getGlobalContext().getRegistry());
+ engine.send(msgCtx);
+ }
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/AbstractHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/AbstractHandler.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/AbstractHandler.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/AbstractHandler.java Sun Feb 20 09:56:49 2005
@@ -1,51 +1,91 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.handlers;
-
-import org.apache.axis.context.MessageContext;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.description.Parameter;
-import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.Handler;
-
-import javax.xml.namespace.QName;
-
-public abstract class AbstractHandler implements Handler {
- private static HandlerMetadata EMPTY_HANDLER_METADATA = new HandlerMetadata();
- protected HandlerMetadata handlerDesc;
-
- public AbstractHandler() {
- handlerDesc = EMPTY_HANDLER_METADATA;
- }
-
- public QName getName() {
- return handlerDesc.getName();
- }
-
- public void revoke(MessageContext msgContext) {
- }
-
- public void cleanup() throws AxisFault {
- }
-
- public Parameter getParameter(String name) {
- return handlerDesc.getParameter(name);
- }
-
- public void init(HandlerMetadata handlerdesc) {
- this.handlerDesc = handlerdesc;
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.handlers;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.Parameter;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.Handler;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Class AbstractHandler
+ */
+public abstract class AbstractHandler implements Handler {
+ /**
+ * Field EMPTY_HANDLER_METADATA
+ */
+ private static HandlerMetadata EMPTY_HANDLER_METADATA =
+ new HandlerMetadata();
+
+ /**
+ * Field handlerDesc
+ */
+ protected HandlerMetadata handlerDesc;
+
+ /**
+ * Constructor AbstractHandler
+ */
+ public AbstractHandler() {
+ handlerDesc = EMPTY_HANDLER_METADATA;
+ }
+
+ /**
+ * Method getName
+ *
+ * @return
+ */
+ public QName getName() {
+ return handlerDesc.getName();
+ }
+
+ /**
+ * Method revoke
+ *
+ * @param msgContext
+ */
+ public void revoke(MessageContext msgContext) {
+ }
+
+ /**
+ * Method cleanup
+ *
+ * @throws AxisFault
+ */
+ public void cleanup() throws AxisFault {
+ }
+
+ /**
+ * Method getParameter
+ *
+ * @param name
+ * @return
+ */
+ public Parameter getParameter(String name) {
+ return handlerDesc.getParameter(name);
+ }
+
+ /**
+ * Method init
+ *
+ * @param handlerdesc
+ */
+ public void init(HandlerMetadata handlerdesc) {
+ this.handlerDesc = handlerdesc;
+ }
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/OpNameFinder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/OpNameFinder.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/OpNameFinder.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/handlers/OpNameFinder.java Sun Feb 20 09:56:49 2005
@@ -1,59 +1,71 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis.handlers;
-
-import org.apache.axis.context.MessageContext;
-import org.apache.axis.description.AxisOperation;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.engine.AxisFault;
-import org.apache.axis.om.OMElement;
-import org.apache.axis.om.SOAPBody;
-import org.apache.axis.om.SOAPEnvelope;
-import org.apache.wsdl.WSDLService;
-
-import javax.xml.namespace.QName;
-
-public class OpNameFinder extends AbstractHandler {
- public static final QName NAME =
- new QName("http://axis.ws.apache.org", "OpNameFinder");
-
- public OpNameFinder() {
- init(new HandlerMetadata(NAME));
- }
-
- public void invoke(MessageContext msgContext) throws AxisFault {
- String style = msgContext.getMessageStyle();
- if (style.equals(WSDLService.STYLE_RPC)) {
- SOAPEnvelope envelope = msgContext.getEnvelope();
- SOAPBody body = envelope.getBody();
- OMElement bodyChild = body.getFirstElement();
- msgContext.setSoapOperationElement(bodyChild);
- QName opName =
- new QName(
- bodyChild.getNamespaceName(),
- bodyChild.getLocalName());
- AxisService service = msgContext.getService();
- AxisOperation op = service.getOperation(opName);
- if (op != null) {
- msgContext.setOperation(op);
- } else {
- throw new AxisFault(opName + " operation not found");
- }
-
- }
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.handlers;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.SOAPBody;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.wsdl.WSDLService;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Class OpNameFinder
+ */
+public class OpNameFinder extends AbstractHandler {
+ /**
+ * Field NAME
+ */
+ public static final QName NAME = new QName("http://axis.ws.apache.org",
+ "OpNameFinder");
+
+ /**
+ * Constructor OpNameFinder
+ */
+ public OpNameFinder() {
+ init(new HandlerMetadata(NAME));
+ }
+
+ /**
+ * Method invoke
+ *
+ * @param msgContext
+ * @throws AxisFault
+ */
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ String style = msgContext.getMessageStyle();
+ if (style.equals(WSDLService.STYLE_RPC)) {
+ SOAPEnvelope envelope = msgContext.getEnvelope();
+ SOAPBody body = envelope.getBody();
+ OMElement bodyChild = body.getFirstElement();
+ msgContext.setSoapOperationElement(bodyChild);
+ QName opName = new QName(bodyChild.getNamespaceName(),
+ bodyChild.getLocalName());
+ AxisService service = msgContext.getService();
+ AxisOperation op = service.getOperation(opName);
+ if (op != null) {
+ msgContext.setOperation(op);
+ } else {
+ throw new AxisFault(opName + " operation not found");
+ }
+ }
+ }
+}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseException.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseException.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseException.java Sun Feb 20 09:56:49 2005
@@ -1,12 +1,12 @@
/*
* 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.
@@ -15,18 +15,40 @@
*/
package org.apache.axis.phaseresolver;
+/**
+ * Class PhaseException
+ */
public class PhaseException extends Exception {
+ /**
+ * Constructor PhaseException
+ */
public PhaseException() {
}
+ /**
+ * Constructor PhaseException
+ *
+ * @param message
+ */
public PhaseException(String message) {
super(message);
}
+ /**
+ * Constructor PhaseException
+ *
+ * @param message
+ * @param cause
+ */
public PhaseException(String message, Throwable cause) {
super(message, cause);
}
+ /**
+ * Constructor PhaseException
+ *
+ * @param cause
+ */
public PhaseException(Throwable cause) {
super(cause);
}
Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java?view=diff&r1=154536&r2=154537
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java Sun Feb 20 09:56:49 2005
@@ -1,12 +1,12 @@
/*
* 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.
@@ -32,31 +32,59 @@
* This class hold all the phases found in the service.xml and server.xml
*/
public class PhaseHolder {
+ /**
+ * Field log
+ */
private Log log = LogFactory.getLog(getClass());
+
+ /**
+ * Field phaseholder
+ */
private ArrayList phaseholder = new ArrayList();
/**
* Referance to ServerMetaData inorder to get information about phases.
*/
- private final EngineRegistry registry;// = new ServerMetaData();
+ private final EngineRegistry registry; // = new ServerMetaData();
+
+ /**
+ * Field service
+ */
private final AxisService service;
+ /**
+ * Constructor PhaseHolder
+ *
+ * @param registry
+ * @param serviceIN
+ */
public PhaseHolder(EngineRegistry registry, AxisService serviceIN) {
this.registry = registry;
this.service = serviceIN;
}
+ /**
+ * Method isPhaseExist
+ *
+ * @param phaseName
+ * @return
+ */
private boolean isPhaseExist(String phaseName) {
for (int i = 0; i < phaseholder.size(); i++) {
PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
if (phase.getName().equals(phaseName)) {
return true;
}
-
}
return false;
}
+ /**
+ * Method isPhaseExistinER
+ *
+ * @param phaseName
+ * @return
+ */
private boolean isPhaseExistinER(String phaseName) {
ArrayList pahselist = registry.getPhases();
for (int i = 0; i < pahselist.size(); i++) {
@@ -68,6 +96,12 @@
return false;
}
+ /**
+ * Method addHandler
+ *
+ * @param handler
+ * @throws PhaseException
+ */
public void addHandler(HandlerMetadata handler) throws PhaseException {
String phaseName = handler.getRules().getPhaseName();
if (isPhaseExist(phaseName)) {
@@ -78,46 +112,67 @@
addPhase(newpPhase);
newpPhase.addHandler(handler);
} else {
- throw new PhaseException("Invalid Phase ," + phaseName + "for the handler " + handler.getName() + " dose not exit in server.xml");
+ throw new PhaseException("Invalid Phase ," + phaseName
+ + "for the handler "
+ + handler.getName()
+ + " dose not exit in server.xml");
}
-
}
}
+ /**
+ * Method addPhase
+ *
+ * @param phase
+ */
private void addPhase(PhaseMetadata phase) {
phaseholder.add(phase);
}
+ /**
+ * Method getPhase
+ *
+ * @param phaseName
+ * @return
+ */
private PhaseMetadata getPhase(String phaseName) {
for (int i = 0; i < phaseholder.size(); i++) {
PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
if (phase.getName().equals(phaseName)) {
return phase;
}
-
}
return null;
}
- private void OrderdPhases() {
- //todo complet this using phaseordeer
+ /**
+ * Method OrderThePhases
+ */
+ private void OrderThePhases() {
+ // todo complete this using phaseorder
PhaseMetadata[] phase = new PhaseMetadata[phaseholder.size()];
for (int i = 0; i < phaseholder.size(); i++) {
PhaseMetadata tempphase = (PhaseMetadata) phaseholder.get(i);
phase[i] = tempphase;
}
phase = getOrderPhases(phase);
+
// remove all items inorder to rearrange them
phaseholder.clear();
for (int i = 0; i < phase.length; i++) {
PhaseMetadata phaseMetaData = phase[i];
phaseholder.add(phaseMetaData);
-
}
}
+ /**
+ * Method getOrderPhases
+ *
+ * @param phasesmetadats
+ * @return
+ */
private PhaseMetadata[] getOrderPhases(PhaseMetadata[] phasesmetadats) {
- PhaseMetadata[] temppahse = new PhaseMetadata[phasesmetadats.length];
+ PhaseMetadata[] tempphase = new PhaseMetadata[phasesmetadats.length];
int count = 0;
ArrayList pahselist = registry.getPhases();
for (int i = 0; i < pahselist.size(); i++) {
@@ -125,18 +180,16 @@
for (int j = 0; j < phasesmetadats.length; j++) {
PhaseMetadata tempmetadata = phasesmetadats[j];
if (tempmetadata.getName().equals(phasemetadata)) {
- temppahse[count] = tempmetadata;
+ tempphase[count] = tempmetadata;
count++;
}
}
-
-
}
- return temppahse;
+ return tempphase;
}
/**
- * cahinType
+ * chainType
* 1 : inFlowExcChain
* 2 : OutFlowExeChain
* 3 : FaultFlowExcechain
@@ -144,18 +197,20 @@
* @param chainType
* @throws org.apache.axis.phaseresolver.PhaseException
*
+ * @throws PhaseException
*/
- public void getOrderdHandlers(int chainType) throws PhaseException {
+ public void getOrderedHandlers(int chainType) throws PhaseException {
try {
- OrderdPhases();
- // Vector tempHander = new Vector();
+ OrderThePhases();
+
HandlerMetadata[] handlers;
switch (chainType) {
case 1:
{
- ArrayList inChain = new ArrayList();// service.getExecutableInChain();
+ ArrayList inChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
@@ -168,9 +223,10 @@
}
case 2:
{
- ArrayList outChain = new ArrayList();// service.getExecutableOutChain();
+ ArrayList outChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
@@ -183,9 +239,10 @@
}
case 3:
{
- ArrayList faultChain = new ArrayList();//service.getExecutableFaultChain();
+ ArrayList faultChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
@@ -202,25 +259,37 @@
}
}
- public void buildTransportChain(AxisTransport trnsport, int chainType) throws PhaseException {
+ /**
+ * Method buildTransportChain
+ *
+ * @param trnsport
+ * @param chainType
+ * @throws PhaseException
+ */
+ public void buildTransportChain(AxisTransport trnsport, int chainType)
+ throws PhaseException {
try {
- OrderdPhases();
- // Vector tempHander = new Vector();
+ OrderThePhases();
+
HandlerMetadata[] handlers;
Class handlerClass = null;
Handler handler;
switch (chainType) {
case 1:
{
- ArrayList inChain = new ArrayList();// service.getExecutableInChain();
+ ArrayList inChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
try {
- handlerClass = Class.forName(handlers[j].getClassName(), true, Thread.currentThread().getContextClassLoader());//getHandlerClass(handlermd.getClassName(), loader1);
- handler = (Handler) handlerClass.newInstance();
+ handlerClass = Class.forName(
+ handlers[j].getClassName(), true,
+ Thread.currentThread().getContextClassLoader());
+ handler =
+ (Handler) handlerClass.newInstance();
handler.init(handlers[j]);
handlers[j].setHandler(handler);
axisPhase.addHandler(handlers[j].getHandler());
@@ -239,15 +308,19 @@
}
case 2:
{
- ArrayList outChain = new ArrayList();// service.getExecutableOutChain();
+ ArrayList outChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
try {
- handlerClass = Class.forName(handlers[j].getClassName(), true, Thread.currentThread().getContextClassLoader());//getHandlerClass(handlermd.getClassName(), loader1);
- handler = (Handler) handlerClass.newInstance();
+ handlerClass = Class.forName(
+ handlers[j].getClassName(), true,
+ Thread.currentThread().getContextClassLoader());
+ handler =
+ (Handler) handlerClass.newInstance();
handler.init(handlers[j]);
handlers[j].setHandler(handler);
axisPhase.addHandler(handlers[j].getHandler());
@@ -266,15 +339,19 @@
}
case 3:
{
- ArrayList faultChain = new ArrayList();//service.getExecutableFaultChain();
+ ArrayList faultChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
try {
- handlerClass = Class.forName(handlers[j].getClassName(), true, Thread.currentThread().getContextClassLoader());//getHandlerClass(handlermd.getClassName(), loader1);
- handler = (Handler) handlerClass.newInstance();
+ handlerClass = Class.forName(
+ handlers[j].getClassName(), true,
+ Thread.currentThread().getContextClassLoader());
+ handler =
+ (Handler) handlerClass.newInstance();
handler.init(handlers[j]);
handlers[j].setHandler(handler);
axisPhase.addHandler(handlers[j].getHandler());
@@ -297,17 +374,25 @@
}
}
- public void buildGlobalChain(AxisGlobal axisGlobal, int chainType) throws PhaseException {
+ /**
+ * Method buildGlobalChain
+ *
+ * @param axisGlobal
+ * @param chainType
+ * @throws PhaseException
+ */
+ public void buildGlobalChain(AxisGlobal axisGlobal, int chainType)
+ throws PhaseException {
try {
- OrderdPhases();
- // Vector tempHander = new Vector();
+ OrderThePhases();
HandlerMetadata[] handlers;
switch (chainType) {
case 1:
{
- ArrayList inChain = new ArrayList();// service.getExecutableInChain();
+ ArrayList inChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
@@ -320,9 +405,10 @@
}
case 2:
{
- ArrayList outChain = new ArrayList();// service.getExecutableOutChain();
+ ArrayList outChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
@@ -335,9 +421,10 @@
}
case 3:
{
- ArrayList faultChain = new ArrayList();//service.getExecutableFaultChain();
+ ArrayList faultChain = new ArrayList();
for (int i = 0; i < phaseholder.size(); i++) {
- PhaseMetadata phase = (PhaseMetadata) phaseholder.get(i);
+ PhaseMetadata phase =
+ (PhaseMetadata) phaseholder.get(i);
Phase axisPhase = new Phase(phase.getName());
handlers = phase.getOrderedHandlers();
for (int j = 0; j < handlers.length; j++) {
@@ -353,6 +440,4 @@
throw new PhaseException(e);
}
}
-
-
}