JBossWS SVN: r5315 - stack/metro/trunk/ant-import.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-14 08:13:42 -0500 (Fri, 14 Dec 2007)
New Revision: 5315
Modified:
stack/metro/trunk/ant-import/build-thirdparty.xml
Log:
What is the benefit of unsorted lines? Please take the time to add your stuff alphabetically.
Modified: stack/metro/trunk/ant-import/build-thirdparty.xml
===================================================================
--- stack/metro/trunk/ant-import/build-thirdparty.xml 2007-12-14 13:08:04 UTC (rev 5314)
+++ stack/metro/trunk/ant-import/build-thirdparty.xml 2007-12-14 13:13:42 UTC (rev 5315)
@@ -48,19 +48,20 @@
<get src="${jboss.repository}/jboss/jbossws-spi/${jbossws-spi}/lib/jbossws-spi.jar" dest="${thirdparty.dir}/jbossws-spi.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss42/${jbossws-jboss42}/lib/jbossws-jboss42-resources.zip" dest="${thirdparty.dir}/jbossws-jboss42-resources.zip" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j.jar" dest="${thirdparty.dir}/wsdl4j.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/common-core/${jboss-common-core}/lib/jboss-common-core.jar" dest="${thirdparty.dir}/jboss-common-core.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/common-core/${jboss-common-core}/lib/jboss-common-core-sources.jar" dest="${thirdparty.dir}/jboss-common-core-sources.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/common-logging-spi/${jboss-common-logging-spi}/lib/jboss-logging-spi.jar" dest="${thirdparty.dir}/jboss-logging-spi.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jaxr/${jboss-jaxr}/lib/juddi-service.sar" dest="${thirdparty.dir}/juddi-service.sar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jboss-javaee/${jboss-javaee}/lib/jboss-javaee.jar" dest="${thirdparty.dir}/jboss-javaee.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/junit/${junit}/lib/junit.jar" dest="${thirdparty.dir}/junit.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-impl.jar" dest="${thirdparty.dir}/jaxb-impl.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-xjc.jar" dest="${thirdparty.dir}/jaxb-xjc.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxrpc/${sun-jaxrpc}/lib/jaxrpc-api.jar" dest="${thirdparty.dir}/jaxrpc-api.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/junit/${junit}/lib/junit.jar" dest="${thirdparty.dir}/junit.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/FastInfoset.jar" dest="${thirdparty.dir}/FastInfoset.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/http.jar" dest="${thirdparty.dir}/http.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-api.jar" dest="${thirdparty.dir}/jaxws-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-ri-src.jar" dest="${thirdparty.dir}/jaxws-ri-src.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-rt.jar" dest="${thirdparty.dir}/jaxws-rt.jar" usetimestamp="true" verbose="true"/>
@@ -76,7 +77,6 @@
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/streambuffer.jar" dest="${thirdparty.dir}/streambuffer.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-servlet/${sun-servlet}/lib/servlet-api.jar" dest="${thirdparty.dir}/servlet-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/woodstox/${woodstox}/lib/wstx.jar" dest="${thirdparty.dir}/wstx.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j.jar" dest="${thirdparty.dir}/wsdl4j.jar" usetimestamp="true" verbose="true"/>
<checksum file="${int.sunri.dir}/version.properties" fileext=".md5"/>
</target>
17 years
JBossWS SVN: r5314 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/wsrm and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-14 08:08:04 -0500 (Fri, 14 Dec 2007)
New Revision: 5314
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceExt.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
Log:
refactoring
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -66,6 +66,7 @@
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.wsrm.RMAddressingConstants;
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMClientSequence;
import org.jboss.ws.extensions.wsrm.api.RMException;
@@ -515,7 +516,7 @@
// set up addressing data
RMClientSequence candidateSequence = new RMClientSequence(addressableClient, getEndpointMetaData().getConfig().getRMMetaData());
String address = getEndpointMetaData().getEndpointAddress();
- String action = RMConstant.CREATE_SEQUENCE_WSA_ACTION;
+ String action = RMAddressingConstants.CREATE_SEQUENCE_WSA_ACTION;
AddressingProperties addressingProps = null;
if (addressableClient)
{
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+
+/**
+ * Addressing constants related to WS-RM protocol
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Dec 14, 2007
+ */
+public final class RMAddressingConstants
+{
+
+ private RMAddressingConstants()
+ {
+ // instances not allowed
+ }
+
+ public static final String CREATE_SEQUENCE_WSA_ACTION;
+ public static final String CREATE_SEQUENCE_RESPONSE_WSA_ACTION;
+ public static final String CLOSE_SEQUENCE_WSA_ACTION;
+ public static final String CLOSE_SEQUENCE_RESPONSE_WSA_ACTION;
+ public static final String SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION;
+ public static final String TERMINATE_SEQUENCE_WSA_ACTION;
+ public static final String TERMINATE_SEQUENCE_RESPONSE_WSA_ACTION;
+ public static final String WSA_ANONYMOUS_URI = AddressingBuilder.getAddressingBuilder().newAddressingConstants().getAnonymousURI();
+
+ static
+ {
+ String namespaceURI = RMProvider.get().getConstants().getNamespaceURI();
+ CREATE_SEQUENCE_WSA_ACTION = namespaceURI + "/CreateSequence";
+ CREATE_SEQUENCE_RESPONSE_WSA_ACTION = namespaceURI + "/CreateSequenceResponse";
+ CLOSE_SEQUENCE_WSA_ACTION = namespaceURI + "/CloseSequence";
+ CLOSE_SEQUENCE_RESPONSE_WSA_ACTION = namespaceURI + "/CloseSequenceResponse";
+ SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION = namespaceURI + "/SequenceAcknowledgement";
+ TERMINATE_SEQUENCE_WSA_ACTION = namespaceURI + "/TerminateSequence";
+ TERMINATE_SEQUENCE_RESPONSE_WSA_ACTION = namespaceURI + "/TerminateSequenceResponse";
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMAddressingConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -60,7 +60,7 @@
* @since Oct 25, 2007
*/
@SuppressWarnings("unchecked")
-public final class RMClientSequence implements RMSequenceIface, RMUnassignedMessageListener
+public final class RMClientSequence implements RMSequenceExt, RMUnassignedMessageListener
{
private static final Logger logger = Logger.getLogger(RMClientSequence.class);
private static final String PATH_PREFIX = "/temporary_listen_address/";
@@ -286,7 +286,7 @@
this.getBindingProvider().getRequestContext().put(RMConstant.REQUEST_CONTEXT, wsrmReqCtx);
List msgs = new LinkedList();
msgs.add(wsrmConstants.getCloseSequenceQName());
- sendMessage(RMConstant.CLOSE_SEQUENCE_WSA_ACTION, wsrmConstants.getCloseSequenceQName(), msgs);
+ sendMessage(RMAddressingConstants.CLOSE_SEQUENCE_WSA_ACTION, wsrmConstants.getCloseSequenceQName(), msgs);
}
public final void sendTerminateMessage()
@@ -297,7 +297,7 @@
{
msgs.add(wsrmConstants.getSequenceAcknowledgementQName());
}
- sendMessage(RMConstant.TERMINATE_SEQUENCE_WSA_ACTION, wsrmConstants.getTerminateSequenceQName(), msgs);
+ sendMessage(RMAddressingConstants.TERMINATE_SEQUENCE_WSA_ACTION, wsrmConstants.getTerminateSequenceQName(), msgs);
}
public final void sendSequenceAcknowledgementMessage()
@@ -308,7 +308,7 @@
ackRequested(false);
List msgs = new LinkedList();
msgs.add(wsrmConstants.getSequenceAcknowledgementQName());
- sendMessage(RMConstant.SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION, wsrmConstants.getSequenceAcknowledgementQName(), msgs);
+ sendMessage(RMAddressingConstants.SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION, wsrmConstants.getSequenceAcknowledgementQName(), msgs);
}
public final void setBehavior(RMIncompleteSequenceBehavior behavior)
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -2,19 +2,22 @@
import java.util.Collections;
import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Set;
import javax.xml.namespace.QName;
-import javax.xml.ws.addressing.AddressingBuilder;
import org.jboss.ws.extensions.wsrm.spi.RMConstants;
import org.jboss.ws.extensions.wsrm.spi.RMProvider;
public final class RMConstant
{
- private static final String PREFIX = RMConstant.class.getName();
+
+ private RMConstant()
+ {
+ // instances not allowed
+ }
+
+ private static final String PREFIX = "wsrm";
public static final String TARGET_ADDRESS = PREFIX + ".targetAddress";
public static final String REMOTING_VERSION = PREFIX + ".remotingVersion";
public static final String ONE_WAY_OPERATION = PREFIX + ".oneWayOperation";
@@ -29,20 +32,9 @@
public static final String SEQUENCE_REFERENCE = PREFIX + ".sequenceReference";
public static final String PROTOCOL_MESSAGES = PREFIX + ".protocolMessages";
public static final String PROTOCOL_MESSAGES_MAPPING = PREFIX + ".protocolMessagesMapping";
- // WS-Addressing related actions
- public static final String CREATE_SEQUENCE_WSA_ACTION;
- public static final String CREATE_SEQUENCE_RESPONSE_WSA_ACTION;
- public static final String CLOSE_SEQUENCE_WSA_ACTION;
- public static final String CLOSE_SEQUENCE_RESPONSE_WSA_ACTION;
- public static final String SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION;
- public static final String TERMINATE_SEQUENCE_WSA_ACTION;
- public static final String TERMINATE_SEQUENCE_RESPONSE_WSA_ACTION;
-
+ public static final String WSA_MESSAGE_ID = PREFIX + ".wsaMessageId";
public static final Set<QName> PROTOCOL_OPERATION_QNAMES;
- public static final String WSA_ANONYMOUS_URI = AddressingBuilder.getAddressingBuilder().newAddressingConstants().getAnonymousURI();
- public static final String WSA_MESSAGE_ID = PREFIX + ".wsaMessageId";
-
static
{
Set<QName> temp = new HashSet<QName>();
@@ -57,19 +49,7 @@
temp.add(constants.getCloseSequenceResponseQName());
temp.add(constants.getTerminateSequenceQName());
temp.add(constants.getTerminateSequenceResponseQName());
- String namespaceURI = RMProvider.get().getConstants().getNamespaceURI();
PROTOCOL_OPERATION_QNAMES = Collections.unmodifiableSet(temp);
- CREATE_SEQUENCE_WSA_ACTION = namespaceURI + "/CreateSequence";
- CREATE_SEQUENCE_RESPONSE_WSA_ACTION = namespaceURI + "/CreateSequenceResponse";
- CLOSE_SEQUENCE_WSA_ACTION = namespaceURI + "/CloseSequence";
- CLOSE_SEQUENCE_RESPONSE_WSA_ACTION = namespaceURI + "/CloseSequenceResponse";
- SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION = namespaceURI + "/SequenceAcknowledgement";
- TERMINATE_SEQUENCE_WSA_ACTION = namespaceURI + "/TerminateSequence";
- TERMINATE_SEQUENCE_RESPONSE_WSA_ACTION = namespaceURI + "/TerminateSequenceResponse";
}
- private RMConstant()
- {
- // no instances
- }
}
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceExt.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceExt.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceExt.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm;
+
+import java.util.Set;
+
+import org.jboss.ws.extensions.wsrm.api.RMSequence;
+
+/**
+ * An extension of the standard RM sequence
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Dec 12, 2007
+ */
+public interface RMSequenceExt extends RMSequence
+{
+ String getOutboundId();
+ String getInboundId();
+ long newMessageNumber();
+ long getLastMessageNumber();
+ long getDuration();
+ String getAcksTo();
+ Set<Long> getReceivedInboundMessages();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm;
-
-import java.util.Set;
-
-import org.jboss.ws.extensions.wsrm.api.RMSequence;
-
-/**
- * Detailed view to the sequence - not visible to API clients
- *
- * @author richard.opalka(a)jboss.com
- *
- * @since Dec 12, 2007
- */
-public interface RMSequenceIface extends RMSequence
-{
- String getOutboundId();
- long newMessageNumber();
- long getLastMessageNumber();
- String getInboundId();
- long getDuration();
- String getAcksTo();
- Set<Long> getReceivedInboundMessages();
-}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -33,6 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.extensions.wsrm.RMAddressingConstants;
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMClientSequence;
import org.jboss.ws.extensions.wsrm.api.RMException;
@@ -221,8 +222,8 @@
createSequenceMD.setOneWay(false);
// setup addressing related data
AddressingOpMetaExt createSequenceAddrExt = new AddressingOpMetaExt(new AddressingPropertiesImpl().getNamespaceURI());
- createSequenceAddrExt.setInboundAction(RMConstant.CREATE_SEQUENCE_WSA_ACTION);
- createSequenceAddrExt.setOutboundAction(RMConstant.CREATE_SEQUENCE_RESPONSE_WSA_ACTION);
+ createSequenceAddrExt.setInboundAction(RMAddressingConstants.CREATE_SEQUENCE_WSA_ACTION);
+ createSequenceAddrExt.setOutboundAction(RMAddressingConstants.CREATE_SEQUENCE_RESPONSE_WSA_ACTION);
createSequenceMD.addExtension(createSequenceAddrExt);
// register operation metadata with endpoint metadata
endpointMD.addOperation(createSequenceMD);
@@ -233,7 +234,7 @@
sequenceAcknowledgementMD.setOneWay(true);
// setup addressing related data
AddressingOpMetaExt sequenceAcknowledgementAddrExt = new AddressingOpMetaExt(new AddressingPropertiesImpl().getNamespaceURI());
- sequenceAcknowledgementAddrExt.setInboundAction(RMConstant.SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION);
+ sequenceAcknowledgementAddrExt.setInboundAction(RMAddressingConstants.SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION);
sequenceAcknowledgementMD.addExtension(sequenceAcknowledgementAddrExt);
// register operation metadata with endpoint metadata
endpointMD.addOperation(sequenceAcknowledgementMD);
@@ -244,8 +245,8 @@
closeSequenceMD.setOneWay(false);
// setup addressing related data
AddressingOpMetaExt closeSequenceAddrExt = new AddressingOpMetaExt(new AddressingPropertiesImpl().getNamespaceURI());
- closeSequenceAddrExt.setInboundAction(RMConstant.CLOSE_SEQUENCE_WSA_ACTION);
- closeSequenceAddrExt.setOutboundAction(RMConstant.CLOSE_SEQUENCE_RESPONSE_WSA_ACTION);
+ closeSequenceAddrExt.setInboundAction(RMAddressingConstants.CLOSE_SEQUENCE_WSA_ACTION);
+ closeSequenceAddrExt.setOutboundAction(RMAddressingConstants.CLOSE_SEQUENCE_RESPONSE_WSA_ACTION);
closeSequenceMD.addExtension(closeSequenceAddrExt);
// register operation metadata with endpoint metadata
endpointMD.addOperation(closeSequenceMD);
@@ -256,8 +257,8 @@
terminateSequenceMD.setOneWay(false);
// setup addressing related data
AddressingOpMetaExt terminateSequenceAddrExt = new AddressingOpMetaExt(new AddressingPropertiesImpl().getNamespaceURI());
- terminateSequenceAddrExt.setInboundAction(RMConstant.TERMINATE_SEQUENCE_WSA_ACTION);
- terminateSequenceAddrExt.setOutboundAction(RMConstant.TERMINATE_SEQUENCE_RESPONSE_WSA_ACTION);
+ terminateSequenceAddrExt.setInboundAction(RMAddressingConstants.TERMINATE_SEQUENCE_WSA_ACTION);
+ terminateSequenceAddrExt.setOutboundAction(RMAddressingConstants.TERMINATE_SEQUENCE_RESPONSE_WSA_ACTION);
terminateSequenceMD.addExtension(terminateSequenceAddrExt);
// register operation metadata with endpoint metadata
endpointMD.addOperation(terminateSequenceMD);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -36,7 +36,7 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.extensions.wsrm.RMConstant;
-import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.RMSequenceExt;
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.spi.RMConstants;
import org.jboss.ws.extensions.wsrm.spi.RMProvider;
@@ -67,7 +67,7 @@
rmOutboundContext.put(RMConstant.WSA_MESSAGE_ID, optionalMessageId);
rmOutboundContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
- RMSequenceIface sequenceImpl = (RMSequenceIface)rmOutboundContext.get(RMConstant.SEQUENCE_REFERENCE);
+ RMSequenceExt sequenceImpl = (RMSequenceExt)rmOutboundContext.get(RMConstant.SEQUENCE_REFERENCE);
// try to serialize CreateSequence to message
serialize(rmConstants.getCreateSequenceQName(), outMsgs, data, soapMessage, sequenceImpl);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -31,7 +31,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
import org.jboss.ws.extensions.wsrm.RMConstant;
-import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.RMSequenceExt;
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
@@ -51,7 +51,7 @@
return RMConstant.PROTOCOL_OPERATION_QNAMES;
}
- protected final void serialize(QName msgQN, List<QName> outMsgs, Map<QName, RMSerializable> data, SOAPMessage soapMessage, RMSequenceIface seq)
+ protected final void serialize(QName msgQN, List<QName> outMsgs, Map<QName, RMSerializable> data, SOAPMessage soapMessage, RMSequenceExt seq)
{
RMSerializable msg = RMHandlerHelper.prepareData(msgQN, outMsgs, seq);
if (msg != null)
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -26,7 +26,7 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.RMSequenceExt;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
import org.jboss.ws.extensions.wsrm.spi.RMConstants;
import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
@@ -97,7 +97,7 @@
throw new IllegalArgumentException();
}
- public static RMSerializable prepareData(QName msgQN, List<QName> outMsgs, RMSequenceIface seq)
+ public static RMSerializable prepareData(QName msgQN, List<QName> outMsgs, RMSequenceExt seq)
{
if (outMsgs.contains(msgQN))
{
@@ -144,14 +144,14 @@
return null;
}
- private static RMSerializable newCreateSequence(RMSequenceIface seq)
+ private static RMSerializable newCreateSequence(RMSequenceExt seq)
{
RMCreateSequence createSequence = rmFactory.newCreateSequence();
createSequence.setAcksTo(seq.getAcksTo());
return createSequence;
}
- private static RMSerializable newCreateSequenceResponse(RMSequenceIface seq)
+ private static RMSerializable newCreateSequenceResponse(RMSequenceExt seq)
{
RMCreateSequenceResponse createSequenceResponse = rmFactory.newCreateSequenceResponse();
createSequenceResponse.setIdentifier(seq.getInboundId());
@@ -159,7 +159,7 @@
return createSequenceResponse;
}
- private static RMSerializable newCloseSequenceResponse(RMSequenceIface seq)
+ private static RMSerializable newCloseSequenceResponse(RMSequenceExt seq)
{
// construct CloseSequenceResponse object
RMCloseSequenceResponse closeSequenceResponse = rmFactory.newCloseSequenceResponse();
@@ -167,7 +167,7 @@
return closeSequenceResponse;
}
- private static RMSerializable newCloseSequence(RMSequenceIface seq)
+ private static RMSerializable newCloseSequence(RMSequenceExt seq)
{
// construct CloseSequenceResponse object
RMCloseSequence closeSequence = rmFactory.newCloseSequence();
@@ -179,7 +179,7 @@
return closeSequence;
}
- private static RMSerializable newTerminateSequence(RMSequenceIface seq)
+ private static RMSerializable newTerminateSequence(RMSequenceExt seq)
{
// construct CloseSequenceResponse object
RMTerminateSequence terminateSequence = rmFactory.newTerminateSequence();
@@ -191,7 +191,7 @@
return terminateSequence;
}
- private static RMSerializable newTerminateSequenceResponse(RMSequenceIface seq)
+ private static RMSerializable newTerminateSequenceResponse(RMSequenceExt seq)
{
// construct TerminateSequenceResponse object
RMTerminateSequenceResponse terminateSequenceResponse = rmFactory.newTerminateSequenceResponse();
@@ -199,7 +199,7 @@
return terminateSequenceResponse;
}
- private static RMSerializable newSequenceAcknowledgement(RMSequenceIface seq)
+ private static RMSerializable newSequenceAcknowledgement(RMSequenceExt seq)
{
// construct SequenceAcknowledgement object
RMSequenceAcknowledgement sequenceAcknowledgement = rmFactory.newSequenceAcknowledgement();
@@ -224,7 +224,7 @@
return sequenceAcknowledgement;
}
- private static RMSerializable newAckRequested(RMSequenceIface seq)
+ private static RMSerializable newAckRequested(RMSequenceExt seq)
{
// construct AckRequested object
RMAckRequested wsrmMsg = rmFactory.newAckRequested();
@@ -233,7 +233,7 @@
return wsrmMsg;
}
- private static RMSerializable newSequence(RMSequenceIface seq)
+ private static RMSerializable newSequence(RMSequenceExt seq)
{
// construct Sequence object
RMSequence sequence = rmFactory.newSequence();
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -36,7 +36,7 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.extensions.wsrm.RMConstant;
-import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.RMSequenceExt;
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.spi.RMConstants;
import org.jboss.ws.extensions.wsrm.spi.RMProvider;
@@ -67,7 +67,7 @@
rmOutboundContext.put(RMConstant.WSA_MESSAGE_ID, optionalMessageId);
rmOutboundContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
- RMSequenceIface sequenceImpl = (RMSequenceIface)rmOutboundContext.get(RMConstant.SEQUENCE_REFERENCE);
+ RMSequenceExt sequenceImpl = (RMSequenceExt)rmOutboundContext.get(RMConstant.SEQUENCE_REFERENCE);
// try to serialize CreateSequenceResponse to message
serialize(rmConstants.getCreateSequenceResponseQName(), outMsgs, data, soapMessage, sequenceImpl);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -39,6 +39,7 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extensions.wsrm.RMAddressingConstants;
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
@@ -206,7 +207,7 @@
addressingProps.setRelatesTo(new Relationship[] {builder.newRelationship(addrProps.getMessageID().getURI())});
try
{
- addressingProps.setAction(builder.newURI(RMConstant.SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION));
+ addressingProps.setAction(builder.newURI(RMAddressingConstants.SEQUENCE_ACKNOWLEDGEMENT_WSA_ACTION));
}
catch (URISyntaxException ignore)
{
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -28,7 +28,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
-import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.RMSequenceExt;
/**
* Server side implementation of the RM sequence
@@ -37,7 +37,7 @@
*
* @since Dec 12, 2007
*/
-public class RMServerSequence implements RMSequenceIface
+public class RMServerSequence implements RMSequenceExt
{
private static final Logger logger = Logger.getLogger(RMServerSequence.class);
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -47,25 +47,20 @@
{
private static final Properties props = new Properties();
private final String serviceURL = "http://" + getServerHost() + ":" + props.getProperty("port") + props.getProperty("path");
-
private String targetNS = "http://wsrm.jaxws.ws.test.jboss.org/";
private OneWayServiceIface proxy;
static
{
- System.out.println("FIXME [JBWS-515] Provide an initial implementation for WS-ReliableMessaging");
- System.out.println("FIXME [JBWS-1699] Implement the basic message exchange that is required for WS-RM");
- System.out.println("FIXME [JBWS-1700] Provide a comprehensive test case for WS-RM");
-
- // load test properties
- File propertiesFile = new File("resources/jaxws/wsrm/properties/RMAbstractOneWayTest.properties");
try
{
- props.load(new FileInputStream(propertiesFile));
+ props.load(
+ new FileInputStream(
+ new File("resources/jaxws/wsrm/properties/RMAbstractOneWayTest.properties")));
}
- catch (IOException ignore)
+ catch (IOException ioe)
{
- ignore.printStackTrace();
+ ioe.printStackTrace();
}
}
@@ -73,6 +68,7 @@
protected void setUp() throws Exception
{
super.setUp();
+
QName serviceName = new QName(targetNS, "OneWayService");
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
@@ -81,7 +77,8 @@
public void testOneWayMethods() throws Exception
{
- RMSequence sequence = ((RMProvider)proxy).createSequence(isClientAddressable());
+ boolean addressableClient = isClientAddressable();
+ RMSequence sequence = ((RMProvider)proxy).createSequence(addressableClient);
setAddrProps(proxy, "http://useless/action1", serviceURL);
proxy.method1();
setAddrProps(proxy, "http://useless/action2", serviceURL);
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-12-14 12:09:11 UTC (rev 5313)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-12-14 13:08:04 UTC (rev 5314)
@@ -68,14 +68,11 @@
static
{
- System.out.println("FIXME [JBWS-515] Provide an initial implementation for WS-ReliableMessaging");
- System.out.println("FIXME [JBWS-1699] Implement the basic message exchange that is required for WS-RM");
- System.out.println("FIXME [JBWS-1700] Provide a comprehensive test case for WS-RM");
- // load test properties
- File propertiesFile = new File("resources/jaxws/wsrm/properties/RMAbstractReqResTest.properties");
try
{
- props.load(new FileInputStream(propertiesFile));
+ props.load(
+ new FileInputStream(
+ new File("resources/jaxws/wsrm/properties/RMAbstractReqResTest.properties")));
}
catch (IOException ioe)
{
17 years
JBossWS SVN: r5313 - stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-14 07:09:11 -0500 (Fri, 14 Dec 2007)
New Revision: 5313
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java
Log:
remove useless code
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java 2007-12-14 12:07:04 UTC (rev 5312)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java 2007-12-14 12:09:11 UTC (rev 5313)
@@ -24,9 +24,7 @@
import static org.jboss.ws.extensions.wsrm.RMConstant.*;
import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URI;
-import java.net.URL;
import java.util.Map;
import java.util.concurrent.Callable;
@@ -56,13 +54,6 @@
this.rmRequest = rmRequest;
}
- private String addURLParameter(String urlStr, String key, String value) throws MalformedURLException
- {
- URL url = new URL(urlStr);
- urlStr += (url.getQuery() == null ? "?" : "&") + key + "=" + value;
- return urlStr;
- }
-
public RMChannelResponse call()
{
try
@@ -72,7 +63,6 @@
if (version.startsWith("1.4"))
{
- targetAddress = addURLParameter(targetAddress, InvokerLocator.DATATYPE, "JBossWSMessage");
MarshalFactory.addMarshaller("JBossWSMessage", RMMarshaller.getInstance(), RMUnMarshaller.getInstance());
}
@@ -82,7 +72,6 @@
logger.debug("[WS-RM] backport URI is: " + backPort);
RMCallbackHandler callbackHandler = null;
- // TODO: we should remember WSA:MessageId here too
if (backPort != null)
{
17 years
JBossWS SVN: r5312 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-14 07:07:04 -0500 (Fri, 14 Dec 2007)
New Revision: 5312
Modified:
stack/cxf/trunk/ant.properties.example
Log:
java.home.jdk16=/usr/java/jdk1.6
Modified: stack/cxf/trunk/ant.properties.example
===================================================================
--- stack/cxf/trunk/ant.properties.example 2007-12-14 12:06:56 UTC (rev 5311)
+++ stack/cxf/trunk/ant.properties.example 2007-12-14 12:07:04 UTC (rev 5312)
@@ -3,9 +3,6 @@
#
# $Id: ant.properties.example 3995 2007-07-26 08:52:45Z thomas.diesler(a)jboss.com $
-# JDK settings
-#java.home.jdk16=/usr/java/jdk1.6
-
# Optional JBoss Home
#jboss500.home=/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3
#jboss422.home=/home/tdiesler/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA
@@ -34,7 +31,7 @@
#force.thirdparty.get=true
# JDK settings
-#jdk6.home=/usr/java/jdk1.6
+#java.home.jdk16=/usr/java/jdk1.6
# Java Compiler options
javac.debug=yes
17 years
JBossWS SVN: r5311 - stack/metro/trunk.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-14 07:06:56 -0500 (Fri, 14 Dec 2007)
New Revision: 5311
Modified:
stack/metro/trunk/ant.properties.example
Log:
java.home.jdk16=/usr/java/jdk1.6
Modified: stack/metro/trunk/ant.properties.example
===================================================================
--- stack/metro/trunk/ant.properties.example 2007-12-14 11:59:22 UTC (rev 5310)
+++ stack/metro/trunk/ant.properties.example 2007-12-14 12:06:56 UTC (rev 5311)
@@ -3,9 +3,6 @@
#
# $Id: ant.properties.example 3995 2007-07-26 08:52:45Z thomas.diesler(a)jboss.com $
-# JDK settings
-#java.home.jdk16=/usr/java/jdk1.6
-
# Optional JBoss Home
#jboss500.home=/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3
#jboss422.home=/home/tdiesler/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA
@@ -34,7 +31,7 @@
#force.thirdparty.get=true
# JDK settings
-#jdk6.home=/usr/java/jdk1.6
+#java.home.jdk16=/usr/java/jdk1.6
# Java Compiler options
javac.debug=yes
17 years
JBossWS SVN: r5310 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/wsrm and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-14 06:59:22 -0500 (Fri, 14 Dec 2007)
New Revision: 5310
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
stack/native/trunk/src/test/resources/test-excludes-jboss405.txt
Log:
adding necessary remoting hack to enable WS-RM tests on JBoss AS 4.0.x
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-12-14 09:21:37 UTC (rev 5309)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-12-14 11:59:22 UTC (rev 5310)
@@ -196,7 +196,7 @@
{
if (RMTransportHelper.isRMMessage(callProps))
{
- RMMetadata rmMetadata = new RMMetadata(targetAddress, marshaller, unmarshaller, callProps, metadata, clientConfig);
+ RMMetadata rmMetadata = new RMMetadata(getRemotingVersion(), targetAddress, marshaller, unmarshaller, callProps, metadata, clientConfig);
return RM_CHANNEL.send(reqMessage, rmMetadata);
}
else
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-12-14 09:21:37 UTC (rev 5309)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-12-14 11:59:22 UTC (rev 5310)
@@ -16,6 +16,7 @@
{
private static final String PREFIX = RMConstant.class.getName();
public static final String TARGET_ADDRESS = PREFIX + ".targetAddress";
+ public static final String REMOTING_VERSION = PREFIX + ".remotingVersion";
public static final String ONE_WAY_OPERATION = PREFIX + ".oneWayOperation";
public static final String INVOCATION_CONTEXT = PREFIX + ".invocationContext";
public static final String MARSHALLER = PREFIX + ".marshaller";
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java 2007-12-14 09:21:37 UTC (rev 5309)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java 2007-12-14 11:59:22 UTC (rev 5310)
@@ -26,12 +26,14 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
+import java.net.URL;
import java.util.Map;
import java.util.concurrent.Callable;
import org.jboss.logging.Logger;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.ws.core.MessageTrace;
import org.jboss.ws.extensions.wsrm.RMClientSequence;
import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandler;
@@ -45,7 +47,7 @@
final class RMChannelTask implements Callable<RMChannelResponse>
{
private static final Logger logger = Logger.getLogger(RMChannelTask.class);
- private static final String JBOSSWS_SUBSYSTEM = "jbossws";
+ private static final String JBOSSWS_SUBSYSTEM = "jbossws-wsrm";
private final RMMessage rmRequest;
RMChannelTask(RMMessage rmRequest)
@@ -54,20 +56,27 @@
this.rmRequest = rmRequest;
}
+ private String addURLParameter(String urlStr, String key, String value) throws MalformedURLException
+ {
+ URL url = new URL(urlStr);
+ urlStr += (url.getQuery() == null ? "?" : "&") + key + "=" + value;
+ return urlStr;
+ }
+
public RMChannelResponse call()
{
- InvokerLocator locator = null;
try
{
- locator = new InvokerLocator((String)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT).get(TARGET_ADDRESS));
- }
- catch (MalformedURLException e)
- {
- return new RMChannelResponse(new IllegalArgumentException("Malformed endpoint address", e));
- }
+ String targetAddress = (String)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT).get(TARGET_ADDRESS);
+ String version = (String)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT).get(REMOTING_VERSION);
- try
- {
+ if (version.startsWith("1.4"))
+ {
+ targetAddress = addURLParameter(targetAddress, InvokerLocator.DATATYPE, "JBossWSMessage");
+ MarshalFactory.addMarshaller("JBossWSMessage", RMMarshaller.getInstance(), RMUnMarshaller.getInstance());
+ }
+
+ InvokerLocator locator = new InvokerLocator(targetAddress);
URI backPort = RMTransportHelper.getBackPortURI(rmRequest);
String messageId = RMTransportHelper.getAddressingMessageId(rmRequest);
@@ -85,7 +94,7 @@
}
}
boolean oneWay = RMTransportHelper.isOneWayOperation(rmRequest);
-
+
Client client = new Client(locator, JBOSSWS_SUBSYSTEM, rmRequest.getMetadata().getContext(REMOTING_CONFIGURATION_CONTEXT));
client.connect();
@@ -120,7 +129,7 @@
client.disconnect();
// trace the incomming response message
- if (rmResponse != null)
+ if ((rmResponse != null) && (backPort == null))
MessageTrace.traceMessage("Incoming RM Response Message", rmResponse.getPayload());
if (backPort != null) // TODO: backport support
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java 2007-12-14 09:21:37 UTC (rev 5309)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java 2007-12-14 11:59:22 UTC (rev 5310)
@@ -16,6 +16,7 @@
private Map<String, Map<String, Object>> contexts = new HashMap<String, Map<String, Object>>();
public RMMetadata(
+ String remotingVersion,
String targetAddress,
Marshaller marshaller,
UnMarshaller unmarshaller,
@@ -27,6 +28,7 @@
throw new IllegalArgumentException("Target address cannot be null");
invocationContext.put(RMConstant.TARGET_ADDRESS, targetAddress);
+ invocationContext.put(RMConstant.REMOTING_VERSION, remotingVersion);
setContext(RMConstant.INVOCATION_CONTEXT, invocationContext);
if (marshaller == null || unmarshaller == null)
Modified: stack/native/trunk/src/test/resources/test-excludes-jboss405.txt
===================================================================
--- stack/native/trunk/src/test/resources/test-excludes-jboss405.txt 2007-12-14 09:21:37 UTC (rev 5309)
+++ stack/native/trunk/src/test/resources/test-excludes-jboss405.txt 2007-12-14 11:59:22 UTC (rev 5310)
@@ -13,9 +13,5 @@
# [JBWS-1797] Setting .NET friendly Endpoint in web.xml
org/jboss/test/ws/jaxws/jbws1797/**
-# WS-RM tests
-org/jboss/test/ws/jaxws/wsrm/oneway/**
-org/jboss/test/ws/jaxws/wsrm/reqres/**
-
# UsernameTokenHTTPSTestCase requires keystore & trustore in jboss-web tomcat configuration
org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.*
17 years
JBossWS SVN: r5309 - stack/native/trunk/src/test/resources.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-14 04:21:37 -0500 (Fri, 14 Dec 2007)
New Revision: 5309
Modified:
stack/native/trunk/src/test/resources/test-excludes-jboss405.no.ejb3.txt
Log:
Exclude jbws1904
Modified: stack/native/trunk/src/test/resources/test-excludes-jboss405.no.ejb3.txt
===================================================================
--- stack/native/trunk/src/test/resources/test-excludes-jboss405.no.ejb3.txt 2007-12-14 07:26:04 UTC (rev 5308)
+++ stack/native/trunk/src/test/resources/test-excludes-jboss405.no.ejb3.txt 2007-12-14 09:21:37 UTC (rev 5309)
@@ -4,15 +4,10 @@
org/jboss/test/ws/jaxrpc/jbws723/**
# EJB3 compilation excludes
-org/jboss/test/ws/jaxws/wsrm/**
-org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase*
-org/jboss/test/ws/jaxws/samples/context/EndpointEJB*
-org/jboss/test/ws/jaxws/samples/retail/**
-org/jboss/test/ws/jaxws/samples/swaref/**
-org/jboss/test/ws/jaxws/samples/eardeployment/**
-org/jboss/test/ws/jaxws/samples/webserviceref/**
-org/jboss/test/ws/jaxws/samples/serviceref/*EJB*
-org/jboss/test/ws/jaxws/samples/webservice/*EJB3*
+org/jboss/test/ws/jaxws/binding/**
+org/jboss/test/ws/jaxws/jbws771/**
+org/jboss/test/ws/jaxws/jbws944/**
+org/jboss/test/ws/jaxws/jbws981/**
org/jboss/test/ws/jaxws/jbws1283/**
org/jboss/test/ws/jaxws/jbws1422/**
org/jboss/test/ws/jaxws/jbws1446/**
@@ -30,17 +25,21 @@
org/jboss/test/ws/jaxws/jbws1813/**
org/jboss/test/ws/jaxws/jbws1815/**
org/jboss/test/ws/jaxws/jbws1840/**
-org/jboss/test/ws/jaxws/jbws771/**
-org/jboss/test/ws/jaxws/jbws944/**
-org/jboss/test/ws/jaxws/jbws981/**
+org/jboss/test/ws/jaxws/jbws1904/**
org/jboss/test/ws/jaxws/namespace/**
-org/jboss/test/ws/jaxws/webserviceref/**
org/jboss/test/ws/jaxws/handlerlifecycle/**
+org/jboss/test/ws/jaxws/samples/context/**
+org/jboss/test/ws/jaxws/samples/eardeployment/**
+org/jboss/test/ws/jaxws/samples/retail/**
+org/jboss/test/ws/jaxws/samples/swaref/**
+org/jboss/test/ws/jaxws/samples/webserviceref/**
+org/jboss/test/ws/jaxws/samples/serviceref/*EJB*
+org/jboss/test/ws/jaxws/samples/webservice/*EJB3*
org/jboss/test/ws/jaxws/samples/wsaddressing/**
-org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean*
org/jboss/test/ws/jaxws/samples/wseventing/**
-org/jboss/test/ws/jaxws/samples/context/**
-org/jboss/test/ws/jaxws/binding/**
+org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean*
+org/jboss/test/ws/jaxws/webserviceref/**
+org/jboss/test/ws/jaxws/wsrm/**
# EJB3 runtime excludes
org/jboss/test/ws/interop/wsa/AddressingTestCase*
17 years
JBossWS SVN: r5308 - stack/native/trunk/src/test/resources.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-14 02:26:04 -0500 (Fri, 14 Dec 2007)
New Revision: 5308
Modified:
stack/native/trunk/src/test/resources/test-excludes-jboss405.txt
Log:
disabling WS-RM tests on AS 4.0.5 - investigation why it fails is needed
Modified: stack/native/trunk/src/test/resources/test-excludes-jboss405.txt
===================================================================
--- stack/native/trunk/src/test/resources/test-excludes-jboss405.txt 2007-12-14 06:28:41 UTC (rev 5307)
+++ stack/native/trunk/src/test/resources/test-excludes-jboss405.txt 2007-12-14 07:26:04 UTC (rev 5308)
@@ -13,5 +13,9 @@
# [JBWS-1797] Setting .NET friendly Endpoint in web.xml
org/jboss/test/ws/jaxws/jbws1797/**
+# WS-RM tests
+org/jboss/test/ws/jaxws/wsrm/oneway/**
+org/jboss/test/ws/jaxws/wsrm/reqres/**
+
# UsernameTokenHTTPSTestCase requires keystore & trustore in jboss-web tomcat configuration
org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.*
17 years
JBossWS SVN: r5307 - in stack/native/trunk/src/main/java/org/jboss/ws: extensions/wsrm and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-14 01:28:41 -0500 (Fri, 14 Dec 2007)
New Revision: 5307
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandler.java
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java
Log:
refactoring handlers
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -257,7 +257,8 @@
msgContext.setMessageAbstraction(resMessage);
}
- if ((oneway == false) || (msgContext.get(RMConstant.RESPONSE_CONTEXT) != null)) // RM hack
+ boolean isWsrmMessage = msgContext.get(RMConstant.RESPONSE_CONTEXT) != null;
+ if ((oneway == false) || (isWsrmMessage)) // RM hack
{
// call the response handler chain, removing the fault type entry will not call handleFault for that chain
handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientSequence.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -81,6 +81,7 @@
private AtomicBoolean inboundMessageAckRequested = new AtomicBoolean();
private AtomicLong messageNumber = new AtomicLong();
private AtomicInteger countOfUnassignedMessagesAvailable = new AtomicInteger();
+ private static final String ANONYMOUS_URI = AddressingBuilder.getAddressingBuilder().newAddressingConstants().getAnonymousURI();
public RMClientSequence(boolean addrType, RMConfig wsrmConfig)
{
@@ -202,6 +203,11 @@
// no need for synchronization
return (this.addressableClient) ? this.backPort : null;
}
+
+ public final String getAcksTo()
+ {
+ return (this.addressableClient) ? this.backPort.toString() : ANONYMOUS_URI;
+ }
public final long newMessageNumber()
{
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceIface.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -39,5 +39,6 @@
long getLastMessageNumber();
String getInboundId();
long getDuration();
+ String getAcksTo();
Set<Long> getReceivedInboundMessages();
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/RMHelper.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -29,18 +29,13 @@
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
import javax.xml.namespace.QName;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.Relationship;
import org.jboss.logging.Logger;
-import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMClientSequence;
import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.jaxws.RMHandler;
import org.jboss.ws.extensions.wsrm.server.RMServerSequence;
import org.jboss.ws.extensions.wsrm.spi.RMConstants;
import org.jboss.ws.extensions.wsrm.spi.RMProvider;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMClientHandler.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -21,6 +21,27 @@
*/
package org.jboss.ws.extensions.wsrm.jaxws;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extensions.wsrm.RMConstant;
+import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
/**
* Client WS-RM JAX-WS handler
*
@@ -28,19 +49,91 @@
*
* @since Dec 12, 2007
*/
-public final class RMClientHandler extends RMHandler
+public final class RMClientHandler extends RMHandlerAbstractBase
{
- @Override
- protected boolean isClientSide()
+ private static final RMConstants rmConstants = RMProvider.get().getConstants();
+
+ protected boolean handleOutbound(MessageContext msgContext)
{
+ log.debug("handling outbound message");
+
+ CommonMessageContext commonMsgContext = (CommonMessageContext)msgContext;
+ SOAPAddressingProperties addrProps = (SOAPAddressingProperties)commonMsgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ Map<String, Object> rmOutboundContext = (Map<String, Object>)commonMsgContext.get(RMConstant.REQUEST_CONTEXT);
+ List<QName> outMsgs = (List<QName>)rmOutboundContext.get(RMConstant.PROTOCOL_MESSAGES);
+ Map<QName, RMSerializable> data = new HashMap<QName, RMSerializable>();
+ String optionalMessageId = (addrProps.getMessageID() != null) ? addrProps.getMessageID().getURI().toString() : null;
+ rmOutboundContext.put(RMConstant.WSA_MESSAGE_ID, optionalMessageId);
+ rmOutboundContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
+ SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
+ RMSequenceIface sequenceImpl = (RMSequenceIface)rmOutboundContext.get(RMConstant.SEQUENCE_REFERENCE);
+
+ // try to serialize CreateSequence to message
+ serialize(rmConstants.getCreateSequenceQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize Sequence to message
+ serialize(rmConstants.getSequenceQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize AckRequested to message
+ serialize(rmConstants.getAckRequestedQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize CloseSequence to message
+ serialize(rmConstants.getCloseSequenceQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize TerminateSequence to message
+ serialize(rmConstants.getTerminateSequenceQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize SequenceAcknowledgement to message
+ serialize(rmConstants.getSequenceAcknowledgementQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ if ((outMsgs.size() != 0) && (data.size() == 0))
+ throw new RMException("RM handler did not serialize WS-RM message to the payload");
+
return true;
}
- @Override
- protected boolean isServerSide()
+ protected boolean handleInbound(MessageContext msgContext)
{
- return false;
+ log.debug("handling inbound message");
+
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+
+ // initialize RM response context
+ Map<String, Object> rmResponseContext = new HashMap<String, Object>();
+ List<QName> messages = new LinkedList<QName>();
+ rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES, messages);
+ Map<QName, RMSerializable> data = new HashMap<QName, RMSerializable>();
+ rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
+
+ // try to read CreateSequenceResponse from message
+ deserialize(rmConstants.getCreateSequenceResponseQName(), soapMessage, messages, data);
+
+ // try to read AckRequested from message
+ deserialize(rmConstants.getAckRequestedQName(), soapMessage, messages, data);
+
+ // try to read Sequence from message
+ deserialize(rmConstants.getSequenceQName(), soapMessage, messages, data);
+
+ // try to read SequenceAcknowledgement from message
+ deserialize(rmConstants.getSequenceAcknowledgementQName(), soapMessage, messages, data);
+
+ // try to read CloseSequence from message
+ deserialize(rmConstants.getCloseSequenceResponseQName(), soapMessage, messages, data);
+
+ // try to read TerminateSequence from message
+ deserialize(rmConstants.getTerminateSequenceResponseQName(), soapMessage, messages, data);
+
+ // TODO: implement SequenceFault deserialization
+
+ if (data.size() == 0)
+ throw new RMException("RM handler was not able to find WS-RM message in the payload");
+
+ // propagate RM response context to higher layers
+ msgContext.put(RMConstant.RESPONSE_CONTEXT, rmResponseContext);
+ msgContext.setScope(RMConstant.RESPONSE_CONTEXT, Scope.APPLICATION);
+
+ return true;
}
}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandler.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandler.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -1,408 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.jaxws;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-import org.jboss.ws.extensions.wsrm.RMConstant;
-import org.jboss.ws.extensions.wsrm.RMSequenceIface;
-import org.jboss.ws.extensions.wsrm.api.RMException;
-import org.jboss.ws.extensions.wsrm.common.RMHelper;
-import org.jboss.ws.extensions.wsrm.spi.RMConstants;
-import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
-import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
-
-/**
- * TODO: refactor this shared handler code to server/client handlers
- *
- * RM generic JAX-WS handler
- *
- * @author richard.opalka(a)jboss.com
- *
- * @since Oct 23, 2007
- */
-@SuppressWarnings("unchecked")
-public abstract class RMHandler extends GenericSOAPHandler
-{
- protected final Logger log = Logger.getLogger(getClass());
- private static final RMMessageFactory rmFactory = RMProvider.get().getMessageFactory();
- private static final RMConstants rmConstants = RMProvider.get().getConstants();
- private static final Set headers = RMConstant.PROTOCOL_OPERATION_QNAMES;
-
- public final Set getHeaders()
- {
- return headers;
- }
-
- protected abstract boolean isClientSide();
-
- protected abstract boolean isServerSide();
-
- protected final boolean handleOutbound(MessageContext msgContext)
- {
- log.debug("handling outbound message");
-
- CommonMessageContext commonMsgContext = (CommonMessageContext)msgContext;
- SOAPAddressingProperties addrProps = (SOAPAddressingProperties)commonMsgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
- if (addrProps == null)
- throw new RMException("WS-Addressing properties not found in message context");
-
- String rmContext = isClientSide() ? RMConstant.REQUEST_CONTEXT : RMConstant.RESPONSE_CONTEXT;
- Map rmOutboundContext = (Map)commonMsgContext.get(rmContext);
- List<QName> outMsgs = (List<QName>)rmOutboundContext.get(RMConstant.PROTOCOL_MESSAGES);
- Map<QName, RMSerializable> data = new HashMap<QName, RMSerializable>();
- String optionalMessageId = (addrProps.getMessageID() != null) ? addrProps.getMessageID().getURI().toString() : null;
- rmOutboundContext.put(RMConstant.WSA_MESSAGE_ID, optionalMessageId);
- rmOutboundContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
- SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
- RMSequenceIface sequenceImpl = (RMSequenceIface)rmOutboundContext.get(RMConstant.SEQUENCE_REFERENCE);
-
- QName msgQName = null;
-
- if (isClientSide())
- {
- msgQName = rmConstants.getCreateSequenceQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize CreateSequence to message
- String replyTo = addrProps.getReplyTo().getAddress().getURI().toString();
- RMCreateSequence createSequence = rmFactory.newCreateSequence();
- createSequence.setAcksTo(replyTo);
- createSequence.serializeTo(soapMessage);
- data.put(msgQName, createSequence);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
- }
-
- if (isServerSide())
- {
- msgQName = rmConstants.getCreateSequenceResponseQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize CreateSequenceResponse to message
- RMCreateSequenceResponse createSequenceResponse = rmFactory.newCreateSequenceResponse();
- createSequenceResponse.setIdentifier(sequenceImpl.getInboundId());
- createSequenceResponse.setExpires(RMHelper.longToDuration(sequenceImpl.getDuration()));
- createSequenceResponse.serializeTo(soapMessage);
- data.put(msgQName, createSequenceResponse);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
- }
-
- msgQName = rmConstants.getSequenceQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize Sequence to message
- RMSequence sequence = rmFactory.newSequence();
- sequence.setIdentifier(sequenceImpl.getOutboundId());
- sequence.setMessageNumber(sequenceImpl.newMessageNumber());
- sequence.serializeTo(soapMessage);
- data.put(msgQName, sequence);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
-
- msgQName = rmConstants.getAckRequestedQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize AckRequested to message
- RMAckRequested ackRequested = rmFactory.newAckRequested();
- ackRequested.setIdentifier(sequenceImpl.getOutboundId());
- ackRequested.setMessageNumber(sequenceImpl.getLastMessageNumber());
- ackRequested.serializeTo(soapMessage);
- data.put(msgQName, ackRequested);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
-
- if (isClientSide())
- {
- msgQName = rmConstants.getCloseSequenceQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize CloseSequence to message
- RMCloseSequence closeSequence = rmFactory.newCloseSequence();
- closeSequence.setIdentifier(sequenceImpl.getOutboundId());
- if (sequenceImpl.getLastMessageNumber() > 0)
- {
- closeSequence.setLastMsgNumber(sequenceImpl.getLastMessageNumber());
- }
- closeSequence.serializeTo(soapMessage);
- data.put(msgQName, closeSequence);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
- }
-
- if (isServerSide())
- {
- msgQName = rmConstants.getCloseSequenceResponseQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize CloseSequenceResponse to message
- RMCloseSequenceResponse closeSequenceResponse = rmFactory.newCloseSequenceResponse();
- closeSequenceResponse.setIdentifier(sequenceImpl.getInboundId());
- closeSequenceResponse.serializeTo(soapMessage);
- data.put(msgQName, closeSequenceResponse);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
- }
-
- if (isClientSide())
- {
- msgQName = rmConstants.getTerminateSequenceQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize TerminateSequence to message
- RMTerminateSequence terminateSequence = rmFactory.newTerminateSequence();
- terminateSequence.setIdentifier(sequenceImpl.getOutboundId());
- if (sequenceImpl.getLastMessageNumber() > 0)
- {
- terminateSequence.setLastMsgNumber(sequenceImpl.getLastMessageNumber());
- }
- terminateSequence.serializeTo(soapMessage);
- data.put(msgQName, terminateSequence);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
- }
-
- if (isServerSide())
- {
- msgQName = rmConstants.getTerminateSequenceResponseQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize terminateSequenceResponse to message
- RMTerminateSequenceResponse terminateSequenceResponse = rmFactory.newTerminateSequenceResponse();
- terminateSequenceResponse.setIdentifier(sequenceImpl.getInboundId());
- terminateSequenceResponse.serializeTo(soapMessage);
- data.put(msgQName, terminateSequenceResponse);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
- }
-
- msgQName = rmConstants.getSequenceAcknowledgementQName();
- if (outMsgs.contains(msgQName))
- {
- // try to serialize SequenceAcknowledgement to message
- RMSequenceAcknowledgement sequenceAcknowledgement = rmFactory.newSequenceAcknowledgement();
- sequenceAcknowledgement.setIdentifier(sequenceImpl.getInboundId());
- Iterator<Long> receivedMessages = sequenceImpl.getReceivedInboundMessages().iterator();
- if (false == receivedMessages.hasNext())
- {
- sequenceAcknowledgement.setNone();
- }
- else
- {
- while (receivedMessages.hasNext())
- {
- long messageNo = receivedMessages.next();
- RMSequenceAcknowledgement.RMAcknowledgementRange range = sequenceAcknowledgement.newAcknowledgementRange();
- range.setLower(messageNo);
- range.setUpper(messageNo);
- sequenceAcknowledgement.addAcknowledgementRange(range);
- }
- }
- sequenceAcknowledgement.serializeTo(soapMessage);
- data.put(msgQName, sequenceAcknowledgement);
- log.debug(msgQName.getLocalPart() + " WSRM message was serialized to payload");
- }
-
- if ((outMsgs.size() != 0) && (data.size() == 0))
- throw new RMException("RM handler did not serialize WS-RM message to the payload");
-
- // TODO: implement SequenceFault serialization
-
- return true;
- }
-
- protected final boolean handleInbound(MessageContext msgContext)
- {
- log.debug("handling inbound message");
-
- SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- Map<String, Object> rmResponseContext = new HashMap();
- List<QName> messages = new LinkedList<QName>();
- rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES, messages);
- Map<QName, RMSerializable> data = new HashMap<QName, RMSerializable>();
- rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
- String rmContext = isClientSide() ? RMConstant.RESPONSE_CONTEXT : RMConstant.REQUEST_CONTEXT;
- msgContext.put(rmContext, rmResponseContext);
- msgContext.setScope(rmContext, Scope.APPLICATION);
-
- if (isServerSide())
- {
- try
- {
- // try to deserialize CreateSequence from message
- QName msgQName = rmConstants.getCreateSequenceQName();
- RMCreateSequence wsrmMsg = rmFactory.newCreateSequence();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
- }
-
- if (isClientSide())
- {
- try
- {
- // try to deserialize CreateSequenceResponse from message
- QName msgQName = rmConstants.getCreateSequenceResponseQName();
- RMCreateSequenceResponse wsrmMsg = rmFactory.newCreateSequenceResponse();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
- }
-
- try
- {
- // try to deserialize AckRequested from message
- QName msgQName = rmConstants.getAckRequestedQName();
- RMAckRequested wsrmMsg = rmFactory.newAckRequested();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
-
- try
- {
- // try to deserialize Sequence from message
- QName msgQName = rmConstants.getSequenceQName();
- RMSequence wsrmMsg = rmFactory.newSequence();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
-
- try
- {
- // try to deserialize SequenceAcknowledgement from message
- QName msgQName = rmConstants.getSequenceAcknowledgementQName();
- RMSequenceAcknowledgement wsrmMsg = rmFactory.newSequenceAcknowledgement();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
-
- if (isServerSide())
- {
- try
- {
- // try to deserialize CloseSequence from message
- QName msgQName = rmConstants.getCloseSequenceQName();
- RMCloseSequence wsrmMsg = rmFactory.newCloseSequence();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
- }
-
- if (isClientSide())
- {
- try
- {
- // try to deserialize CloseSequenceResponse from message
- QName msgQName = rmConstants.getCloseSequenceResponseQName();
- RMCloseSequenceResponse wsrmMsg = rmFactory.newCloseSequenceResponse();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
- }
-
- if (isServerSide())
- {
- try
- {
- // try to deserialize TerminateSequence from message
- QName msgQName = rmConstants.getTerminateSequenceQName();
- RMTerminateSequence wsrmMsg = rmFactory.newTerminateSequence();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
- }
-
- if (isClientSide())
- {
- try
- {
- // try to deserialize TerminateSequenceResponse from message
- QName msgQName = rmConstants.getTerminateSequenceResponseQName();
- RMTerminateSequenceResponse wsrmMsg = rmFactory.newTerminateSequenceResponse();
- wsrmMsg.deserializeFrom(soapMessage);
- messages.add(msgQName);
- data.put(msgQName, wsrmMsg);
- log.debug(msgQName.getLocalPart() + " WSRM message was deserialized from payload");
- }
- catch (RMException ignore) {}
- }
-
- // TODO: implement SequenceFault deserialization
-
- if (data.size() == 0)
- throw new RMException("RM handler was not able to find WS-RM message in the payload");
-
- return true;
- }
-
-}
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.jaxws;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.extensions.wsrm.RMConstant;
+import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
+/**
+ * RM generic JAX-WS handler
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 23, 2007
+ */
+public abstract class RMHandlerAbstractBase extends GenericSOAPHandler
+{
+ protected final Logger log = Logger.getLogger(getClass());
+
+ public final Set<QName> getHeaders()
+ {
+ return RMConstant.PROTOCOL_OPERATION_QNAMES;
+ }
+
+ protected final void serialize(QName msgQN, List<QName> outMsgs, Map<QName, RMSerializable> data, SOAPMessage soapMessage, RMSequenceIface seq)
+ {
+ RMSerializable msg = RMHandlerHelper.prepareData(msgQN, outMsgs, seq);
+ if (msg != null)
+ {
+ msg.serializeTo(soapMessage);
+ data.put(msgQN, msg);
+ log.debug(msgQN.getLocalPart() + " WSRM message was serialized to payload");
+ }
+ }
+
+ protected final void deserialize(QName msgQN, SOAPMessage soapMessage, List<QName> messages, Map<QName, RMSerializable> data)
+ {
+ try
+ {
+ RMSerializable wsrmMsg = RMHandlerHelper.getMessage(msgQN);
+ wsrmMsg.deserializeFrom(soapMessage);
+ messages.add(msgQN);
+ data.put(msgQN, wsrmMsg);
+ log.debug(msgQN.getLocalPart() + " WSRM message was deserialized from payload");
+ }
+ catch (RMException ignore) {}
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerAbstractBase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -0,0 +1,245 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.jaxws;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.common.RMHelper;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMAckRequested;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMCreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMTerminateSequenceResponse;
+
+/**
+ * Handler helper
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Dec 13, 2007
+ */
+public final class RMHandlerHelper
+{
+
+ private static final RMMessageFactory rmFactory = RMProvider.get().getMessageFactory();
+ private static final RMConstants rmConstants = RMProvider.get().getConstants();
+
+ public static RMSerializable getMessage(QName msgQN)
+ {
+ if (rmConstants.getCreateSequenceQName().equals(msgQN))
+ {
+ return rmFactory.newCreateSequence();
+ }
+ if (rmConstants.getCreateSequenceResponseQName().equals(msgQN))
+ {
+ return rmFactory.newCreateSequenceResponse();
+ }
+ if (rmConstants.getCloseSequenceQName().equals(msgQN))
+ {
+ return rmFactory.newCloseSequence();
+ }
+ if (rmConstants.getCloseSequenceResponseQName().equals(msgQN))
+ {
+ return rmFactory.newCloseSequenceResponse();
+ }
+ if (rmConstants.getTerminateSequenceQName().equals(msgQN))
+ {
+ return rmFactory.newTerminateSequence();
+ }
+ if (rmConstants.getTerminateSequenceResponseQName().equals(msgQN))
+ {
+ return rmFactory.newTerminateSequenceResponse();
+ }
+ if (rmConstants.getSequenceAcknowledgementQName().equals(msgQN))
+ {
+ return rmFactory.newSequenceAcknowledgement();
+ }
+ if (rmConstants.getSequenceQName().equals(msgQN))
+ {
+ return rmFactory.newSequence();
+ }
+ if (rmConstants.getAckRequestedQName().equals(msgQN))
+ {
+ return rmFactory.newAckRequested();
+ }
+
+ throw new IllegalArgumentException();
+ }
+
+ public static RMSerializable prepareData(QName msgQN, List<QName> outMsgs, RMSequenceIface seq)
+ {
+ if (outMsgs.contains(msgQN))
+ {
+ if (rmConstants.getSequenceQName().equals(msgQN))
+ {
+ return newSequence(seq);
+ }
+ if (rmConstants.getSequenceAcknowledgementQName().equals(msgQN))
+ {
+ return newSequenceAcknowledgement(seq);
+ }
+ if (rmConstants.getTerminateSequenceQName().equals(msgQN))
+ {
+ return newTerminateSequence(seq);
+ }
+ if (rmConstants.getTerminateSequenceResponseQName().equals(msgQN))
+ {
+ return newTerminateSequenceResponse(seq);
+ }
+ if (rmConstants.getCloseSequenceQName().equals(msgQN))
+ {
+ return newCloseSequence(seq);
+ }
+ if (rmConstants.getCloseSequenceResponseQName().equals(msgQN))
+ {
+ return newCloseSequenceResponse(seq);
+ }
+ if (rmConstants.getAckRequestedQName().equals(msgQN))
+ {
+ return newAckRequested(seq);
+ }
+ if (rmConstants.getCreateSequenceQName().equals(msgQN))
+ {
+ return newCreateSequence(seq);
+ }
+ if (rmConstants.getCreateSequenceResponseQName().equals(msgQN))
+ {
+ return newCreateSequenceResponse(seq);
+ }
+
+ throw new IllegalArgumentException(msgQN.toString());
+ }
+
+ return null;
+ }
+
+ private static RMSerializable newCreateSequence(RMSequenceIface seq)
+ {
+ RMCreateSequence createSequence = rmFactory.newCreateSequence();
+ createSequence.setAcksTo(seq.getAcksTo());
+ return createSequence;
+ }
+
+ private static RMSerializable newCreateSequenceResponse(RMSequenceIface seq)
+ {
+ RMCreateSequenceResponse createSequenceResponse = rmFactory.newCreateSequenceResponse();
+ createSequenceResponse.setIdentifier(seq.getInboundId());
+ createSequenceResponse.setExpires(RMHelper.longToDuration(seq.getDuration()));
+ return createSequenceResponse;
+ }
+
+ private static RMSerializable newCloseSequenceResponse(RMSequenceIface seq)
+ {
+ // construct CloseSequenceResponse object
+ RMCloseSequenceResponse closeSequenceResponse = rmFactory.newCloseSequenceResponse();
+ closeSequenceResponse.setIdentifier(seq.getInboundId());
+ return closeSequenceResponse;
+ }
+
+ private static RMSerializable newCloseSequence(RMSequenceIface seq)
+ {
+ // construct CloseSequenceResponse object
+ RMCloseSequence closeSequence = rmFactory.newCloseSequence();
+ closeSequence.setIdentifier(seq.getOutboundId());
+ if (seq.getLastMessageNumber() > 0)
+ {
+ closeSequence.setLastMsgNumber(seq.getLastMessageNumber());
+ }
+ return closeSequence;
+ }
+
+ private static RMSerializable newTerminateSequence(RMSequenceIface seq)
+ {
+ // construct CloseSequenceResponse object
+ RMTerminateSequence terminateSequence = rmFactory.newTerminateSequence();
+ terminateSequence.setIdentifier(seq.getOutboundId());
+ if (seq.getLastMessageNumber() > 0)
+ {
+ terminateSequence.setLastMsgNumber(seq.getLastMessageNumber());
+ }
+ return terminateSequence;
+ }
+
+ private static RMSerializable newTerminateSequenceResponse(RMSequenceIface seq)
+ {
+ // construct TerminateSequenceResponse object
+ RMTerminateSequenceResponse terminateSequenceResponse = rmFactory.newTerminateSequenceResponse();
+ terminateSequenceResponse.setIdentifier(seq.getInboundId());
+ return terminateSequenceResponse;
+ }
+
+ private static RMSerializable newSequenceAcknowledgement(RMSequenceIface seq)
+ {
+ // construct SequenceAcknowledgement object
+ RMSequenceAcknowledgement sequenceAcknowledgement = rmFactory.newSequenceAcknowledgement();
+ sequenceAcknowledgement.setIdentifier(seq.getInboundId());
+ Iterator<Long> receivedMessages = seq.getReceivedInboundMessages().iterator();
+ if (false == receivedMessages.hasNext())
+ {
+ sequenceAcknowledgement.setNone();
+ }
+ else
+ {
+ while (receivedMessages.hasNext())
+ {
+ long messageNo = receivedMessages.next();
+ RMSequenceAcknowledgement.RMAcknowledgementRange range = sequenceAcknowledgement.newAcknowledgementRange();
+ range.setLower(messageNo);
+ range.setUpper(messageNo);
+ sequenceAcknowledgement.addAcknowledgementRange(range);
+ }
+ }
+
+ return sequenceAcknowledgement;
+ }
+
+ private static RMSerializable newAckRequested(RMSequenceIface seq)
+ {
+ // construct AckRequested object
+ RMAckRequested wsrmMsg = rmFactory.newAckRequested();
+ wsrmMsg.setIdentifier(seq.getOutboundId());
+ wsrmMsg.setMessageNumber(seq.getLastMessageNumber());
+ return wsrmMsg;
+ }
+
+ private static RMSerializable newSequence(RMSequenceIface seq)
+ {
+ // construct Sequence object
+ RMSequence sequence = rmFactory.newSequence();
+ sequence.setIdentifier(seq.getOutboundId());
+ sequence.setMessageNumber(seq.newMessageNumber());
+ return sequence;
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMHandlerHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/jaxws/RMServerHandler.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -21,25 +21,118 @@
*/
package org.jboss.ws.extensions.wsrm.jaxws;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extensions.wsrm.RMConstant;
+import org.jboss.ws.extensions.wsrm.RMSequenceIface;
+import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.spi.RMConstants;
+import org.jboss.ws.extensions.wsrm.spi.RMProvider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.RMSerializable;
+
/**
- * Client WS-RM JAX-WS handler
+ * Server WS-RM JAX-WS handler
*
* @author richard.opalka(a)jboss.com
*
* @since Dec 12, 2007
*/
-public final class RMServerHandler extends RMHandler
+public final class RMServerHandler extends RMHandlerAbstractBase
{
- @Override
- protected boolean isClientSide()
+ private static final RMConstants rmConstants = RMProvider.get().getConstants();
+
+ protected final boolean handleOutbound(MessageContext msgContext)
{
- return false;
+ log.debug("handling outbound message");
+
+ CommonMessageContext commonMsgContext = (CommonMessageContext)msgContext;
+ SOAPAddressingProperties addrProps = (SOAPAddressingProperties)commonMsgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ Map<String, Object> rmOutboundContext = (Map<String, Object>)commonMsgContext.get(RMConstant.RESPONSE_CONTEXT);
+ List<QName> outMsgs = (List<QName>)rmOutboundContext.get(RMConstant.PROTOCOL_MESSAGES);
+ Map<QName, RMSerializable> data = new HashMap<QName, RMSerializable>();
+ String optionalMessageId = (addrProps.getMessageID() != null) ? addrProps.getMessageID().getURI().toString() : null;
+ rmOutboundContext.put(RMConstant.WSA_MESSAGE_ID, optionalMessageId);
+ rmOutboundContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
+ SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
+ RMSequenceIface sequenceImpl = (RMSequenceIface)rmOutboundContext.get(RMConstant.SEQUENCE_REFERENCE);
+
+ // try to serialize CreateSequenceResponse to message
+ serialize(rmConstants.getCreateSequenceResponseQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize Sequence to message
+ serialize(rmConstants.getSequenceQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize AckRequested to message
+ serialize(rmConstants.getAckRequestedQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize CloseSequenceResponse to message
+ serialize(rmConstants.getCloseSequenceResponseQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize TerminateSequenceResponse to message
+ serialize(rmConstants.getTerminateSequenceResponseQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ // try to serialize SequenceAcknowledgement to message
+ serialize(rmConstants.getSequenceAcknowledgementQName(), outMsgs, data, soapMessage, sequenceImpl);
+
+ if ((outMsgs.size() != 0) && (data.size() == 0))
+ throw new RMException("RM handler have not serialized WS-RM message to the payload");
+
+ // TODO: implement SequenceFault serialization
+
+ return true;
}
- @Override
- protected boolean isServerSide()
+ protected final boolean handleInbound(MessageContext msgContext)
{
+ log.debug("handling inbound message");
+
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+
+ // initialize RM response context
+ Map<String, Object> rmResponseContext = new HashMap<String, Object>();
+ List<QName> messages = new LinkedList<QName>();
+ rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES, messages);
+ Map<QName, RMSerializable> data = new HashMap<QName, RMSerializable>();
+ rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
+
+ // try to read CreateSequence from message
+ deserialize(rmConstants.getCreateSequenceQName(), soapMessage, messages, data);
+
+ // try to read AckRequested from message
+ deserialize(rmConstants.getAckRequestedQName(), soapMessage, messages, data);
+
+ // try to read Sequence from message
+ deserialize(rmConstants.getSequenceQName(), soapMessage, messages, data);
+
+ // try to read SequenceAcknowledgement from message
+ deserialize(rmConstants.getSequenceAcknowledgementQName(), soapMessage, messages, data);
+
+ // try to read CloseSequence from message
+ deserialize(rmConstants.getCloseSequenceQName(), soapMessage, messages, data);
+
+ // try to read TerminateSequence from message
+ deserialize(rmConstants.getTerminateSequenceQName(), soapMessage, messages, data);
+
+ if (data.size() == 0)
+ throw new RMException("RM handler was not able to find WS-RM message in the payload");
+
+ // propagate RM response context to higher layers
+ msgContext.put(RMConstant.REQUEST_CONTEXT, rmResponseContext);
+ msgContext.setScope(RMConstant.REQUEST_CONTEXT, Scope.APPLICATION);
+
return true;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java 2007-12-13 16:12:38 UTC (rev 5306)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java 2007-12-14 06:28:41 UTC (rev 5307)
@@ -59,6 +59,11 @@
{
return this.duration;
}
+
+ public String getAcksTo()
+ {
+ return null;
+ }
public String getOutboundId()
{
17 years