You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/12/16 18:18:08 UTC
svn commit: r357187 [10/25] - in
/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: ./
addressing/ client/ client/async/ context/ deployment/ deployment/listener/
deployment/repository/util/ deployment/scheduler/ deployment/util/
descript...
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java Fri Dec 16 09:13:57 2005
@@ -1,24 +1,25 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.om.OMElement;
import org.apache.axis2.engine.Handler;
+import org.apache.axis2.om.OMElement;
import javax.xml.namespace.QName;
import java.util.ArrayList;
@@ -27,32 +28,32 @@
* represent the deployment information about the handler
*/
public class HandlerDescription implements ParameterInclude {
+
/**
- * Field parameterInclude
+ * Field className
*/
- private final ParameterInclude parameterInclude;
+ private String className;
/**
- * Field name
+ * Field handler
*/
- private QName name;
+ private Handler handler;
/**
- * Field rules
+ * Field name
*/
- private PhaseRule rules;
+ private QName name;
/**
- * Field handler
+ * Field parameterInclude
*/
- private Handler handler;
+ private final ParameterInclude parameterInclude;
+ private ParameterInclude parent;
/**
- * Field className
+ * Field rules
*/
- private String className;
-
- private ParameterInclude parent;
+ private PhaseRule rules;
/**
* Constructor HandlerDescription
@@ -73,46 +74,41 @@
}
/**
- * @return
+ * @param param
*/
- public QName getName() {
- return name;
+ public void addParameter(Parameter param) throws AxisFault {
+ if (isParameterLocked(param.getName())) {
+ throw new AxisFault("Parmter is locked can not overide: " + param.getName());
+ } else {
+ parameterInclude.addParameter(param);
+ }
}
- /**
- * Method getRules
- *
- * @return
- */
- public PhaseRule getRules() {
- return rules;
+ public void deserializeParameters(OMElement parameterElement) throws AxisFault {
+ this.parameterInclude.deserializeParameters(parameterElement);
}
/**
- * Method setRules
+ * Method getClassName
*
- * @param rules
+ * @return
*/
- public void setRules(PhaseRule rules) {
- this.rules = rules;
+ public String getClassName() {
+ return className;
}
/**
- * @param name
+ * @return
*/
- public void setName(QName name) {
- this.name = name;
+ public Handler getHandler() {
+ return handler;
}
/**
- * @param param
+ * @return
*/
- public void addParameter(Parameter param) throws AxisFault{
- if(isParameterLocked(param.getName())){
- throw new AxisFault("Parmter is locked can not overide: " + param.getName());
- } else{
- parameterInclude.addParameter(param);
- }
+ public QName getName() {
+ return name;
}
/**
@@ -127,25 +123,37 @@
return parameterInclude.getParameters();
}
- //to check whether the parameter is locked at any levle
+ public ParameterInclude getParent() {
+ return parent;
+ }
+
+ /**
+ * Method getRules
+ *
+ * @return
+ */
+ public PhaseRule getRules() {
+ return rules;
+ }
+
+ // to check whether the parameter is locked at any levle
public boolean isParameterLocked(String parameterName) {
- if(parent != null){
- if(parent.isParameterLocked(parameterName)){
+ if (parent != null) {
+ if (parent.isParameterLocked(parameterName)) {
return true;
}
}
- return parameterInclude.isParameterLocked(parameterName);
- }
- public void deserializeParameters(OMElement parameterElement) throws AxisFault {
- this.parameterInclude.deserializeParameters(parameterElement);
+ return parameterInclude.isParameterLocked(parameterName);
}
/**
- * @return
+ * Method setClassName
+ *
+ * @param className
*/
- public Handler getHandler() {
- return handler;
+ public void setClassName(String className) {
+ this.className = className;
}
/**
@@ -156,28 +164,22 @@
}
/**
- * Method getClassName
- *
- * @return
+ * @param name
*/
- public String getClassName() {
- return className;
+ public void setName(QName name) {
+ this.name = name;
+ }
+
+ public void setParent(ParameterInclude parent) {
+ this.parent = parent;
}
/**
- * Method setClassName
+ * Method setRules
*
- * @param className
+ * @param rules
*/
- public void setClassName(String className) {
- this.className = className;
- }
-
- public ParameterInclude getParent() {
- return parent;
- }
-
- public void setParent(ParameterInclude parent) {
- this.parent = parent;
+ public void setRules(PhaseRule rules) {
+ this.rules = rules;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java Fri Dec 16 09:13:57 2005
@@ -7,23 +7,6 @@
import javax.xml.namespace.QName;
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
@@ -31,21 +14,13 @@
* Time: 2:06:31 PM
*/
public class InOnlyAxisOperation extends AxisOperation {
-
- private AxisMessage inMessage;
private AxisMessage inFaultMessage;
+ private AxisMessage inMessage;
private AxisMessage outFaultMessage;
- //this is just to stor the chain , there wont be any usage of this
+ // this is just to stor the chain , there wont be any usage of this
private ArrayList outPhase;
- private void createMessage() {
- inMessage = new AxisMessage();
- inFaultMessage = new AxisMessage();
- outFaultMessage = new AxisMessage();
- outPhase = new ArrayList();
- }
-
public InOnlyAxisOperation() {
super();
createMessage();
@@ -56,6 +31,39 @@
createMessage();
}
+ public void addMessage(AxisMessage message, String label) {
+ if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
+ inMessage = message;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+
+ public void addMessageContext(MessageContext msgContext, OperationContext opContext)
+ throws AxisFault {
+ if (!opContext.isComplete()) {
+ opContext.getMessageContexts().put(MESSAGE_LABEL_IN_VALUE, msgContext);
+ opContext.setComplete(true);
+ } else {
+ throw new AxisFault("Invalid messge addition , operation context completed");
+ }
+ }
+
+ private void createMessage() {
+ inMessage = new AxisMessage();
+ inFaultMessage = new AxisMessage();
+ outFaultMessage = new AxisMessage();
+ outPhase = new ArrayList();
+ }
+
+ public AxisMessage getMessage(String label) {
+ if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
+ return inMessage;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+
public ArrayList getPhasesInFaultFlow() {
return inFaultMessage.getMessageFlow();
}
@@ -72,14 +80,6 @@
return inMessage.getMessageFlow();
}
- public AxisMessage getMessage(String label) {
- if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
- return inMessage;
- } else {
- throw new UnsupportedOperationException("Not yet implemented");
- }
- }
-
public void setPhasesInFaultFlow(ArrayList list) {
inFaultMessage.setMessageFlow(list);
}
@@ -95,22 +95,4 @@
public void setRemainingPhasesInFlow(ArrayList list) {
inMessage.setMessageFlow(list);
}
-
- public void addMessage(AxisMessage message, String label) {
- if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
- inMessage = message;
- } else {
- throw new UnsupportedOperationException("Not yet implemented");
- }
- }
-
- public void addMessageContext(MessageContext msgContext, OperationContext opContext)
- throws AxisFault {
- if (!opContext.isComplete()) {
- opContext.getMessageContexts().put(MESSAGE_LABEL_IN_VALUE, msgContext);
- opContext.setComplete(true);
- } else {
- throw new AxisFault("Invalid messge addition , operation context completed");
- }
- }
-}
\ No newline at end of file
+}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java Fri Dec 16 09:13:57 2005
@@ -8,23 +8,6 @@
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.HashMap;
-/*
-* 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
@@ -32,21 +15,11 @@
* Time: 2:07:15 PM
*/
public class InOutAxisOperation extends AxisOperation {
-
-
- private AxisMessage inMessage;
private AxisMessage inFaultMessage;
+ private AxisMessage inMessage;
private AxisMessage outFaultMessage;
private AxisMessage outMessage;
- private void createMessages() {
- inMessage = new AxisMessage();
- inFaultMessage = new AxisMessage();
- outFaultMessage = new AxisMessage();
- outMessage = new AxisMessage();
- }
-
-
public InOutAxisOperation() {
super();
createMessages();
@@ -57,20 +30,39 @@
createMessages();
}
- public ArrayList getPhasesInFaultFlow() {
- return inFaultMessage.getMessageFlow();
+ public void addMessage(AxisMessage message, String label) {
+ if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+ outMessage = message;
+ } else if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
+ inMessage = message;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
}
- public ArrayList getPhasesOutFaultFlow() {
- return outFaultMessage.getMessageFlow();
- }
+ public void addMessageContext(MessageContext msgContext, OperationContext opContext)
+ throws AxisFault {
+ HashMap mep = opContext.getMessageContexts();
+ MessageContext immsgContext = (MessageContext) mep.get(MESSAGE_LABEL_IN_VALUE);
+ MessageContext outmsgContext = (MessageContext) mep.get(MESSAGE_LABEL_OUT_VALUE);
- public ArrayList getPhasesOutFlow() {
- return outMessage.getMessageFlow();
+ if ((immsgContext != null) && (outmsgContext != null)) {
+ throw new AxisFault("Invalid messge addition , operation context completed");
+ }
+
+ if (immsgContext == null) {
+ mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
+ } else {
+ mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
+ opContext.setComplete(true);
+ }
}
- public ArrayList getRemainingPhasesInFlow() {
- return inMessage.getMessageFlow();
+ private void createMessages() {
+ inMessage = new AxisMessage();
+ inFaultMessage = new AxisMessage();
+ outFaultMessage = new AxisMessage();
+ outMessage = new AxisMessage();
}
public AxisMessage getMessage(String label) {
@@ -83,6 +75,22 @@
}
}
+ public ArrayList getPhasesInFaultFlow() {
+ return inFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFaultFlow() {
+ return outFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFlow() {
+ return outMessage.getMessageFlow();
+ }
+
+ public ArrayList getRemainingPhasesInFlow() {
+ return inMessage.getMessageFlow();
+ }
+
public void setPhasesInFaultFlow(ArrayList list) {
inFaultMessage.setMessageFlow(list);
}
@@ -98,29 +106,4 @@
public void setRemainingPhasesInFlow(ArrayList list) {
inMessage.setMessageFlow(list);
}
-
- public void addMessage(AxisMessage message, String label) {
- if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
- outMessage = message;
- } else if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
- inMessage = message;
- } else {
- throw new UnsupportedOperationException("Not yet implemented");
- }
- }
-
- public void addMessageContext(MessageContext msgContext, OperationContext opContext) throws AxisFault {
- HashMap mep = opContext.getMessageContexts();
- MessageContext immsgContext = (MessageContext) mep.get(MESSAGE_LABEL_IN_VALUE);
- MessageContext outmsgContext = (MessageContext) mep.get(MESSAGE_LABEL_OUT_VALUE);
- if (immsgContext != null && outmsgContext != null) {
- throw new AxisFault("Invalid messge addition , operation context completed");
- }
- if (immsgContext == null) {
- mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
- } else {
- mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
- opContext.setComplete(true);
- }
- }
-}
\ No newline at end of file
+}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
@@ -21,22 +22,21 @@
import javax.xml.namespace.QName;
import java.util.ArrayList;
+
/**
* This is to store deployment time data , described by
* <moduleConfig module="modulename">
- * <parameter> ....</parameter>
+ * <parameter> ....</parameter>
* </moduleConfig>
- *
+ * <p/>
* for the initilal stage this just keep set of parameters , but when the time
* bean will be store more
*/
-
-public class ModuleConfiguration implements ParameterInclude{
-
+public class ModuleConfiguration implements ParameterInclude {
private QName moduleName;
private ParameterInclude parameterinclude;
- //to keep the pointer to its parent , only to access parameters
+ // to keep the pointer to its parent , only to access parameters
private ParameterInclude parent;
public ModuleConfiguration(QName moduleName, ParameterInclude parent) {
@@ -45,18 +45,22 @@
parameterinclude = new ParameterIncludeImpl();
}
- public QName getModuleName() {
- return moduleName;
- }
-
public void addParameter(Parameter param) throws AxisFault {
- if(isParameterLocked(param.getName())){
+ if (isParameterLocked(param.getName())) {
throw new AxisFault("Parmter is locked can not overide: " + param.getName());
- } else{
+ } else {
parameterinclude.addParameter(param);
}
}
+ public void deserializeParameters(OMElement parameterElement) throws AxisFault {
+ this.parameterinclude.deserializeParameters(parameterElement);
+ }
+
+ public QName getModuleName() {
+ return moduleName;
+ }
+
public Parameter getParameter(String name) {
return parameterinclude.getParameter(name);
}
@@ -66,21 +70,20 @@
}
public boolean isParameterLocked(String parameterName) {
+
// checking the locked value of parent
- boolean loscked = false;
- if (parent !=null) {
+ boolean loscked = false;
+
+ if (parent != null) {
loscked = parent.isParameterLocked(parameterName);
}
- if(loscked){
+
+ if (loscked) {
return true;
} else {
Parameter parameter = getParameter(parameterName);
- return parameter != null && parameter.isLocked();
- }
- }
- public void deserializeParameters(OMElement parameterElement) throws AxisFault {
- this.parameterinclude.deserializeParameters(parameterElement);
+ return (parameter != null) && parameter.isLocked();
+ }
}
-
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java Fri Dec 16 09:13:57 2005
@@ -1,25 +1,26 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.om.OMElement;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.modules.Module;
+import org.apache.axis2.om.OMElement;
import javax.xml.namespace.QName;
import java.util.ArrayList;
@@ -36,28 +37,26 @@
*/
public class ModuleDescription implements FlowInclude, ParameterInclude {
- private Module module;
- /**
- * Field name
- */
- private QName name;
-
- private AxisConfiguration parent;
-
- private ClassLoader moduleClassLoader;
-
/**
* Field flowInclude
*/
private final FlowInclude flowInclude = new FlowIncludeImpl();
- //to store module operations , which are suppose to be added to a service if it is engaged to a service
- private HashMap operations;
-
/**
* Field parameters
*/
private final ParameterInclude parameters = new ParameterIncludeImpl();
+ private Module module;
+ private ClassLoader moduleClassLoader;
+
+ /**
+ * Field name
+ */
+ private QName name;
+
+ // to store module operations , which are suppose to be added to a service if it is engaged to a service
+ private HashMap operations;
+ private AxisConfiguration parent;
/**
* Constructor ModuleDescription
@@ -76,6 +75,25 @@
this.name = name;
}
+ public void addOperation(AxisOperation axisOperation) {
+ operations.put(axisOperation.getName(), axisOperation);
+ }
+
+ /**
+ * @param param
+ */
+ public void addParameter(Parameter param) throws AxisFault {
+ if (isParameterLocked(param.getName())) {
+ throw new AxisFault("Parmter is locked can not overide: " + param.getName());
+ } else {
+ parameters.addParameter(param);
+ }
+ }
+
+ public void deserializeParameters(OMElement parameterElement) throws AxisFault {
+ this.parameters.deserializeParameters(parameterElement);
+ }
+
/**
* @return
*/
@@ -97,47 +115,30 @@
/**
* @return
*/
- public Flow getOutFlow() {
- return flowInclude.getOutFlow();
- }
-
- /**
- * @param faultFlow
- */
- public void setFaultInFlow(Flow faultFlow) {
- flowInclude.setFaultInFlow(faultFlow);
+ public Module getModule() {
+ return module;
}
- /**
- * @param faultFlow
- */
- public void setFaultOutFlow(Flow faultFlow) {
- flowInclude.setFaultOutFlow(faultFlow);
+ public ClassLoader getModuleClassLoader() {
+ return moduleClassLoader;
}
/**
- * @param inFlow
+ * @return
*/
- public void setInFlow(Flow inFlow) {
- flowInclude.setInFlow(inFlow);
+ public QName getName() {
+ return name;
}
- /**
- * @param outFlow
- */
- public void setOutFlow(Flow outFlow) {
- flowInclude.setOutFlow(outFlow);
+ public HashMap getOperations() {
+ return operations;
}
/**
- * @param param
+ * @return
*/
- public void addParameter(Parameter param)throws AxisFault{
- if(isParameterLocked(param.getName())){
- throw new AxisFault("Parmter is locked can not overide: " + param.getName());
- } else{
- parameters.addParameter(param);
- }
+ public Flow getOutFlow() {
+ return flowInclude.getOutFlow();
}
/**
@@ -152,25 +153,52 @@
return parameters.getParameters();
}
+ public AxisConfiguration getParent() {
+ return parent;
+ }
+
+ // to check whether a given parameter is locked
+ public boolean isParameterLocked(String parameterName) {
+
+ // checking the locked value of parent
+ boolean loscked = false;
+
+ if (getParent() != null) {
+ loscked = getParent().isParameterLocked(parameterName);
+ }
+
+ if (loscked) {
+ return true;
+ } else {
+ Parameter parameter = getParameter(parameterName);
+
+ if ((parameter != null) && parameter.isLocked()) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
/**
- * @return
+ * @param faultFlow
*/
- public QName getName() {
- return name;
+ public void setFaultInFlow(Flow faultFlow) {
+ flowInclude.setFaultInFlow(faultFlow);
}
/**
- * @param name
+ * @param faultFlow
*/
- public void setName(QName name) {
- this.name = name;
+ public void setFaultOutFlow(Flow faultFlow) {
+ flowInclude.setFaultOutFlow(faultFlow);
}
/**
- * @return
+ * @param inFlow
*/
- public Module getModule() {
- return module;
+ public void setInFlow(Flow inFlow) {
+ flowInclude.setInFlow(inFlow);
}
/**
@@ -180,51 +208,25 @@
this.module = module;
}
- public void addOperation(AxisOperation axisOperation) {
- operations.put(axisOperation.getName(), axisOperation);
+ public void setModuleClassLoader(ClassLoader moduleClassLoader) {
+ this.moduleClassLoader = moduleClassLoader;
}
- public HashMap getOperations() {
- return operations;
+ /**
+ * @param name
+ */
+ public void setName(QName name) {
+ this.name = name;
}
- public AxisConfiguration getParent() {
- return parent;
+ /**
+ * @param outFlow
+ */
+ public void setOutFlow(Flow outFlow) {
+ flowInclude.setOutFlow(outFlow);
}
public void setParent(AxisConfiguration parent) {
this.parent = parent;
}
-
- //to check whether a given parameter is locked
- public boolean isParameterLocked(String parameterName) {
- // checking the locked value of parent
- boolean loscked = false;
- if (getParent() !=null) {
- loscked= getParent().isParameterLocked(parameterName);
- }
- if(loscked){
- return true;
- } else {
- Parameter parameter = getParameter(parameterName);
- if(parameter != null && parameter.isLocked()){
- return true;
- } else {
- return false;
- }
- }
- }
-
- public void deserializeParameters(OMElement parameterElement) throws AxisFault {
- this.parameters.deserializeParameters(parameterElement);
- }
-
- public ClassLoader getModuleClassLoader() {
- return moduleClassLoader;
- }
-
- public void setModuleClassLoader(ClassLoader moduleClassLoader) {
- this.moduleClassLoader = moduleClassLoader;
- }
-
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java Fri Dec 16 09:13:57 2005
@@ -6,23 +6,6 @@
import javax.xml.namespace.QName;
import java.util.HashMap;
-/*
-* 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
@@ -30,22 +13,24 @@
* Time: 6:01:33 PM
*/
public class OutInAxisOperation extends InOutAxisOperation {
+ public OutInAxisOperation() {
+ super();
+ }
public OutInAxisOperation(QName name) {
super(name);
}
- public OutInAxisOperation() {
- super();
- }
-
- public void addMessageContext(MessageContext msgContext, OperationContext opContext) throws AxisFault {
+ public void addMessageContext(MessageContext msgContext, OperationContext opContext)
+ throws AxisFault {
HashMap mep = opContext.getMessageContexts();
MessageContext immsgContext = (MessageContext) mep.get(MESSAGE_LABEL_IN_VALUE);
MessageContext outmsgContext = (MessageContext) mep.get(MESSAGE_LABEL_OUT_VALUE);
- if (immsgContext != null && outmsgContext != null) {
+
+ if ((immsgContext != null) && (outmsgContext != null)) {
throw new AxisFault("Invalid messge addition , operation context completed");
}
+
if (outmsgContext == null) {
mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
} else {
@@ -53,4 +38,4 @@
opContext.setComplete(true);
}
}
-}
\ No newline at end of file
+}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java Fri Dec 16 09:13:57 2005
@@ -4,42 +4,17 @@
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.OperationContext;
import org.apache.wsdl.WSDLConstants;
-import org.apache.wsdl.WSDLOperation;
import javax.xml.namespace.QName;
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.
-*
-*/
public class OutOnlyAxisOperation extends AxisOperation {
-
- private AxisMessage outMessage;
private AxisMessage inFaultMessage;
- private AxisMessage outFaultMessage;
- //just to keep the inflow , there wont be any usage
+ // just to keep the inflow , there wont be any usage
private ArrayList inPhases;
-
- private void createMessage() {
- outMessage = new AxisMessage();
- inFaultMessage = new AxisMessage();
- outFaultMessage = new AxisMessage();
- inPhases = new ArrayList();
- }
+ private AxisMessage outFaultMessage;
+ private AxisMessage outMessage;
public OutOnlyAxisOperation() {
super();
@@ -51,6 +26,39 @@
createMessage();
}
+ public void addMessage(AxisMessage message, String label) {
+ if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+ outMessage = message;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+
+ public void addMessageContext(MessageContext msgContext, OperationContext opContext)
+ throws AxisFault {
+ if (!opContext.isComplete()) {
+ opContext.getMessageContexts().put(MESSAGE_LABEL_OUT_VALUE, msgContext);
+ opContext.setComplete(true);
+ } else {
+ throw new AxisFault("Invalid messge addition , operation context completed");
+ }
+ }
+
+ private void createMessage() {
+ outMessage = new AxisMessage();
+ inFaultMessage = new AxisMessage();
+ outFaultMessage = new AxisMessage();
+ inPhases = new ArrayList();
+ }
+
+ public AxisMessage getMessage(String label) {
+ if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+ return outMessage;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+
public ArrayList getPhasesInFaultFlow() {
return inFaultMessage.getMessageFlow();
}
@@ -67,14 +75,6 @@
return inPhases;
}
- public AxisMessage getMessage(String label) {
- if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
- return outMessage;
- } else {
- throw new UnsupportedOperationException("Not yet implemented");
- }
- }
-
public void setPhasesInFaultFlow(ArrayList list) {
inFaultMessage.setMessageFlow(list);
}
@@ -90,22 +90,4 @@
public void setRemainingPhasesInFlow(ArrayList list) {
inPhases = list;
}
-
- public void addMessage(AxisMessage message, String label) {
- if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
- outMessage = message;
- } else {
- throw new UnsupportedOperationException("Not yet implemented");
- }
- }
-
- public void addMessageContext(MessageContext msgContext, OperationContext opContext)
- throws AxisFault {
- if (!opContext.isComplete()) {
- opContext.getMessageContexts().put(MESSAGE_LABEL_OUT_VALUE, msgContext);
- opContext.setComplete(true);
- } else {
- throw new AxisFault("Invalid messge addition , operation context completed");
- }
- }
-}
\ No newline at end of file
+}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Parameter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Parameter.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Parameter.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Parameter.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
@@ -22,6 +23,7 @@
* Interface Parameter
*/
public interface Parameter {
+
/**
* Field TEXT_PARAMETER
*/
@@ -40,25 +42,25 @@
public String getName();
/**
- * Method getValue
+ * To get the whole parameter element
*
- * @return Object
+ * @return <code>OMElement<code>
*/
- public Object getValue();
+ public OMElement getParameterElement();
/**
- * Method setName
+ * Method getParameterType
*
- * @param name
+ * @return int
*/
- public void setName(String name);
+ public int getParameterType();
/**
- * Method setValue
+ * Method getValue
*
- * @param value
+ * @return Object
*/
- public void setValue(Object value);
+ public Object getValue();
/**
* Method isLocked
@@ -75,28 +77,29 @@
public void setLocked(boolean value);
/**
- * Method getParameterType
+ * Method setName
*
- * @return int
+ * @param name
*/
- public int getParameterType();
-
- public void setParameterType(int type);
+ public void setName(String name);
/**
- * Parameter can be any thing it can be XML element with number of child elements , so if some
+ * Parameter can be any thing it can be XML element with number of child elements , so if some
* one wants to access the XML elemet we need to store that , at the deployment time , to store
* the XMLelment of the parameter can use this method it will store whole
* <parameter name="ServiceClass1" locked="false">org.apache.axis2.sample.echo.EchoImpl</parameter>
* element
- * @param element <code>OMElement<code>
+ *
+ * @param element <code>OMElement<code>
*/
-
public void setParameterElement(OMElement element);
+ public void setParameterType(int type);
+
/**
- * To get the whole parameter element
- * @return <code>OMElement<code>
+ * Method setValue
+ *
+ * @param value
*/
- public OMElement getParameterElement();
+ public void setValue(Object value);
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterImpl.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterImpl.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
@@ -22,15 +23,11 @@
* Class ParameterImpl
*/
public class ParameterImpl implements Parameter {
- /**
- * Field name
- */
- private String name;
/**
- * Field value
+ * Field type
*/
- private Object value;
+ private int type = TEXT_PARAMETER;
/**
* Field locked
@@ -38,17 +35,21 @@
private boolean locked;
/**
- * Field type
+ * Field name
*/
- private int type = TEXT_PARAMETER;
-
+ private String name;
/**
* to store the parameter lement
* <parameter name="ServiceClass1" locked="false">
* org.apache.axis2.sample.echo.EchoImpl</parameter>
*/
- private OMElement parameterElement ;
+ private OMElement parameterElement;
+
+ /**
+ * Field value
+ */
+ private Object value;
/**
* Constructor ParameterImpl
@@ -68,77 +69,77 @@
}
/**
- * Method setName
+ * Method getName
*
- * @param name
+ * @return
*/
- public void setName(String name) {
- this.name = name;
+ public String getName() {
+ return name;
}
- /**
- * Method setValue
- *
- * @param value
- */
- public void setValue(Object value) {
- this.value = value;
+ public OMElement getParameterElement() {
+ return this.parameterElement;
}
/**
- * Method isLocked
+ * Method getParameterType
*
* @return
*/
- public boolean isLocked() {
- return locked;
+ public int getParameterType() {
+ return type;
}
/**
- * Method setLocked
+ * Method getValue
*
- * @param value
+ * @return
*/
- public void setLocked(boolean value) {
- locked = value;
+ public Object getValue() {
+ return value;
}
/**
- * Method getName
+ * Method isLocked
*
* @return
*/
- public String getName() {
- return name;
+ public boolean isLocked() {
+ return locked;
}
/**
- * Method getValue
+ * Method setLocked
*
- * @return
+ * @param value
*/
- public Object getValue() {
- return value;
+ public void setLocked(boolean value) {
+ locked = value;
}
/**
- * Method getParameterType
+ * Method setName
*
- * @return
+ * @param name
*/
- public int getParameterType() {
- return type;
- }
-
- public void setParameterType(int type) {
- this.type =type;
+ public void setName(String name) {
+ this.name = name;
}
public void setParameterElement(OMElement element) {
this.parameterElement = element;
}
- public OMElement getParameterElement() {
- return this.parameterElement;
+ public void setParameterType(int type) {
+ this.type = type;
+ }
+
+ /**
+ * Method setValue
+ *
+ * @param value
+ */
+ public void setValue(Object value) {
+ this.value = value;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterInclude.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterInclude.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterInclude.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterInclude.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
@@ -35,6 +36,8 @@
*/
public void addParameter(Parameter param) throws AxisFault;
+ public void deserializeParameters(OMElement parameterElement) throws AxisFault;
+
/**
* Method getParameter
*
@@ -45,17 +48,13 @@
/**
* To get all the parameters in a given description
+ *
* @return
*/
ArrayList getParameters();
/**
- * to check whether the parameter is locked at any level
+ * to check whether the parameter is locked at any level
*/
-
boolean isParameterLocked(String parameterName);
-
- public void deserializeParameters(OMElement parameterElement) throws AxisFault;
-
-
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterIncludeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterIncludeImpl.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterIncludeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterIncludeImpl.java Fri Dec 16 09:13:57 2005
@@ -1,25 +1,26 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMAttribute;
import org.apache.axis2.AxisFault;
import org.apache.axis2.deployment.DeploymentConstants;
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
import javax.xml.namespace.QName;
import java.util.ArrayList;
@@ -31,6 +32,7 @@
* Class ParameterIncludeImpl
*/
public class ParameterIncludeImpl implements ParameterInclude {
+
/**
* Field parmeters
*/
@@ -48,80 +50,94 @@
*
* @param param
*/
- public void addParameter(Parameter param) {
+ public void addParameter(Parameter param) {
if (param != null) {
parameters.put(param.getName(), param);
}
}
/**
- * Method getParameter
- *
- * @param name
- * @return parameter
- */
- public Parameter getParameter(String name) {
- return (Parameter) parameters.get(name);
- }
-
- public ArrayList getParameters() {
- Collection col = parameters.values();
- ArrayList para_list = new ArrayList();
- for (Iterator iterator = col.iterator(); iterator.hasNext();) {
- Parameter parameter = (Parameter) iterator.next();
- para_list.add(parameter);
- }
- return para_list;
- }
-
- //to check whether the parameter is locked at any levle
- public boolean isParameterLocked(String parameterName) {
- return false;
- }
-
- /**
* At the run time it can be able to change parameters , and system can save at any time and
* to get the original state this method can be used
+ *
* @param parameters <code>OMElement</code>
* @throws org.apache.axis2.AxisFault
*/
- public void deserializeParameters(OMElement parameters) throws AxisFault {
- Iterator iterator = parameters.getChildrenWithName(new QName(DeploymentConstants.PARAMETER));
+ public void deserializeParameters(OMElement parameters) throws AxisFault {
+ Iterator iterator =
+ parameters.getChildrenWithName(new QName(DeploymentConstants.PARAMETER));
+
while (iterator.hasNext()) {
- //this is to check whether some one has locked the parmter at the top level
- OMElement parameterElement = (OMElement) iterator.next();
+ // this is to check whether some one has locked the parmter at the top level
+ OMElement parameterElement = (OMElement) iterator.next();
Parameter parameter = new ParameterImpl();
- //setting parameterElement
+
+ // setting parameterElement
parameter.setParameterElement(parameterElement);
- //setting parameter Name
- OMAttribute paraName = parameterElement.getAttribute(
- new QName(DeploymentConstants.ATTNAME));
+ // setting parameter Name
+ OMAttribute paraName =
+ parameterElement.getAttribute(new QName(DeploymentConstants.ATTNAME));
+
parameter.setName(paraName.getAttributeValue());
- //setting parameter Value (the chiled elemnt of the parameter)
+ // setting parameter Value (the chiled elemnt of the parameter)
OMElement paraValue = parameterElement.getFirstElement();
- if(paraValue !=null){
+
+ if (paraValue != null) {
parameter.setValue(parameterElement);
parameter.setParameterType(Parameter.OM_PARAMETER);
} else {
String paratextValue = parameterElement.getText();
+
parameter.setValue(paratextValue);
parameter.setParameterType(Parameter.TEXT_PARAMETER);
}
- //setting locking attribute
- OMAttribute paraLocked = parameterElement.getAttribute(
- new QName(DeploymentConstants.ATTLOCKED));
- if (paraLocked !=null) {
+
+ // setting locking attribute
+ OMAttribute paraLocked =
+ parameterElement.getAttribute(new QName(DeploymentConstants.ATTLOCKED));
+
+ if (paraLocked != null) {
String lockedValue = paraLocked.getAttributeValue();
- if("true".equals(lockedValue)){
+
+ if ("true".equals(lockedValue)) {
parameter.setLocked(true);
} else {
parameter.setLocked(false);
}
}
+
addParameter(parameter);
}
+ }
+
+ /**
+ * Method getParameter
+ *
+ * @param name
+ * @return parameter
+ */
+ public Parameter getParameter(String name) {
+ return (Parameter) parameters.get(name);
+ }
+
+ public ArrayList getParameters() {
+ Collection col = parameters.values();
+ ArrayList para_list = new ArrayList();
+
+ for (Iterator iterator = col.iterator(); iterator.hasNext();) {
+ Parameter parameter = (Parameter) iterator.next();
+
+ para_list.add(parameter);
+ }
+
+ return para_list;
+ }
+
+ // to check whether the parameter is locked at any levle
+ public boolean isParameterLocked(String parameterName) {
+ return false;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/PhaseRule.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/PhaseRule.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/PhaseRule.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/PhaseRule.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
@@ -24,21 +25,16 @@
// can be either name of phase or handler
/**
- * Field before
- */
- private String before;
-
- // can be either name of phase or handler
-
- /**
* Field after
*/
private String after;
+ // can be either name of phase or handler
+
/**
- * Field phaseName
+ * Field before
*/
- private String phaseName;
+ private String before;
/**
* Field phaseFirst
@@ -51,6 +47,11 @@
private boolean phaseLast;
/**
+ * Field phaseName
+ */
+ private String phaseName;
+
+ /**
* Constructor PhaseRule
*/
public PhaseRule() {
@@ -66,66 +67,66 @@
}
/**
- * Method getBefore
+ * Method getAfter
*
* @return
*/
- public String getBefore() {
- return before;
+ public String getAfter() {
+ return after;
}
/**
- * Method setBefore
+ * Method getBefore
*
- * @param before
+ * @return
*/
- public void setBefore(String before) {
- this.before = before;
+ public String getBefore() {
+ return before;
}
/**
- * Method getAfter
+ * Method getPhaseName
*
* @return
*/
- public String getAfter() {
- return after;
+ public String getPhaseName() {
+ return phaseName;
}
/**
- * Method setAfter
+ * Method isPhaseFirst
*
- * @param after
+ * @return
*/
- public void setAfter(String after) {
- this.after = after;
+ public boolean isPhaseFirst() {
+ return phaseFirst;
}
/**
- * Method getPhaseName
+ * Method isPhaseLast
*
* @return
*/
- public String getPhaseName() {
- return phaseName;
+ public boolean isPhaseLast() {
+ return phaseLast;
}
/**
- * Method setPhaseName
+ * Method setAfter
*
- * @param phaseName
+ * @param after
*/
- public void setPhaseName(String phaseName) {
- this.phaseName = phaseName;
+ public void setAfter(String after) {
+ this.after = after;
}
/**
- * Method isPhaseFirst
+ * Method setBefore
*
- * @return
+ * @param before
*/
- public boolean isPhaseFirst() {
- return phaseFirst;
+ public void setBefore(String before) {
+ this.before = before;
}
/**
@@ -138,20 +139,20 @@
}
/**
- * Method isPhaseLast
+ * Method setPhaseLast
*
- * @return
+ * @param phaseLast
*/
- public boolean isPhaseLast() {
- return phaseLast;
+ public void setPhaseLast(boolean phaseLast) {
+ this.phaseLast = phaseLast;
}
/**
- * Method setPhaseLast
+ * Method setPhaseName
*
- * @param phaseLast
+ * @param phaseName
*/
- public void setPhaseLast(boolean phaseLast) {
- this.phaseLast = phaseLast;
+ public void setPhaseName(String phaseName) {
+ this.phaseName = phaseName;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportInDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportInDescription.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportInDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportInDescription.java Fri Dec 16 09:13:57 2005
@@ -1,24 +1,25 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.om.OMElement;
import org.apache.axis2.engine.Phase;
+import org.apache.axis2.om.OMElement;
import org.apache.axis2.phaseresolver.PhaseMetadata;
import org.apache.axis2.transport.TransportListener;
@@ -28,12 +29,15 @@
/**
* Represents a incoming transport deployed in AXis2
*/
-public class TransportInDescription
- implements ParameterInclude {
+public class TransportInDescription implements ParameterInclude {
+
/**
- * Field paramInclude
+ * Field flowInclude
*/
- protected final ParameterInclude paramInclude;
+ private Flow faultFlow;
+
+ // to store handler Fault in inFlow
+ private Phase faultPhase;
/**
* Field phasesInclude
@@ -43,26 +47,21 @@
* Field flowInclude
*/
private Flow inFlow;
- /**
- * Field flowInclude
- */
- private Flow faultFlow;
+ // to store handler in inFlow
+ private Phase inPhase;
/**
* Field name
*/
protected QName name;
-
+ /**
+ * Field paramInclude
+ */
+ protected final ParameterInclude paramInclude;
protected TransportListener receiver;
- //to store handler in inFlow
- private Phase inPhase;
- //to store handler Fault in inFlow
- private Phase faultPhase;
-
-
/**
* Constructor AxisTransport
*
@@ -76,35 +75,32 @@
}
/**
- * Method getParameter
+ * Method addParameter
*
- * @param name
- * @return
+ * @param param
*/
- public Parameter getParameter(String name) {
- return paramInclude.getParameter(name);
+ public void addParameter(Parameter param) throws AxisFault {
+ paramInclude.addParameter(param);
}
- public ArrayList getParameters() {
- return paramInclude.getParameters();
+ public void deserializeParameters(OMElement parameterElement) throws AxisFault {
+ this.paramInclude.deserializeParameters(parameterElement);
}
- //to check whether the parameter is locked at any levle
- public boolean isParameterLocked(String parameterName) {
- return paramInclude.isParameterLocked(parameterName);
+ public Flow getFaultFlow() {
+ return faultFlow;
}
- public void deserializeParameters(OMElement parameterElement) throws AxisFault {
- this.paramInclude.deserializeParameters(parameterElement);
+ public Phase getFaultPhase() {
+ return faultPhase;
}
- /**
- * Method addParameter
- *
- * @param param
- */
- public void addParameter(Parameter param) throws AxisFault{
- paramInclude.addParameter(param);
+ public Flow getInFlow() {
+ return inFlow;
+ }
+
+ public Phase getInPhase() {
+ return inPhase;
}
/**
@@ -115,56 +111,58 @@
}
/**
+ * Method getParameter
+ *
* @param name
+ * @return
*/
- public void setName(QName name) {
- this.name = name;
+ public Parameter getParameter(String name) {
+ return paramInclude.getParameter(name);
}
- public Flow getInFlow() {
- return inFlow;
+ public ArrayList getParameters() {
+ return paramInclude.getParameters();
}
- public void setInFlow(Flow inFlow) {
- this.inFlow = inFlow;
+ /**
+ * @return
+ */
+ public TransportListener getReceiver() {
+ return receiver;
}
- public Flow getFaultFlow() {
- return faultFlow;
+ // to check whether the parameter is locked at any levle
+ public boolean isParameterLocked(String parameterName) {
+ return paramInclude.isParameterLocked(parameterName);
}
public void setFaultFlow(Flow faultFlow) {
this.faultFlow = faultFlow;
}
- /**
- * @return
- */
- public TransportListener getReceiver() {
- return receiver;
- }
-
- /**
- * @param receiver
- */
- public void setReceiver(TransportListener receiver) {
- this.receiver = receiver;
+ public void setFaultPhase(Phase faultPhase) {
+ this.faultPhase = faultPhase;
}
- public Phase getInPhase() {
- return inPhase;
+ public void setInFlow(Flow inFlow) {
+ this.inFlow = inFlow;
}
public void setInPhase(Phase inPhase) {
this.inPhase = inPhase;
}
- public Phase getFaultPhase() {
- return faultPhase;
+ /**
+ * @param name
+ */
+ public void setName(QName name) {
+ this.name = name;
}
- public void setFaultPhase(Phase faultPhase) {
- this.faultPhase = faultPhase;
+ /**
+ * @param receiver
+ */
+ public void setReceiver(TransportListener receiver) {
+ this.receiver = receiver;
}
-
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportOutDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportOutDescription.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportOutDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportOutDescription.java Fri Dec 16 09:13:57 2005
@@ -1,24 +1,25 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.description;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.om.OMElement;
import org.apache.axis2.engine.Phase;
+import org.apache.axis2.om.OMElement;
import org.apache.axis2.phaseresolver.PhaseMetadata;
import org.apache.axis2.transport.TransportSender;
@@ -28,25 +29,12 @@
/**
* Represents a transport deployed in AXis2
*/
-public class TransportOutDescription
- implements ParameterInclude {
- /**
- * Field paramInclude
- */
- protected final ParameterInclude paramInclude;
-
-
- /**
- * Field flowInclude
- */
- private Flow outFlow;
+public class TransportOutDescription implements ParameterInclude {
/**
* Field flowInclude
*/
private Flow faultFlow;
-
- private Phase outPhase;
private Phase faultPhase;
/**
@@ -54,7 +42,16 @@
*/
protected QName name;
+ /**
+ * Field flowInclude
+ */
+ private Flow outFlow;
+ private Phase outPhase;
+ /**
+ * Field paramInclude
+ */
+ protected final ParameterInclude paramInclude;
protected TransportSender sender;
/**
@@ -70,37 +67,25 @@
}
/**
- * Method getParameter
+ * Method addParameter
*
- * @param name
- * @return
+ * @param param
*/
- public Parameter getParameter(String name) {
- return paramInclude.getParameter(name);
- }
-
- public ArrayList getParameters() {
- return paramInclude.getParameters();
- }
-
- //to check whether the parameter is locked at any levle
- public boolean isParameterLocked(String parameterName) {
- return paramInclude.isParameterLocked(parameterName);
+ public void addParameter(Parameter param) throws AxisFault {
+ paramInclude.addParameter(param);
}
public void deserializeParameters(OMElement parameterElement) throws AxisFault {
this.paramInclude.deserializeParameters(parameterElement);
}
- /**
- * Method addParameter
- *
- * @param param
- */
- public void addParameter(Parameter param) throws AxisFault {
- paramInclude.addParameter(param);
+ public Flow getFaultFlow() {
+ return faultFlow;
}
+ public Phase getFaultPhase() {
+ return faultPhase;
+ }
/**
* @return
@@ -109,59 +94,67 @@
return name;
}
- /**
- * @param name
- */
- public void setName(QName name) {
- this.name = name;
+ public Flow getOutFlow() {
+ return outFlow;
}
+ public Phase getOutPhase() {
+ return outPhase;
+ }
/**
+ * Method getParameter
+ *
+ * @param name
* @return
*/
- public TransportSender getSender() {
- return sender;
+ public Parameter getParameter(String name) {
+ return paramInclude.getParameter(name);
}
+ public ArrayList getParameters() {
+ return paramInclude.getParameters();
+ }
/**
- * @param sender
+ * @return
*/
- public void setSender(TransportSender sender) {
- this.sender = sender;
+ public TransportSender getSender() {
+ return sender;
}
- public Flow getOutFlow() {
- return outFlow;
+ // to check whether the parameter is locked at any levle
+ public boolean isParameterLocked(String parameterName) {
+ return paramInclude.isParameterLocked(parameterName);
}
- public void setOutFlow(Flow outFlow) {
- this.outFlow = outFlow;
+ public void setFaultFlow(Flow faultFlow) {
+ this.faultFlow = faultFlow;
}
- public Flow getFaultFlow() {
- return faultFlow;
+ public void setFaultPhase(Phase faultPhase) {
+ this.faultPhase = faultPhase;
}
- public void setFaultFlow(Flow faultFlow) {
- this.faultFlow = faultFlow;
+ /**
+ * @param name
+ */
+ public void setName(QName name) {
+ this.name = name;
}
- public Phase getOutPhase() {
- return outPhase;
+ public void setOutFlow(Flow outFlow) {
+ this.outFlow = outFlow;
}
public void setOutPhase(Phase outPhase) {
this.outPhase = outPhase;
}
- public Phase getFaultPhase() {
- return faultPhase;
- }
-
- public void setFaultPhase(Phase faultPhase) {
- this.faultPhase = faultPhase;
+ /**
+ * @param sender
+ */
+ public void setSender(TransportSender sender) {
+ this.sender = sender;
}
-
}
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=357187&r1=357186&r2=357187&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 Fri Dec 16 09:13:57 2005
@@ -1,23 +1,25 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.*;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.HandlerDescription;
@@ -28,20 +30,19 @@
import javax.xml.namespace.QName;
/**
- * This the base class for all dispatchers. A dispatcher's task is
+ * This the base class for all dispatchers. A dispatcher's task is
* to find the service for an incoming SOAP message.
* <p/>
- * In Axis2, a chain of dispatchers is setup. Each tries to
+ * In Axis2, a chain of dispatchers is setup. Each tries to
* dispatch and returns without throwing an exception, in case, it fails.
*/
public abstract class AbstractDispatcher extends AbstractHandler {
- private Log log = LogFactory.getLog(getClass());
+
/**
* Field NAME
*/
- public static final QName NAME =
- new QName("http://axis.ws.apache.org",
- "AbstractDispatcher");
+ public static final QName NAME = new QName("http://axis.ws.apache.org", "AbstractDispatcher");
+ private Log log = LogFactory.getLog(getClass());
/**
* Constructor Dispatcher
@@ -52,57 +53,60 @@
init(new HandlerDescription(NAME));
}
- //just to put the parent
+ /**
+ * Called by Axis Engine to find the operation.
+ *
+ * @param service
+ * @param messageContext
+ * @return Returns AxisOperation.
+ * @throws AxisFault
+ */
+ public abstract AxisOperation findOperation(AxisService service, MessageContext messageContext)
+ throws AxisFault;
+
+ /**
+ * Called by Axis Engine to find the service.
+ *
+ * @param messageContext
+ * @return Returns AxisService.
+ * @throws AxisFault
+ */
+ public abstract AxisService findService(MessageContext messageContext) throws AxisFault;
+
+ // just to put the parent
public abstract void initDispatcher();
/**
- *
* @param msgctx
* @throws org.apache.axis2.AxisFault
*/
public void invoke(MessageContext msgctx) throws AxisFault {
AxisService axisService = msgctx.getAxisService();
+
if (axisService == null) {
axisService = findService(msgctx);
+
if (axisService != null) {
- if(log.isDebugEnabled()) {
- log.debug("Found AxisService : " + axisService.getAxisServiceName()) ;
+ if (log.isDebugEnabled()) {
+ log.debug("Found AxisService : " + axisService.getAxisServiceName());
}
+
msgctx.setAxisService(axisService);
+
// TODO Chinthaka : set the Service Group Context to the message Context
}
}
- if (msgctx.getAxisService() != null && msgctx.getAxisOperation() == null) {
+ if ((msgctx.getAxisService() != null) && (msgctx.getAxisOperation() == null)) {
AxisOperation axisOperation = findOperation(axisService, msgctx);
+
if (axisOperation != null) {
- if(log.isDebugEnabled()) {
- log.debug("Found AxisOperation : " + axisOperation.getName()) ;
+ if (log.isDebugEnabled()) {
+ log.debug("Found AxisOperation : " + axisOperation.getName());
}
+
msgctx.setAxisOperation(axisOperation);
}
}
}
-
- /**
- * Called by Axis Engine to find the service.
- *
- * @param messageContext
- * @return Returns AxisService.
- * @throws AxisFault
- */
- public abstract AxisService findService(
- MessageContext messageContext) throws AxisFault;
-
- /**
- * Called by Axis Engine to find the operation.
- *
- * @param service
- * @param messageContext
- * @return Returns AxisOperation.
- * @throws AxisFault
- */
- public abstract AxisOperation findOperation(
- AxisService service, MessageContext messageContext) throws AxisFault;
-
}
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=357187&r1=357186&r2=357187&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 Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
package org.apache.axis2.engine;
@@ -36,80 +37,96 @@
* Dispatcher based on the WS-Addressing properties.
*/
public class AddressingBasedDispatcher extends AbstractDispatcher implements AddressingConstants {
- private Log log = LogFactory.getLog(getClass());
+
/**
* Field NAME
*/
- public static final QName NAME =
- new QName("http://axis.ws.apache.org",
- "AddressingBasedDispatcher");
-
- public void initDispatcher() {
- init(new HandlerDescription(NAME));
- }
+ public static final QName NAME = new QName("http://axis.ws.apache.org",
+ "AddressingBasedDispatcher");
+ private Log log = LogFactory.getLog(getClass());
- /**
- *
- * @param msgctx
- * @throws org.apache.axis2.AxisFault
- */
- public void invoke(MessageContext msgctx) throws AxisFault {
- // first check we can dispatch using the relates to
- if (msgctx.getRelatesTo() != null) {
- log.debug("Checking RelatesTo : " + msgctx.getRelatesTo());
- String relatesTo = msgctx.getRelatesTo().getValue();
- if (relatesTo != null || "".equals(relatesTo)) {
- OperationContext operationContext = msgctx.getConfigurationContext().getOperationContext(relatesTo);
- if (operationContext != null) {
- msgctx.setAxisOperation(operationContext.getAxisOperation());
- msgctx.setOperationContext(operationContext);
- msgctx.setServiceContext((ServiceContext) operationContext.getParent());
- msgctx.setAxisService(((ServiceContext) operationContext.getParent()).getAxisService());
- msgctx.getAxisOperation().registerOperationContext(msgctx, operationContext);
- msgctx.setServiceGroupContextId(((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());
- }
- }
- return;
- }
- super.invoke(msgctx);
- }
-
- //TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
- public AxisOperation findOperation(AxisService service,
- MessageContext messageContext)
+ // TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
+ public AxisOperation findOperation(AxisService service, MessageContext messageContext)
throws AxisFault {
log.debug("Checking for Operation using WSAAction : " + messageContext.getWSAAction());
+
String action = messageContext.getWSAAction();
+
if (action != null) {
return service.getOperationByAction(action);
}
+
return null;
}
- // TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
+ // TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
public AxisService findService(MessageContext messageContext) throws AxisFault {
EndpointReference toEPR = messageContext.getTo();
AxisService service = null;
+
if (toEPR != null) {
String address = toEPR.getAddress();
+
log.debug("Checking for Service using toEPR's address : " + address);
- if (Final.WSA_ANONYMOUS_URL.equals(address) || Submission.WSA_ANONYMOUS_URL.equals(address)) {
+
+ if (Final.WSA_ANONYMOUS_URL.equals(address)
+ || Submission.WSA_ANONYMOUS_URL.equals(address)) {
return null;
}
+
QName serviceName = new QName(address);
+ String[] values = Utils.parseRequestURLForServiceAndOperation(address);
- String[] values = Utils.parseRequestURLForServiceAndOperation(
- address);
log.debug("Checking for Service using toEPR : " + values[0]);
+
if (values[0] != null) {
serviceName = new QName(values[0]);
+
AxisConfiguration registry =
messageContext.getConfigurationContext().getAxisConfiguration();
- return registry.getService(serviceName.getLocalPart());
+ return registry.getService(serviceName.getLocalPart());
}
}
+
return service;
}
+ public void initDispatcher() {
+ init(new HandlerDescription(NAME));
+ }
+
+ /**
+ * @param msgctx
+ * @throws org.apache.axis2.AxisFault
+ */
+ public void invoke(MessageContext msgctx) throws AxisFault {
+
+ // first check we can dispatch using the relates to
+ if (msgctx.getRelatesTo() != null) {
+ log.debug("Checking RelatesTo : " + msgctx.getRelatesTo());
+
+ String relatesTo = msgctx.getRelatesTo().getValue();
+
+ if ((relatesTo != null) || "".equals(relatesTo)) {
+ OperationContext operationContext =
+ msgctx.getConfigurationContext().getOperationContext(relatesTo);
+
+ if (operationContext != null) {
+ msgctx.setAxisOperation(operationContext.getAxisOperation());
+ msgctx.setOperationContext(operationContext);
+ msgctx.setServiceContext((ServiceContext) operationContext.getParent());
+ msgctx.setAxisService(
+ ((ServiceContext) operationContext.getParent()).getAxisService());
+ msgctx.getAxisOperation().registerOperationContext(msgctx, operationContext);
+ msgctx.setServiceGroupContextId(
+ ((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());
+ }
+ }
+
+ return;
+ }
+
+ super.invoke(msgctx);
+ }
}