You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2006/10/30 16:43:25 UTC
svn commit: r469167 [7/7] - in /webservices/sandesha/trunk/java: config/
interop/conf/ src/org/apache/sandesha2/ src/org/apache/sandesha2/client/
src/org/apache/sandesha2/handlers/ src/org/apache/sandesha2/i18n/
src/org/apache/sandesha2/msgprocessors/ ...
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SpecSpecificConstants.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SpecSpecificConstants.java?view=diff&rev=469167&r1=469166&r2=469167
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SpecSpecificConstants.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SpecSpecificConstants.java Mon Oct 30 07:43:24 2006
@@ -1,326 +1,374 @@
-/*
- * Copyright 1999-2004 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.sandesha2.util;
-
-import java.net.UnknownServiceException;
-
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * To get values which are different in the RM specs in a convenient manner.
- */
-
-public class SpecSpecificConstants {
-
-
- public static String getSpecVersionString (String namespaceValue) throws SandeshaException {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceValue))
- return Sandesha2Constants.SPEC_VERSIONS.v1_0;
- else if (Sandesha2Constants.SPEC_2006_08.NS_URI.equals(namespaceValue))
- return Sandesha2Constants.SPEC_VERSIONS.v1_1;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- namespaceValue));
- }
-
- public static String getRMNamespaceValue (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.NS_URI;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.NS_URI;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getCreateSequenceAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_CREATE_SEQUENCE;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CREATE_SEQUENCE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getCreateSequenceResponseAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_CREATE_SEQUENCE_RESPONSE;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CREATE_SEQUENCE_RESPONSE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getTerminateSequenceAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_TERMINATE_SEQUENCE;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_TERMINATE_SEQUENCE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getTerminateSequenceResponseAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_TERMINATE_SEQUENCE_RESPONSE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec));
- }
-
- public static String getCloseSequenceAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSequenceSpecLevel,
- specVersion));
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CLOSE_SEQUENCE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getCloseSequenceResponseAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSequenceSpecLevel,
- specVersion));
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CLOSE_SEQUENCE_RESPONSE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getAckRequestAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return null; //No action defined for ackRequests
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_ACK_REQUEST;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getSequenceAcknowledgementAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_SEQUENCE_ACKNOWLEDGEMENT;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_SEQUENCE_ACKNOWLEDGEMENT;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getMakeConnectionAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion)) {
- String message = "MakeConnection is not supported in this RM version";
- throw new SandeshaException (message);
- }
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_MAKE_CONNECTION;
- else {
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
- }
-
- public static String getCreateSequenceSOAPAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_CREATE_SEQUENCE;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_CREATE_SEQUENCE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getCreateSequenceResponseSOAPAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_CREATE_SEQUENCE_RESPONSE;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_CREATE_SEQUENCE_RESPONSE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getTerminateSequenceSOAPAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_TERMINATE_SEQUENCE;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_TERMINATE_SEQUENCE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getTerminateSequenceResponseSOAPAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_TERMINATE_SEQUENCE_RESPONSE;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getAckRequestSOAPAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- throw new SandeshaException ("this spec version does not define a ackRequest SOAP action");
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_ACK_REQUEST;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getSequenceAcknowledgementSOAPAction (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_SEQUENCE_ACKNOWLEDGEMENT;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_SEQUENCE_ACKNOWLEDGEMENT;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static boolean isTerminateSequenceResponseRequired (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return false;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return true;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static boolean isLastMessageIndicatorRequired (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return true;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return false;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static boolean isAckFinalAllowed (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return false;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return true;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static boolean isAckNoneAllowed (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return false;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return true;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static boolean isSequenceClosingAllowed (String specVersion) throws SandeshaException {
- if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
- return false;
- else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
- return true;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- specVersion));
- }
-
- public static String getDefaultSpecVersion () {
- return Sandesha2Constants.SPEC_VERSIONS.v1_0;
- }
-
- public static String getAddressingAnonymousURI (String addressingNSURI) throws SandeshaException {
- if (AddressingConstants.Submission.WSA_NAMESPACE.equals(addressingNSURI))
- return AddressingConstants.Submission.WSA_ANONYMOUS_URL;
- else if (AddressingConstants.Final.WSA_NAMESPACE.equals(addressingNSURI))
- return AddressingConstants.Final.WSA_ANONYMOUS_URL;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownWSAVersion,
- addressingNSURI));
- }
-
- public static String getAddressingFaultAction (String addressingNSURI) throws SandeshaException {
- if (AddressingConstants.Submission.WSA_NAMESPACE.equals(addressingNSURI))
- return "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault"; //this is not available in addressing constants )-:
- else if (AddressingConstants.Final.WSA_NAMESPACE.equals(addressingNSURI))
- return AddressingConstants.Final.WSA_FAULT_ACTION;
- else
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownWSAVersion,
- addressingNSURI));
- }
-
- public static String getSecurityNamespace (String rmNamespace) {
- if(rmNamespace.equals(Sandesha2Constants.SPEC_2005_02.NS_URI)) {
- return Sandesha2Constants.SPEC_2005_02.SEC_NS_URI;
- }
-
- if(rmNamespace.equals(Sandesha2Constants.SPEC_2006_08.NS_URI)) {
- return Sandesha2Constants.SPEC_2006_08.SEC_NS_URI;
- }
-
- return null;
- }
-
- public static String getFaultAction (String addressingNamespace) {
- if (AddressingConstants.Final.WSA_NAMESPACE.equals(addressingNamespace))
- return AddressingConstants.Final.WSA_FAULT_ACTION;
- else if (AddressingConstants.Submission.WSA_NAMESPACE.equals(addressingNamespace))
- return AddressingConstants.Submission.WSA_FAULT_ACTION;
-
- return null;
- }
-
-}
+/*
+ * Copyright 1999-2004 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.sandesha2.util;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * To get values which are different in the RM specs in a convenient manner.
+ */
+
+public class SpecSpecificConstants {
+
+
+ public static String getSpecVersionString (String namespaceValue) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceValue))
+ return Sandesha2Constants.SPEC_VERSIONS.v1_0;
+ else if (Sandesha2Constants.SPEC_2006_08.NS_URI.equals(namespaceValue))
+ return Sandesha2Constants.SPEC_VERSIONS.v1_1;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ namespaceValue));
+ }
+
+ public static String getRMNamespaceValue (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.NS_URI;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.NS_URI;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getCreateSequenceAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_CREATE_SEQUENCE;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CREATE_SEQUENCE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getCreateSequenceResponseAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_CREATE_SEQUENCE_RESPONSE;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CREATE_SEQUENCE_RESPONSE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getTerminateSequenceAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_TERMINATE_SEQUENCE;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_TERMINATE_SEQUENCE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getTerminateSequenceResponseAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_TERMINATE_SEQUENCE_RESPONSE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec));
+ }
+
+ public static String getCloseSequenceAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSequenceSpecLevel,
+ specVersion));
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CLOSE_SEQUENCE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getCloseSequenceResponseAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSequenceSpecLevel,
+ specVersion));
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CLOSE_SEQUENCE_RESPONSE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getAckRequestAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return null; //No action defined for ackRequests
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_ACK_REQUEST;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getSequenceAcknowledgementAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.ACTION_SEQUENCE_ACKNOWLEDGEMENT;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_SEQUENCE_ACKNOWLEDGEMENT;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getMakeConnectionAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion)) {
+ String message = "MakeConnection is not supported in this RM version";
+ throw new SandeshaException (message);
+ }
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.ACTION_MAKE_CONNECTION;
+ else {
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+ }
+
+ public static String getCreateSequenceSOAPAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_CREATE_SEQUENCE;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_CREATE_SEQUENCE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getCreateSequenceResponseSOAPAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_CREATE_SEQUENCE_RESPONSE;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_CREATE_SEQUENCE_RESPONSE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getTerminateSequenceSOAPAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_TERMINATE_SEQUENCE;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_TERMINATE_SEQUENCE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getTerminateSequenceResponseSOAPAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_TERMINATE_SEQUENCE_RESPONSE;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getAckRequestSOAPAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ throw new SandeshaException ("this spec version does not define a ackRequest SOAP action");
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_ACK_REQUEST;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getSequenceAcknowledgementSOAPAction (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_SEQUENCE_ACKNOWLEDGEMENT;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return Sandesha2Constants.SPEC_2006_08.Actions.SOAP_ACTION_SEQUENCE_ACKNOWLEDGEMENT;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static boolean isTerminateSequenceResponseRequired (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return false;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return true;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static boolean isLastMessageIndicatorRequired (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return true;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return false;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static boolean isAckFinalAllowed (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return false;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return true;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static boolean isAckNoneAllowed (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return false;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return true;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static boolean isSequenceClosingAllowed (String specVersion) throws SandeshaException {
+ if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion))
+ return false;
+ else if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion))
+ return true;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ specVersion));
+ }
+
+ public static String getDefaultSpecVersion () {
+ return Sandesha2Constants.SPEC_VERSIONS.v1_0;
+ }
+
+ public static String getAddressingAnonymousURI (String addressingNSURI) throws SandeshaException {
+ if (AddressingConstants.Submission.WSA_NAMESPACE.equals(addressingNSURI))
+ return AddressingConstants.Submission.WSA_ANONYMOUS_URL;
+ else if (AddressingConstants.Final.WSA_NAMESPACE.equals(addressingNSURI))
+ return AddressingConstants.Final.WSA_ANONYMOUS_URL;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownWSAVersion,
+ addressingNSURI));
+ }
+
+ public static String getAddressingFaultAction (String addressingNSURI) throws SandeshaException {
+ if (AddressingConstants.Submission.WSA_NAMESPACE.equals(addressingNSURI))
+ return "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault"; //this is not available in addressing constants )-:
+ else if (AddressingConstants.Final.WSA_NAMESPACE.equals(addressingNSURI))
+ return AddressingConstants.Final.WSA_FAULT_ACTION;
+ else
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownWSAVersion,
+ addressingNSURI));
+ }
+
+ public static String getSecurityNamespace (String rmNamespace) {
+ if(rmNamespace.equals(Sandesha2Constants.SPEC_2005_02.NS_URI)) {
+ return Sandesha2Constants.SPEC_2005_02.SEC_NS_URI;
+ }
+
+ if(rmNamespace.equals(Sandesha2Constants.SPEC_2006_08.NS_URI)) {
+ return Sandesha2Constants.SPEC_2006_08.SEC_NS_URI;
+ }
+
+ return null;
+ }
+
+ public static String getFaultAction (String addressingNamespace) {
+ if (AddressingConstants.Final.WSA_NAMESPACE.equals(addressingNamespace))
+ return AddressingConstants.Final.WSA_FAULT_ACTION;
+ else if (AddressingConstants.Submission.WSA_NAMESPACE.equals(addressingNamespace))
+ return AddressingConstants.Submission.WSA_FAULT_ACTION;
+
+ return null;
+ }
+
+ public static AxisOperation getWSRMOperation(int messageType, String rmSpecLevel, AxisService service)
+ throws SandeshaException
+ {
+ // This table needs to be kept in sync with the operations defined in the
+ // sandesha module.xml. The module.xml defintions are used to identify
+ // messages as they come into the server, and this table us used to pick
+ // the correct operation as we make invocations. Because of this, the
+ // tables are opposites of one another.
+ AxisOperation result = null;
+ if(rmSpecLevel.equals(Sandesha2Constants.SPEC_VERSIONS.v1_0)) {
+ switch(messageType) {
+ case Sandesha2Constants.MessageTypes.CREATE_SEQ:
+ result = service.getOperation(new QName("RMOutInOperation"));
+ break;
+ case Sandesha2Constants.MessageTypes.TERMINATE_SEQ:
+ case Sandesha2Constants.MessageTypes.ACK:
+ case Sandesha2Constants.MessageTypes.ACK_REQUEST:
+ case Sandesha2Constants.MessageTypes.LAST_MESSAGE:
+ result = service.getOperation(new QName("RMOutOnlyOperation"));
+ break;
+ }
+ } else if(rmSpecLevel.equals(Sandesha2Constants.SPEC_VERSIONS.v1_1)) {
+ switch(messageType) {
+ case Sandesha2Constants.MessageTypes.CREATE_SEQ:
+ case Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE:
+ case Sandesha2Constants.MessageTypes.TERMINATE_SEQ:
+ result = service.getOperation(new QName("RMOutInOperation"));
+ break;
+ case Sandesha2Constants.MessageTypes.ACK:
+ case Sandesha2Constants.MessageTypes.ACK_REQUEST:
+ case Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG:
+ result = service.getOperation(new QName("RMOutOnlyOperation"));
+ break;
+ }
+ }
+
+ if(result == null) {
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.couldNotFindOperation,
+ Integer.toString(messageType), rmSpecLevel);
+ throw new SandeshaException(message);
+ }
+
+ return result;
+ }
+
+}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java?view=diff&rev=469167&r1=469166&r2=469167
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java Mon Oct 30 07:43:24 2006
@@ -1,312 +1,313 @@
-/*
- * Copyright 1999-2004 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.sandesha2.workers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Random;
-
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.engine.AxisEngine;
-import org.apache.axis2.util.threadpool.ThreadFactory;
-import org.apache.axis2.util.threadpool.ThreadPool;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.sandesha2.RMMsgContext;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-import org.apache.sandesha2.storage.StorageManager;
-import org.apache.sandesha2.storage.Transaction;
-import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
-import org.apache.sandesha2.storage.beans.InvokerBean;
-import org.apache.sandesha2.storage.beans.NextMsgBean;
-import org.apache.sandesha2.storage.beans.SequencePropertyBean;
-import org.apache.sandesha2.util.MsgInitializer;
-import org.apache.sandesha2.util.SandeshaUtil;
-import org.apache.sandesha2.util.TerminateManager;
-import org.apache.sandesha2.wsrm.Sequence;
-
-/**
- * This is used when InOrder invocation is required. This is a seperated Thread
- * that keep running all the time. At each iteration it checks the InvokerTable
- * to find weather there are any messages to me invoked.
- */
-
-public class Invoker extends Thread {
-
- private boolean runInvoker = false;
- private ArrayList workingSequences = new ArrayList();
- private ConfigurationContext context = null;
- private static final Log log = LogFactory.getLog(Invoker.class);
- private boolean hasStopped = false;
-
- private transient ThreadFactory threadPool;
- public int INVOKER_THREADPOOL_SIZE = 5;
-
- private WorkerLock lock = null;
-
- public Invoker() {
- threadPool = new ThreadPool(INVOKER_THREADPOOL_SIZE,
- INVOKER_THREADPOOL_SIZE);
- lock = new WorkerLock ();
- }
-
- public synchronized void stopInvokerForTheSequence(String sequenceID) {
- if (log.isDebugEnabled())
- log.debug("Enter: InOrderInvoker::stopInvokerForTheSequence, "
- + sequenceID);
-
- workingSequences.remove(sequenceID);
- if (workingSequences.size() == 0) {
- runInvoker = false;
- }
-
- if (log.isDebugEnabled())
- log.debug("Exit: InOrderInvoker::stopInvokerForTheSequence");
- }
-
- public synchronized void stopInvoking() {
- if (log.isDebugEnabled())
- log.debug("Enter: InOrderInvoker::stopInvoking");
-
- if (isInvokerStarted()) {
- // the invoker is started so stop it
- runInvoker = false;
- // wait for it to finish
- while (!hasStoppedInvoking()) {
- try {
- wait(Sandesha2Constants.INVOKER_SLEEP_TIME);
- } catch (InterruptedException e1) {
- log.debug(e1.getMessage());
- }
- }
- }
-
- if (log.isDebugEnabled())
- log.debug("Exit: InOrderInvoker::stopInvoking");
- }
-
- public synchronized boolean isInvokerStarted() {
- if (log.isDebugEnabled()) {
- log.debug("Enter: InOrderInvoker::isInvokerStarted");
- log.debug("Exit: InOrderInvoker::isInvokerStarted, " + runInvoker);
- }
- return runInvoker;
- }
-
- public synchronized void runInvokerForTheSequence(
- ConfigurationContext context, String sequenceID) {
- if (log.isDebugEnabled())
- log.debug("Enter: InOrderInvoker::runInvokerForTheSequence");
-
- if (!workingSequences.contains(sequenceID))
- workingSequences.add(sequenceID);
-
- if (!isInvokerStarted()) {
- this.context = context;
- runInvoker = true; // so that isSenderStarted()=true.
- super.start();
- }
- if (log.isDebugEnabled())
- log.debug("Exit: InOrderInvoker::runInvokerForTheSequence");
- }
-
- private synchronized boolean hasStoppedInvoking() {
- if (log.isDebugEnabled()) {
- log.debug("Enter: InOrderInvoker::hasStoppedInvoking");
- log
- .debug("Exit: InOrderInvoker::hasStoppedInvoking, "
- + hasStopped);
- }
- return hasStopped;
- }
-
- public void run() {
- if (log.isDebugEnabled())
- log.debug("Enter: InOrderInvoker::run");
-
- try {
- internalRun();
- } finally {
- // flag that we have exited the run loop and notify any waiting
- // threads
- synchronized (this) {
- hasStopped = true;
- notify();
- }
- }
-
- if (log.isDebugEnabled())
- log.debug("Exit: InOrderInvoker::run");
- }
-
- private void internalRun() {
- if (log.isDebugEnabled())
- log.debug("Enter: InOrderInvoker::internalRun");
-
- // If this invoker is working for several sequences, we use round-robin to
- // try and give them all a chance to invoke messages.
- int nextIndex = 0;
-
- while (isInvokerStarted()) {
-
- try {
- Thread.sleep(Sandesha2Constants.INVOKER_SLEEP_TIME);
- } catch (InterruptedException ex) {
- log.debug("Invoker was Inturrepted....");
- log.debug(ex.getMessage());
- }
-
- Transaction transaction = null;
- boolean rolebacked = false;
-
- try {
- StorageManager storageManager = SandeshaUtil
- .getSandeshaStorageManager(context, context
- .getAxisConfiguration());
- NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
-
- InvokerBeanMgr storageMapMgr = storageManager
- .getStorageMapBeanMgr();
-
- SequencePropertyBeanMgr sequencePropMgr = storageManager
- .getSequencePropertyBeanMgr();
-
- transaction = storageManager.getTransaction();
-
- // Getting the incomingSequenceIdList
- SequencePropertyBean allSequencesBean = sequencePropMgr
- .retrieve(
- Sandesha2Constants.SequenceProperties.ALL_SEQUENCES,
- Sandesha2Constants.SequenceProperties.INCOMING_SEQUENCE_LIST);
-
- if (allSequencesBean == null) {
- if (log.isDebugEnabled())
- log.debug("AllSequencesBean not found");
- continue;
- }
-
- // Pick a sequence using a round-robin approach
- ArrayList allSequencesList = SandeshaUtil
- .getArrayListFromString(allSequencesBean.getValue());
- int size = allSequencesList.size();
- if(nextIndex >= size) {
- nextIndex = 0;
- if (size == 0) continue;
- }
- String sequenceId = (String) allSequencesList.get(nextIndex++);
-
-
- NextMsgBean nextMsgBean = nextMsgMgr.retrieve(sequenceId);
- if (nextMsgBean == null) {
- String message = "Next message not set correctly. Removing invalid entry.";
- log.debug(message);
-
- allSequencesList.remove(size);
-
- // cleaning the invalid data of the all sequences.
- allSequencesBean.setValue(allSequencesList.toString());
- sequencePropMgr.update(allSequencesBean);
- continue;
- }
-
- long nextMsgno = nextMsgBean.getNextMsgNoToProcess();
- if (nextMsgno <= 0) {
- if (log.isDebugEnabled())
- log.debug("Invalid Next Message Number " + nextMsgno);
- String message = SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.invalidMsgNumber, Long
- .toString(nextMsgno));
- throw new SandeshaException(message);
- }
-
- Iterator stMapIt = storageMapMgr.find(
- new InvokerBean(null, nextMsgno, sequenceId))
- .iterator();
-
-
- //TODO correct the locking mechanism to have one lock per sequence.
-
- if (stMapIt.hasNext()) { //the next Msg entry is present.
-
- String workId = sequenceId + "::" + nextMsgno; //creating a workId to uniquely identify the
- //piece of work that will be assigned to the Worker.
-
- //check weather the bean is already assigned to a worker.
- if (lock.isWorkPresent(workId)) {
- String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.workAlreadyAssigned, workId);
- log.debug(message);
- continue;
- }
-
- InvokerBean bean = (InvokerBean) stMapIt.next();
- String messageContextKey = bean.getMessageContextRefKey();
-
- transaction.commit();
-
- // start a new worker thread and let it do the invocation.
- InvokerWorker worker = new InvokerWorker(context,messageContextKey);
-
- worker.setLock(lock);
- worker.setWorkId(workId);
-
- threadPool.execute(worker);
-
- //adding the workId to the lock after assigning it to a thread makes sure
- //that all the workIds in the Lock are handled by threads.
- lock.addWork(workId);
- }
-
- } catch (Exception e) {
- if (transaction != null) {
- try {
- transaction.rollback();
- rolebacked = true;
- } catch (Exception e1) {
- String message = SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.rollbackError, e1
- .toString());
- log.debug(message, e1);
- }
- }
- String message = SandeshaMessageHelper
- .getMessage(SandeshaMessageKeys.invokeMsgError);
- log.debug(message, e);
- } finally {
- if (!rolebacked && transaction != null) {
- try {
- transaction.commit();
- } catch (Exception e) {
- String message = SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.commitError, e.toString());
- log.debug(message, e);
- }
- }
- }
- }
- if (log.isDebugEnabled())
- log.debug("Exit: InOrderInvoker::internalRun");
- }
-
-}
+/*
+ * Copyright 1999-2004 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.sandesha2.workers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Random;
+
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.util.threadpool.ThreadFactory;
+import org.apache.axis2.util.threadpool.ThreadPool;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.RMMsgContext;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+import org.apache.sandesha2.storage.StorageManager;
+import org.apache.sandesha2.storage.Transaction;
+import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.beans.InvokerBean;
+import org.apache.sandesha2.storage.beans.NextMsgBean;
+import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.util.MsgInitializer;
+import org.apache.sandesha2.util.SandeshaUtil;
+import org.apache.sandesha2.util.TerminateManager;
+import org.apache.sandesha2.wsrm.Sequence;
+
+/**
+ * This is used when InOrder invocation is required. This is a seperated Thread
+ * that keep running all the time. At each iteration it checks the InvokerTable
+ * to find weather there are any messages to me invoked.
+ */
+
+public class Invoker extends Thread {
+
+ private boolean runInvoker = false;
+ private ArrayList workingSequences = new ArrayList();
+ private ConfigurationContext context = null;
+ private static final Log log = LogFactory.getLog(Invoker.class);
+ private boolean hasStopped = false;
+
+ private transient ThreadFactory threadPool;
+ public int INVOKER_THREADPOOL_SIZE = 5;
+
+ private WorkerLock lock = null;
+
+ public Invoker() {
+ threadPool = new ThreadPool(INVOKER_THREADPOOL_SIZE,
+ INVOKER_THREADPOOL_SIZE);
+ lock = new WorkerLock ();
+ }
+
+ public synchronized void stopInvokerForTheSequence(String sequenceID) {
+ if (log.isDebugEnabled())
+ log.debug("Enter: InOrderInvoker::stopInvokerForTheSequence, "
+ + sequenceID);
+
+ workingSequences.remove(sequenceID);
+ if (workingSequences.size() == 0) {
+ runInvoker = false;
+ }
+
+ if (log.isDebugEnabled())
+ log.debug("Exit: InOrderInvoker::stopInvokerForTheSequence");
+ }
+
+ public synchronized void stopInvoking() {
+ if (log.isDebugEnabled())
+ log.debug("Enter: InOrderInvoker::stopInvoking");
+
+ if (isInvokerStarted()) {
+ // the invoker is started so stop it
+ runInvoker = false;
+ // wait for it to finish
+ while (!hasStoppedInvoking()) {
+ try {
+ wait(Sandesha2Constants.INVOKER_SLEEP_TIME);
+ } catch (InterruptedException e1) {
+ log.debug(e1.getMessage());
+ }
+ }
+ }
+
+ if (log.isDebugEnabled())
+ log.debug("Exit: InOrderInvoker::stopInvoking");
+ }
+
+ public synchronized boolean isInvokerStarted() {
+ if (log.isDebugEnabled()) {
+ log.debug("Enter: InOrderInvoker::isInvokerStarted");
+ log.debug("Exit: InOrderInvoker::isInvokerStarted, " + runInvoker);
+ }
+ return runInvoker;
+ }
+
+ public synchronized void runInvokerForTheSequence(
+ ConfigurationContext context, String sequenceID) {
+ if (log.isDebugEnabled())
+ log.debug("Enter: InOrderInvoker::runInvokerForTheSequence");
+
+ if (!workingSequences.contains(sequenceID))
+ workingSequences.add(sequenceID);
+
+ if (!isInvokerStarted()) {
+ this.context = context;
+ runInvoker = true; // so that isSenderStarted()=true.
+ super.start();
+ }
+ if (log.isDebugEnabled())
+ log.debug("Exit: InOrderInvoker::runInvokerForTheSequence");
+ }
+
+ private synchronized boolean hasStoppedInvoking() {
+ if (log.isDebugEnabled()) {
+ log.debug("Enter: InOrderInvoker::hasStoppedInvoking");
+ log
+ .debug("Exit: InOrderInvoker::hasStoppedInvoking, "
+ + hasStopped);
+ }
+ return hasStopped;
+ }
+
+ public void run() {
+ if (log.isDebugEnabled())
+ log.debug("Enter: InOrderInvoker::run");
+
+ try {
+ internalRun();
+ } finally {
+ // flag that we have exited the run loop and notify any waiting
+ // threads
+ synchronized (this) {
+ hasStopped = true;
+ notify();
+ }
+ }
+
+ if (log.isDebugEnabled())
+ log.debug("Exit: InOrderInvoker::run");
+ }
+
+ private void internalRun() {
+ if (log.isDebugEnabled())
+ log.debug("Enter: InOrderInvoker::internalRun");
+
+ // If this invoker is working for several sequences, we use round-robin to
+ // try and give them all a chance to invoke messages.
+ int nextIndex = 0;
+
+ while (isInvokerStarted()) {
+
+ try {
+ Thread.sleep(Sandesha2Constants.INVOKER_SLEEP_TIME);
+ } catch (InterruptedException ex) {
+ log.debug("Invoker was Inturrepted....");
+ log.debug(ex.getMessage());
+ }
+
+ Transaction transaction = null;
+ boolean rolebacked = false;
+
+ try {
+ StorageManager storageManager = SandeshaUtil
+ .getSandeshaStorageManager(context, context
+ .getAxisConfiguration());
+ NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
+
+ InvokerBeanMgr storageMapMgr = storageManager
+ .getStorageMapBeanMgr();
+
+ SequencePropertyBeanMgr sequencePropMgr = storageManager
+ .getSequencePropertyBeanMgr();
+
+ transaction = storageManager.getTransaction();
+
+ // Getting the incomingSequenceIdList
+ SequencePropertyBean allSequencesBean = sequencePropMgr
+ .retrieve(
+ Sandesha2Constants.SequenceProperties.ALL_SEQUENCES,
+ Sandesha2Constants.SequenceProperties.INCOMING_SEQUENCE_LIST);
+
+ if (allSequencesBean == null) {
+ if (log.isDebugEnabled())
+ log.debug("AllSequencesBean not found");
+ continue;
+ }
+
+ // Pick a sequence using a round-robin approach
+ ArrayList allSequencesList = SandeshaUtil
+ .getArrayListFromString(allSequencesBean.getValue());
+ int size = allSequencesList.size();
+ log.debug("Choosing one from " + size + " sequences");
+ if(nextIndex >= size) {
+ nextIndex = 0;
+ if (size == 0) continue;
+ }
+ String sequenceId = (String) allSequencesList.get(nextIndex++);
+ log.debug("Chose sequence " + sequenceId);
+
+ NextMsgBean nextMsgBean = nextMsgMgr.retrieve(sequenceId);
+ if (nextMsgBean == null) {
+ String message = "Next message not set correctly. Removing invalid entry.";
+ log.debug(message);
+
+ allSequencesList.remove(size);
+
+ // cleaning the invalid data of the all sequences.
+ allSequencesBean.setValue(allSequencesList.toString());
+ sequencePropMgr.update(allSequencesBean);
+ continue;
+ }
+
+ long nextMsgno = nextMsgBean.getNextMsgNoToProcess();
+ if (nextMsgno <= 0) {
+ if (log.isDebugEnabled())
+ log.debug("Invalid Next Message Number " + nextMsgno);
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.invalidMsgNumber, Long
+ .toString(nextMsgno));
+ throw new SandeshaException(message);
+ }
+
+ Iterator stMapIt = storageMapMgr.find(
+ new InvokerBean(null, nextMsgno, sequenceId))
+ .iterator();
+
+
+ //TODO correct the locking mechanism to have one lock per sequence.
+
+ if (stMapIt.hasNext()) { //the next Msg entry is present.
+
+ String workId = sequenceId + "::" + nextMsgno; //creating a workId to uniquely identify the
+ //piece of work that will be assigned to the Worker.
+
+ //check weather the bean is already assigned to a worker.
+ if (lock.isWorkPresent(workId)) {
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.workAlreadyAssigned, workId);
+ log.debug(message);
+ continue;
+ }
+
+ InvokerBean bean = (InvokerBean) stMapIt.next();
+ String messageContextKey = bean.getMessageContextRefKey();
+
+ transaction.commit();
+
+ // start a new worker thread and let it do the invocation.
+ InvokerWorker worker = new InvokerWorker(context,messageContextKey);
+
+ worker.setLock(lock);
+ worker.setWorkId(workId);
+
+ threadPool.execute(worker);
+
+ //adding the workId to the lock after assigning it to a thread makes sure
+ //that all the workIds in the Lock are handled by threads.
+ lock.addWork(workId);
+ }
+
+ } catch (Exception e) {
+ if (transaction != null) {
+ try {
+ transaction.rollback();
+ rolebacked = true;
+ } catch (Exception e1) {
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.rollbackError, e1
+ .toString());
+ log.debug(message, e1);
+ }
+ }
+ String message = SandeshaMessageHelper
+ .getMessage(SandeshaMessageKeys.invokeMsgError);
+ log.debug(message, e);
+ } finally {
+ if (!rolebacked && transaction != null) {
+ try {
+ transaction.commit();
+ } catch (Exception e) {
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.commitError, e.toString());
+ log.debug(message, e);
+ }
+ }
+ }
+ }
+ if (log.isDebugEnabled())
+ log.debug("Exit: InOrderInvoker::internalRun");
+ }
+
+}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InvokerWorker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InvokerWorker.java?view=diff&rev=469167&r1=469166&r2=469167
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InvokerWorker.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InvokerWorker.java Mon Oct 30 07:43:24 2006
@@ -34,6 +34,7 @@
}
public void run() {
+ if(log.isDebugEnabled()) log.debug("Entry: InvokerWorker::run");
Transaction transaction = null;
MessageContext msgToInvoke = null;
@@ -170,6 +171,8 @@
lock.removeWork(workId);
}
}
+
+ if(log.isDebugEnabled()) log.debug("Exit: InvokerWorker::run");
}
private void makeMessageReadyForReinjection(MessageContext messageContext) {
Modified: webservices/sandesha/trunk/java/test-resources/client_mtom_axis2.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test-resources/client_mtom_axis2.xml?view=diff&rev=469167&r1=469166&r2=469167
==============================================================================
--- webservices/sandesha/trunk/java/test-resources/client_mtom_axis2.xml (original)
+++ webservices/sandesha/trunk/java/test-resources/client_mtom_axis2.xml Mon Oct 30 07:43:24 2006
@@ -106,6 +106,10 @@
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
@@ -145,6 +149,10 @@
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.engine.RequestURIOperationDispatcher">
<order phase="Dispatch"/>
</handler>
Modified: webservices/sandesha/trunk/java/test-resources/server_mtom_axis2.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test-resources/server_mtom_axis2.xml?view=diff&rev=469167&r1=469166&r2=469167
==============================================================================
--- webservices/sandesha/trunk/java/test-resources/server_mtom_axis2.xml (original)
+++ webservices/sandesha/trunk/java/test-resources/server_mtom_axis2.xml Mon Oct 30 07:43:24 2006
@@ -104,6 +104,10 @@
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
@@ -143,6 +147,10 @@
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.engine.RequestURIOperationDispatcher">
<order phase="Dispatch"/>
</handler>
Modified: webservices/sandesha/trunk/java/test-resources/test.module.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test-resources/test.module.xml?view=diff&rev=469167&r1=469166&r2=469167
==============================================================================
--- webservices/sandesha/trunk/java/test-resources/test.module.xml (original)
+++ webservices/sandesha/trunk/java/test-resources/test.module.xml Mon Oct 30 07:43:24 2006
@@ -1,124 +1,127 @@
-<!-- THIS IS A TEST RESOURCE - the correct module.xml file can be found in the 'config' directory. -->
-
-<module name="sandesha2" class="org.apache.sandesha2.SandeshaModule">
-
- <Description>
- This module implements WS-ReliableMessaging for Axis2. This implements both the WSRM submitted spec and the new spec being developed under the OASIS WSRX group.
- </Description>
-
- <inflow>
- <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
- <!-- Global In handler should come before instance dispatching -->
- <order phase="Dispatch" before="InstanceDispatcher" />
- </handler>
- <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
- <order phase="RMPhase"/>
- </handler>
- </inflow>
-
- <outflow>
- <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
- <order phase="RMPhase"/>
- </handler>
- </outflow>
-
- <INfaultflow>
- <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
- <!-- Global In handler should come before instance dispatching -->
- <order phase="Dispatch" before="InstanceDispatcher" />
- </handler>
- <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
- <order phase="RMPhase"/>
- </handler>
- </INfaultflow>
-
- <OUTfaultflow>
- <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
- <order phase="RMPhase"/>
- </handler>
- </OUTfaultflow>
-
- <operation name="RMInOnlyOperation" mep="http://www.w3.org/2004/08/wsdl/in-only">
- <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
-
- <!-- namespaces for the 2005-02 spec -->
-
- <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</actionMapping>
- <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</actionMapping>
- <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse</actionMapping>
-
- <!-- namespaces for the 2006-08 spec -->
-
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/SequenceAcknowledgement</actionMapping>
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/CreateSequenceResponse</actionMapping>
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/AckRequested</actionMapping>
- </operation>
-
- <operation name="RMInOutOperation" mep="http://www.w3.org/2004/08/wsdl/in-out">
- <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
-
- <!-- namespaces for the 2005-02 spec -->
- <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</actionMapping>
-
- <!-- namespaces for the 2006-08 spec -->
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/CreateSequence</actionMapping>
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/TerminateSequence</actionMapping>
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/CloseSequence</actionMapping>
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/TerminateSequenceResponse</actionMapping>
- <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/CloseSequenceResponse</actionMapping>
-
- </operation>
-
- <!-- Database connection parameters -->
- <parameter name="sandesha2.db.conn.id" locked="false">jdbc:derby:SANDESHA2DB;create=true</parameter>
- <parameter name="sandesha2.db.driver" locked="false">org.apache.derby.jdbc.EmbeddedDriver</parameter>
- <parameter name="sandesha2.db.sql.dialect" locked="false">org.hibernate.dialect.DerbyDialect</parameter>
- <parameter name="sandesha2.db.username" locked="false"></parameter>
- <parameter name="sandesha2.db.password" locked="false"></parameter>
- <parameter name="sandesha2.db.create.mode" locked="false">update</parameter>
-
- <supported-policy-namespaces namespaces="http://ws.apache.org/sandesha2/policy" />
-
- <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- xmlns:wsrm="http://ws.apache.org/sandesha2/policy" wsu:Id="RMPolicy">
- <wsrm:RMAssertion>
- <wsp:Policy>
- <wsrm:AcknowledgementInterval>3000</wsrm:AcknowledgementInterval>
-
- <wsrm:RetransmissionInterval>6000</wsrm:RetransmissionInterval>
-
- <!-- '-1' conveys that there is no limit to the max. number of retransmissions.-->
- <wsrm:MaximumRetransmissionCount>10</wsrm:MaximumRetransmissionCount>
-
- <wsrm:ExponentialBackoff>false</wsrm:ExponentialBackoff>
-
- <wsrm:InactivityTimeout>60</wsrm:InactivityTimeout>
-
- <wsrm:InactivityTimeoutMeasure>seconds</wsrm:InactivityTimeoutMeasure>
-
- <wsrm:InvokeInOrder>true</wsrm:InvokeInOrder>
-
- <!-- These will not be overriden by service level policies -->
- <wsrm:MessageTypesToDrop>none</wsrm:MessageTypesToDrop>
-
- <!-- This will not be overriden by service level policies -->
- <wsrm:StorageManagers>
-
- <wsrm:InMemoryStorageManager>
- org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
- </wsrm:InMemoryStorageManager>
-
- <wsrm:PermanentStorageManager>
- org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
- </wsrm:PermanentStorageManager>
-
- </wsrm:StorageManagers>
-
- <!-- This will not be overriden by service level policies -->
- <wsrm:SecurityManager>org.apache.sandesha2.security.UnitTestSecurityManager</wsrm:SecurityManager>
- </wsp:Policy>
- </wsrm:RMAssertion>
- </wsp:Policy>
-
-</module>
+<!-- THIS IS A TEST RESOURCE - the correct module.xml file can be found in the 'config' directory. -->
+
+<module name="sandesha2" class="org.apache.sandesha2.SandeshaModule">
+
+ <Description>
+ This module implements WS-ReliableMessaging for Axis2. This implements both the WSRM submitted spec and the new spec being developed under the OASIS WSRX group.
+ </Description>
+
+ <InFlow>
+ <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
+ <!-- Global In handler should come before instance dispatching -->
+ <order phase="Dispatch" before="InstanceDispatcher" />
+ </handler>
+ <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
+ <order phase="RMPhase"/>
+ </handler>
+ </InFlow>
+
+ <OutFlow>
+ <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
+ <order phase="RMPhase"/>
+ </handler>
+ </OutFlow>
+
+ <InFaultFlow>
+ <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
+ <!-- Global In handler should come before instance dispatching -->
+ <order phase="Dispatch" before="InstanceDispatcher" />
+ </handler>
+ <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
+ <order phase="RMPhase"/>
+ </handler>
+ </InFaultFlow>
+
+ <OutFaultFlow>
+ <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
+ <order phase="RMPhase"/>
+ </handler>
+ </OutFaultFlow>
+
+ <operation name="RMInOnlyOperation" mep="http://www.w3.org/2004/08/wsdl/in-only">
+ <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+
+ <!-- namespaces for the 2005-02 spec -->
+ <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</actionMapping>
+ <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</actionMapping>
+ <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested</actionMapping>
+ <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage</actionMapping>
+
+ <!-- namespaces for the 2006-08 spec -->
+ <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/SequenceAcknowledgement</actionMapping>
+ <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/AckRequested</actionMapping>
+ <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/MakeConnection</actionMapping>
+ </operation>
+
+ <operation name="RMInOutOperation" mep="http://www.w3.org/2004/08/wsdl/in-out">
+ <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+
+ <!-- namespaces for the 2005-02 spec -->
+ <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</actionMapping>
+
+ <!-- namespaces for the 2006-08 spec -->
+ <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/CreateSequence</actionMapping>
+ <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/CloseSequence</actionMapping>
+ <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200608/TerminateSequence</actionMapping>
+ </operation>
+
+ <operation name="RMOutOnlyOperation" mep="http://www.w3.org/2004/08/wsdl/out-only">
+ <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+ </operation>
+ <operation name="RMOutInOperation" mep="http://www.w3.org/2004/08/wsdl/out-in">
+ <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+ </operation>
+
+ <!-- Database connection parameters -->
+ <parameter name="sandesha2.db.conn.id" locked="false">jdbc:derby:SANDESHA2DB;create=true</parameter>
+ <parameter name="sandesha2.db.driver" locked="false">org.apache.derby.jdbc.EmbeddedDriver</parameter>
+ <parameter name="sandesha2.db.sql.dialect" locked="false">org.hibernate.dialect.DerbyDialect</parameter>
+ <parameter name="sandesha2.db.username" locked="false"></parameter>
+ <parameter name="sandesha2.db.password" locked="false"></parameter>
+ <parameter name="sandesha2.db.create.mode" locked="false">update</parameter>
+
+ <supported-policy-namespaces namespaces="http://ws.apache.org/sandesha2/policy" />
+
+ <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ xmlns:wsrm="http://ws.apache.org/sandesha2/policy" wsu:Id="RMPolicy">
+ <wsrm:RMAssertion>
+ <wsp:Policy>
+ <wsrm:AcknowledgementInterval>3000</wsrm:AcknowledgementInterval>
+
+ <wsrm:RetransmissionInterval>6000</wsrm:RetransmissionInterval>
+
+ <!-- '-1' conveys that there is no limit to the max. number of retransmissions.-->
+ <wsrm:MaximumRetransmissionCount>10</wsrm:MaximumRetransmissionCount>
+
+ <wsrm:ExponentialBackoff>false</wsrm:ExponentialBackoff>
+
+ <wsrm:InactivityTimeout>60</wsrm:InactivityTimeout>
+
+ <wsrm:InactivityTimeoutMeasure>seconds</wsrm:InactivityTimeoutMeasure>
+
+ <wsrm:InvokeInOrder>true</wsrm:InvokeInOrder>
+
+ <!-- These will not be overriden by service level policies -->
+ <wsrm:MessageTypesToDrop>none</wsrm:MessageTypesToDrop>
+
+ <!-- This will not be overriden by service level policies -->
+ <wsrm:StorageManagers>
+
+ <wsrm:InMemoryStorageManager>
+ org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
+ </wsrm:InMemoryStorageManager>
+
+ <wsrm:PermanentStorageManager>
+ org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
+ </wsrm:PermanentStorageManager>
+
+ </wsrm:StorageManagers>
+
+ <!-- This will not be overriden by service level policies -->
+ <wsrm:SecurityManager>org.apache.sandesha2.security.UnitTestSecurityManager</wsrm:SecurityManager>
+ </wsp:Policy>
+ </wsrm:RMAssertion>
+ </wsp:Policy>
+
+</module>
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org