Author: richard.opalka(a)jboss.com
Date: 2007-10-23 14:18:43 -0400 (Tue, 23 Oct 2007)
New Revision: 4867
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMException.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHandlerConstant.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMProvider.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/RMEndpointEmulator.java
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/test.log
Removed:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceFactory.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/ReliableMessagingException.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequence.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml
Log:
synchronizing local working copy with SVN
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -677,4 +677,5 @@
}
}
}
+
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -23,8 +23,11 @@
// $Id$
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -72,10 +75,12 @@
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.core.soap.attachment.CIDGenerator;
import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.xb.binding.NamespaceRegistry;
@@ -167,21 +172,42 @@
SOAPElement soapBodyElement = soapBody;
if (style == Style.RPC)
{
- QName opQName = opMetaData.getQName();
- Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+ ReliableMessagingMetaData rmMD =
opMetaData.getEndpointMetaData().getConfig().getRMMetaData();
+ List<QName> rmQNs = Collections.emptyList();
+ if (rmMD != null)
+ {
+ String rmSpecVersion = rmMD.getProvider().getSpecVersion();
+ org.jboss.ws.extensions.wsrm.spi.Constants constants =
Provider.getInstance(rmSpecVersion).getConstants();
+ rmQNs = new LinkedList<QName>();
+ rmQNs.add(constants.getCreateSequenceQName());
+ rmQNs.add(constants.getCloseSequenceQName());
+ rmQNs.add(constants.getTerminateSequenceQName());
+ }
+ boolean serialize = true;
+ for (QName wsrmQN : rmQNs)
+ {
+ if (wsrmQN.equals(opMetaData.getQName()))
+ serialize = false;
+ }
+
+ if (serialize)
+ {
+ QName opQName = opMetaData.getQName();
+ Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
- if (log.isDebugEnabled())
- log.debug("Create RPC body element: " + opName);
+ if (log.isDebugEnabled())
+ log.debug("Create RPC body element: " + opName);
- soapBodyElement = new SOAPBodyElementRpc(opName);
- soapBodyElement =
(SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
+ soapBodyElement = new SOAPBodyElementRpc(opName);
+ soapBodyElement =
(SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
- // Add soap encodingStyle
- if (opMetaData.getUse() == Use.ENCODED)
- {
- String envURI = soapEnvelope.getNamespaceURI();
- String envPrefix = soapEnvelope.getPrefix();
- soapBodyElement.setAttributeNS(envURI, envPrefix +
":encodingStyle", Constants.URI_SOAP11_ENC);
+ // Add soap encodingStyle
+ if (opMetaData.getUse() == Use.ENCODED)
+ {
+ String envURI = soapEnvelope.getNamespaceURI();
+ String envPrefix = soapEnvelope.getPrefix();
+ soapBodyElement.setAttributeNS(envURI, envPrefix +
":encodingStyle", Constants.URI_SOAP11_ENC);
+ }
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -30,6 +30,9 @@
import java.util.Map;
import java.util.Observable;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
@@ -61,6 +64,11 @@
import org.jboss.ws.core.jaxws.handler.PortInfoImpl;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.extensions.wsrm.RMException;
+import org.jboss.ws.extensions.wsrm.RMHandlerConstant;
+import org.jboss.ws.extensions.wsrm.RMProvider;
+import org.jboss.ws.extensions.wsrm.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -73,7 +81,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 04-Jul-2006
*/
-public class ClientImpl extends CommonClient implements BindingProvider, Configurable
+public class ClientImpl extends CommonClient implements RMProvider, BindingProvider,
Configurable
{
// provide logging
private static Logger log = Logger.getLogger(ClientImpl.class);
@@ -88,7 +96,12 @@
private static HandlerType[] HANDLER_TYPES = new HandlerType[] {HandlerType.PRE,
HandlerType.ENDPOINT, HandlerType.POST};
- public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
+ // WS-RM locking utility
+ private final Lock wsrmLock = new ReentrantLock();
+ // WS-RM sequence associated with the proxy
+ private RMSequence wsrmSequence;
+
+ public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
{
super(epMetaData);
setTargetEndpointAddress(epMetaData.getEndpointAddress());
@@ -425,4 +438,81 @@
PortInfo portInfo = new PortInfoImpl(serviceName, portName, bindingID);
return portInfo;
}
+
+ ///////////////////
+ // WS-RM support //
+ ///////////////////
+ public RMSequence createSequence()
+ {
+ this.wsrmLock.lock();
+ try
+ {
+ if ((this.wsrmSequence != null) && (!this.wsrmSequence.isTerminated()))
+ throw new IllegalStateException("Sequence already registered with proxy
instance");
+
+ Provider rmProvider =
Provider.getInstance("http://docs.oasis-open.org/ws-rx/wsrm/200702&q...;
+ try
+ {
+ Map<String,Object> responseContext =
getBindingProvider().getResponseContext();
+ QName createSequenceQN = rmProvider.getConstants().getCreateSequenceQName();
+ Map<String, Object> requestContext =
getBindingProvider().getRequestContext();
+ requestContext.put(RMHandlerConstant.HANDLER_COMMAND,
RMHandlerConstant.Operation.CREATE_SEQUENCE);
+ Object retVal = invoke(createSequenceQN, new Object[] {}, responseContext);
+ }
+ catch (Exception ignore) {
+ ignore.printStackTrace(); // TODO: use emulator on server side
+ }
+
+ // TODO: do not return dummy sequence
+ return this.wsrmSequence = new RMSequence()
+ {
+ private int count = 0;
+ private boolean closed = false;
+ private boolean terminated = false;
+
+ public void close() throws RMException
+ {
+ this.closed = true;
+ }
+
+ public void terminate() throws RMException
+ {
+ this.terminated = true;
+ }
+
+ public boolean isCompleted()
+ {
+ return true;
+ }
+
+ public boolean isCompleted(int timeAmount, TimeUnit timeUnit)
+ {
+ return true;
+ }
+
+ public String getId()
+ {
+ return "DummySequenceId" + count++;
+ }
+
+ public void setLastMessage()
+ {
+ }
+
+ public boolean isTerminated()
+ {
+ return this.terminated;
+ }
+
+ public boolean isClosed()
+ {
+ return this.closed;
+ }
+ };
+ }
+ finally
+ {
+ this.wsrmLock.unlock();
+ }
+ }
}
\ No newline at end of file
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -48,6 +48,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.wsrm.RMProvider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.wsf.common.JavaUtils;
@@ -91,6 +92,7 @@
this.executor = executor;
this.stubMethods = new
ArrayList(Arrays.asList(BindingProvider.class.getMethods()));
this.stubMethods.addAll(Arrays.asList(StubExt.class.getMethods()));
+ this.stubMethods.addAll(Arrays.asList(RMProvider.class.getMethods()));
this.objectMethods = Arrays.asList(Object.class.getMethods());
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -56,6 +56,7 @@
import org.jboss.ws.core.jaxws.client.DispatchImpl;
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
+import org.jboss.ws.extensions.wsrm.RMProvider;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
@@ -390,7 +391,7 @@
T proxy;
try
{
- proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass,
BindingProvider.class, StubExt.class }, handler);
+ proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass,
RMProvider.class, BindingProvider.class, StubExt.class }, handler);
}
catch (RuntimeException rte)
{
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -39,7 +39,7 @@
import
org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAlternativeException;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertionException;
import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicyException;
-import org.jboss.ws.extensions.wsrm.policy.WSRMPolicyAssertionDeployer;
+import org.jboss.ws.extensions.wsrm.policy.RMPolicyAssertionDeployer;
import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
/**
@@ -57,7 +57,7 @@
{
me = new PolicyDeployer();
me.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jb...;,
WSSecurityAssertionDeployer.class);
-
me.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsrmp/200...;,
WSRMPolicyAssertionDeployer.class);
+
me.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsrmp/200...;,
RMPolicyAssertionDeployer.class);
}
//hide constructor
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,106 @@
+/*
+ * 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.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+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.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.extensions.wsrm.spi.Constants;
+import org.jboss.ws.extensions.wsrm.spi.Provider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
+
+/**
+ * TODO: add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 23, 2007
+ */
+public class RMClientHandler extends GenericSOAPHandler
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(RMClientHandler.class);
+
+ private static Set<QName> HEADERS = new HashSet<QName>();
+ private static Provider rmProvider =
Provider.getInstance("http://docs.oasis-open.org/ws-rx/wsrm/200702&q...;
+
+ static
+ {
+ Constants constants = rmProvider.getConstants();
+ HEADERS.add(constants.getCreateSequenceQName());
+ HEADERS.add(constants.getCloseSequenceQName());
+ HEADERS.add(constants.getTerminateSequenceQName());
+ HEADERS.add(constants.getCreateSequenceResponseQName());
+ HEADERS.add(constants.getCloseSequenceResponseQName());
+ HEADERS.add(constants.getTerminateSequenceResponseQName());
+ }
+
+ public Set getHeaders()
+ {
+ return Collections.unmodifiableSet(HEADERS);
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ if(log.isDebugEnabled()) log.debug("handleOutbound");
+
+ SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ RMHandlerConstant.Operation operation =
(RMHandlerConstant.Operation)msgContext.get(RMHandlerConstant.HANDLER_COMMAND);
+ if (addrProps != null)
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ if (operation == RMHandlerConstant.Operation.CREATE_SEQUENCE)
+ {
+ String replyTo = addrProps.getReplyTo().getAddress().getURI().toString();
+ CreateSequence createSequence =
rmProvider.getMessageFactory().newCreateSequence();
+ createSequence.setAcksTo(replyTo);
+ createSequence.serializeTo(soapMessage);
+ }
+ }
+ else
+ {
+ throw new IllegalStateException();
+ }
+
+ return true;
+ }
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ if(log.isDebugEnabled()) log.debug("handleInbound");
+ // TODO: implement
+ return true;
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMException.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMException.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMException.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,53 @@
+/*
+ * 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.WebServiceException;
+
+/**
+ * RM exception heavily used by RM framework
+ * @author richard.opalka(a)jboss.com
+ */
+public class RMException extends WebServiceException
+{
+
+ public RMException()
+ {
+ super();
+ }
+
+ public RMException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public RMException(String message)
+ {
+ super(message);
+ }
+
+ public RMException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHandlerConstant.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHandlerConstant.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHandlerConstant.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+/**
+ * TODO: add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 23, 2007
+ */
+public class RMHandlerConstant
+{
+ private static final String PREFIX = RMHandlerConstant.class.getName();
+ public static final String HANDLER_COMMAND = PREFIX + ".handlerCommand";
+
+ public enum Operation
+ {
+ CREATE_SEQUENCE, CLOSE_SEQUENCE, TERMINATE_SEQUENCE
+ }
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMHandlerConstant.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMProvider.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMProvider.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMProvider.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+/**
+ * TODO: add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 22, 2007
+ */
+public interface RMProvider
+{
+ RMSequence createSequence();
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequence.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequence.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequence.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -25,9 +25,12 @@
public interface RMSequence
{
- String getId();
- void setLastMessage();
- void terminate();
- boolean completed();
- boolean completed(int timeAmount, TimeUnit timeUnit);
+ void close() throws RMException;
+ void terminate() throws RMException;
+ String getId() throws RMException;
+ void setLastMessage() throws RMException;
+ boolean isCompleted() throws RMException;
+ boolean isCompleted(int timeAmount, TimeUnit timeUnit) throws RMException;
+ boolean isClosed() throws RMException;
+ boolean isTerminated() throws RMException;
}
Deleted:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceFactory.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceFactory.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceFactory.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -1,71 +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.concurrent.TimeUnit;
-import javax.xml.ws.BindingProvider;
-
-public class RMSequenceFactory
-{
- private RMSequenceFactory()
- {
- // forbidden constructor
- }
-
- private static final RMSequence DUMMY_SEQUENCE = new RMSequence()
- {
- private int count = 0;
-
- public boolean completed()
- {
- return true;
- }
-
- public boolean completed(int timeAmount, TimeUnit timeUnit)
- {
- return true;
- }
-
- public String getId()
- {
- return "DummySequenceId" + count++;
- }
-
- public void setLastMessage()
- {
- }
-
- public void terminate()
- {
- }
- };
-
- public static RMSequence newInstance(Object object)
- {
- if (object instanceof BindingProvider) {
- // allowing creation of sequences only for JBossWS client proxies
- return DUMMY_SEQUENCE; // TODO: RIO implement RM SPI provider
- } else {
- throw new IllegalArgumentException(); // TODO: RIO provide clear message to the
client
- }
- }
-}
Deleted:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/ReliableMessagingException.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/ReliableMessagingException.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/ReliableMessagingException.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -1,53 +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 javax.xml.ws.WebServiceException;
-
-/**
- * RM exception heavily used by RM framework
- * @author richard.opalka(a)jboss.com
- */
-public class ReliableMessagingException extends WebServiceException
-{
-
- public ReliableMessagingException()
- {
- super();
- }
-
- public ReliableMessagingException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public ReliableMessagingException(String message)
- {
- super(message);
- }
-
- public ReliableMessagingException(Throwable cause)
- {
- super(cause);
- }
-
-}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AbstractSerializable.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -23,7 +23,7 @@
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
@@ -43,7 +43,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
*/
- public final void deserializeFrom(SOAPMessage soapMessage) throws
ReliableMessagingException
+ public final void deserializeFrom(SOAPMessage soapMessage) throws RMException
{
SerializationRepository.deserialize(this, soapMessage);
validate(); // finally ensure that object is in correct state
@@ -52,7 +52,7 @@
/*
* @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
*/
- public final void serializeTo(SOAPMessage soapMessage) throws
ReliableMessagingException
+ public final void serializeTo(SOAPMessage soapMessage) throws RMException
{
validate(); // ensure object is in correct state first
SerializationRepository.serialize(this, soapMessage);
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/AckRequestedSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -33,7 +33,7 @@
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
@@ -65,7 +65,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
AckRequested o = (AckRequested)object;
try
@@ -95,11 +95,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -110,7 +110,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
AckRequested o = (AckRequested)object;
try
@@ -139,7 +139,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceResponseSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -31,7 +31,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
@@ -63,7 +63,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CloseSequenceResponse o = (CloseSequenceResponse)object;
try
@@ -83,11 +83,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -98,7 +98,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CloseSequenceResponse o = (CloseSequenceResponse)object;
try
@@ -119,7 +119,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CloseSequenceSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -33,7 +33,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
@@ -65,7 +65,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CloseSequence o = (CloseSequence)object;
try
@@ -95,11 +95,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -110,7 +110,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CloseSequence o = (CloseSequence)object;
try
@@ -139,7 +139,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceResponseSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -34,7 +34,7 @@
import javax.xml.ws.addressing.AddressingBuilder;
import javax.xml.ws.addressing.AddressingConstants;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
@@ -70,7 +70,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CreateSequenceResponse o = (CreateSequenceResponse)object;
try
@@ -127,11 +127,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -142,7 +142,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CreateSequenceResponse o = (CreateSequenceResponse)object;
try
@@ -193,7 +193,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/CreateSequenceSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -34,7 +34,7 @@
import javax.xml.ws.addressing.AddressingBuilder;
import javax.xml.ws.addressing.AddressingConstants;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
@@ -70,7 +70,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CreateSequence o = (CreateSequence)object;
try
@@ -145,11 +145,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -160,7 +160,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
CreateSequence o = (CreateSequence)object;
try
@@ -229,7 +229,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceAcknowledgementSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -34,7 +34,7 @@
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
@@ -68,7 +68,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
SequenceAcknowledgement o = (SequenceAcknowledgement)object;
try
@@ -138,11 +138,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -153,7 +153,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
SequenceAcknowledgement o = (SequenceAcknowledgement)object;
try
@@ -218,7 +218,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceFaultSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -24,7 +24,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
@@ -54,7 +54,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
throw new NotImplementedException();
}
@@ -66,7 +66,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
throw new NotImplementedException();
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SequenceSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -33,7 +33,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
@@ -65,7 +65,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
Sequence o = (Sequence)object;
try
@@ -100,11 +100,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -115,7 +115,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
Sequence o = (Sequence)object;
try
@@ -148,7 +148,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationHelper.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -27,7 +27,7 @@
import org.w3c.dom.Element;
import org.jboss.wsf.common.DOMUtils;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
@@ -47,7 +47,7 @@
public static String getRequiredTextContent(SOAPElement element, QName elementQName)
{
if (!DOMUtils.hasTextChildNodesOnly(element))
- throw new ReliableMessagingException(
+ throw new RMException(
"Only text content is allowed for element " + elementQName);
return DOMUtils.getTextContent(element).trim();
@@ -63,11 +63,11 @@
List<Element> childElements = DOMUtils.getChildElementsAsList(element,
requiredQName);
if (childElements.size() < 1)
- throw new ReliableMessagingException(
+ throw new RMException(
"Required " + requiredQName + " element not found in " +
context + " element");
if (childElements.size() > 1)
- throw new ReliableMessagingException(
+ throw new RMException(
"Only one " + requiredQName + " element can be present in
" + context + " element");
return (SOAPElement)childElements.get(0);
@@ -78,7 +78,7 @@
String attributeValue = element.getAttributeValue(attributeQName);
if (attributeValue == null)
- throw new ReliableMessagingException(
+ throw new RMException(
"Required attribute " + attributeQName + " is missing in
element " + elementQName);
return attributeValue;
@@ -89,7 +89,7 @@
List<Element> list = DOMUtils.getChildElementsAsList(contextElement,
optionalQName);
if (list.size() > 1)
- throw new ReliableMessagingException(
+ throw new RMException(
"At most one " + optionalQName + " element can be present in
" + contextQName + " element");
return (SOAPElement)((list.size() == 1) ? list.get(0) : null);
@@ -124,7 +124,7 @@
}
catch (NumberFormatException nfe)
{
- throw new ReliableMessagingException(errorMessage, nfe);
+ throw new RMException(errorMessage, nfe);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/SerializationRepository.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.common.serialization;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
@@ -72,10 +72,10 @@
* Serialize passed <b>object</b> data to the
<b>soapMessage</b>
* @param object to be serialized
* @param soapMessage where to write data
- * @throws ReliableMessagingException if something went wrong
+ * @throws RMException if something went wrong
*/
public static void serialize(AbstractSerializable object, SOAPMessage soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
getSerializer(object).serialize(object, object.getProvider(), soapMessage);
}
@@ -84,10 +84,10 @@
* Initialize passed <b>object</b> using data in
<b>soapMessage</b>
* @param object to be initialized
* @param soapMessage from which to read the data
- * @throws ReliableMessagingException if something went wrong
+ * @throws RMException if something went wrong
*/
public static void deserialize(AbstractSerializable object, SOAPMessage soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
getSerializer(object).deserialize(object, object.getProvider(), soapMessage);
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceResponseSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -31,7 +31,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
@@ -63,7 +63,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
TerminateSequenceResponse o = (TerminateSequenceResponse)object;
try
@@ -83,11 +83,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -98,7 +98,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
TerminateSequenceResponse o = (TerminateSequenceResponse)object;
try
@@ -119,7 +119,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/common/serialization/TerminateSequenceSerializer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -33,7 +33,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Constants;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
@@ -65,7 +65,7 @@
* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
TerminateSequence o = (TerminateSequence)object;
try
@@ -95,11 +95,11 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", se);
+ throw new RMException("Unable to deserialize RM message", se);
}
catch (RuntimeException re)
{
- throw new ReliableMessagingException("Unable to deserialize RM
message", re);
+ throw new RMException("Unable to deserialize RM message", re);
}
}
@@ -110,7 +110,7 @@
* @param soapMessage soap message to which object will be serialized
*/
public final void serialize(Serializable object, Provider provider, SOAPMessage
soapMessage)
- throws ReliableMessagingException
+ throws RMException
{
TerminateSequence o = (TerminateSequence)object;
try
@@ -139,7 +139,7 @@
}
catch (SOAPException se)
{
- throw new ReliableMessagingException("Unable to serialize RM message",
se);
+ throw new RMException("Unable to serialize RM message", se);
}
}
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,179 @@
+/*
+ * 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.policy;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ws.policy.AndCompositeAssertion;
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.apache.ws.policy.XorCompositeAssertion;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertionException;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+import org.jboss.ws.metadata.wsrm.DeliveryAssuranceMetaData;
+import org.jboss.ws.metadata.wsrm.PortMetaData;
+import org.jboss.ws.metadata.wsrm.ProviderMetaData;
+import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
+
+/**
+ * Reliable messaging policy deployer
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMPolicyAssertionDeployer implements AssertionDeployer
+{
+
+ private static final String WSRMP_NS =
"http://docs.oasis-open.org/ws-rx/wsrmp/200702";
+ private static final String WSRM_NS =
"http://docs.oasis-open.org/ws-rx/wsrm/200702";
+ private static final QName EXACTLY_ONCE = new QName(WSRMP_NS,
"ExactlyOnce");
+ private static final QName AT_LEAST_ONCE = new QName(WSRMP_NS,
"AtLeastOnce");
+ private static final QName AT_MOST_ONCE = new QName(WSRMP_NS,
"AtMostOnce");
+ private static final QName IN_ORDER = new QName(WSRMP_NS, "InOrder");
+ private static final String FALSE = "false";
+ private static final String TRUE = "true";
+
+ /*
+ * @see
org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer#deployClientSide(org.apache.ws.policy.PrimitiveAssertion,
org.jboss.ws.metadata.umdm.ExtensibleMetaData)
+ */
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData)
+ throws UnsupportedAssertionException
+ {
+ deploy(assertion, extMetaData);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer#deployServerSide(org.apache.ws.policy.PrimitiveAssertion,
org.jboss.ws.metadata.umdm.ExtensibleMetaData)
+ */
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData) throws UnsupportedAssertionException
+ {
+ deploy(assertion, extMetaData);
+ }
+
+ private static void deploy(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData)
+ throws UnsupportedAssertionException
+ {
+ if (extMetaData instanceof EndpointMetaData)
+ {
+ EndpointMetaData endpointMD = (EndpointMetaData) extMetaData;
+
+ // prepare wsrm metadata
+ ReliableMessagingMetaData rmMD = endpointMD.getConfig().getRMMetaData();
+ if (rmMD == null)
+ {
+ rmMD = new ReliableMessagingMetaData();
+ endpointMD.getConfig().setRMMetaData(rmMD);
+ }
+
+ // construct new port metadata
+ PortMetaData portMD = new PortMetaData();
+ portMD.setPortName(endpointMD.getPortName());
+ List<PrimitiveAssertion> wsrmpAssertions = getWSRMPAssertions(assertion);
+ portMD.setDeliveryAssurance(constructDeliveryAssurance(wsrmpAssertions));
+
+ // ensure port does not exists yet
+ for (PortMetaData pMD : rmMD.getPorts())
+ {
+ assert ! pMD.getPortName().equals(portMD.getPortName());
+ }
+
+ // set up port WSRMP metadata
+ rmMD.getPorts().add(portMD);
+ ProviderMetaData providerMD = new ProviderMetaData();
+ providerMD.setSpecVersion(WSRM_NS);
+ rmMD.setProvider(providerMD);
+ }
+ }
+
+ private static DeliveryAssuranceMetaData
constructDeliveryAssurance(List<PrimitiveAssertion> assertions)
+ throws UnsupportedAssertionException
+ {
+ if (assertions.size() == 1)
+ {
+ QName assertionQN = assertions.get(0).getName();
+ assertIsWSRMPAssertion(assertionQN);
+
+ DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
+ deliveryMD.setInOrder(FALSE);
+ deliveryMD.setQuality(assertionQN.getLocalPart());
+ return deliveryMD;
+ }
+ if (assertions.size() == 2)
+ {
+ QName firstAssertionQN = assertions.get(0).getName();
+ assertIsWSRMPAssertion(firstAssertionQN);
+ QName secondAssertionQN = assertions.get(1).getName();
+ assertIsWSRMPAssertion(secondAssertionQN);
+
+ boolean firstIsInOrder = firstAssertionQN.equals(IN_ORDER);
+
+ DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
+ deliveryMD.setInOrder(TRUE);
+ if (firstIsInOrder)
+ {
+ deliveryMD.setQuality(secondAssertionQN.getLocalPart());
+ }
+ else
+ {
+ deliveryMD.setQuality(firstAssertionQN.getLocalPart());
+ }
+
+ return deliveryMD;
+ }
+
+ throw new IllegalArgumentException();
+ }
+
+ private static void assertIsWSRMPAssertion(QName assertionQN) throws
UnsupportedAssertionException
+ {
+ if (assertionQN.equals(EXACTLY_ONCE)
+ || assertionQN.equals(AT_LEAST_ONCE)
+ || assertionQN.equals(AT_MOST_ONCE)
+ || assertionQN.equals(IN_ORDER))
+ {
+ return; // recognized assertion - silently return
+ }
+
+ throw new UnsupportedAssertionException();
+ }
+
+ private static List<PrimitiveAssertion> getWSRMPAssertions(PrimitiveAssertion
assertion)
+ {
+ Policy policy = (Policy)assertion.getTerms().get(0);
+ XorCompositeAssertion xor = (XorCompositeAssertion)policy.getTerms().get(0);
+ AndCompositeAssertion and = (AndCompositeAssertion)xor.getTerms().get(0);
+ List<?> primitiveAssertions = and.getTerms();
+
+ List<PrimitiveAssertion> retVal = new
LinkedList<PrimitiveAssertion>();
+ for (int i = 0; i < primitiveAssertions.size(); i++)
+ {
+ retVal.add((PrimitiveAssertion)primitiveAssertions.get(i));
+ }
+
+ return retVal;
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RMPolicyAssertionDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -1,174 +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.policy;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.ws.policy.AndCompositeAssertion;
-import org.apache.ws.policy.Policy;
-import org.apache.ws.policy.PrimitiveAssertion;
-import org.apache.ws.policy.XorCompositeAssertion;
-import org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer;
-import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertionException;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
-import org.jboss.ws.metadata.wsrm.DeliveryAssuranceMetaData;
-import org.jboss.ws.metadata.wsrm.PortMetaData;
-import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
-
-/**
- * Reliable messaging policy deployer
- *
- * @author richard.opalka(a)jboss.com
- */
-public final class WSRMPolicyAssertionDeployer implements AssertionDeployer
-{
-
- private static final String WSRMP_NS =
"http://docs.oasis-open.org/ws-rx/wsrmp/200702";
- private static final QName EXACTLY_ONCE = new QName(WSRMP_NS,
"ExactlyOnce");
- private static final QName AT_LEAST_ONCE = new QName(WSRMP_NS,
"AtLeastOnce");
- private static final QName AT_MOST_ONCE = new QName(WSRMP_NS,
"AtMostOnce");
- private static final QName IN_ORDER = new QName(WSRMP_NS, "InOrder");
- private static final String FALSE = "false";
- private static final String TRUE = "true";
-
- /*
- * @see
org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer#deployClientSide(org.apache.ws.policy.PrimitiveAssertion,
org.jboss.ws.metadata.umdm.ExtensibleMetaData)
- */
- public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData)
- throws UnsupportedAssertionException
- {
- deploy(assertion, extMetaData);
- }
-
- /*
- * @see
org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer#deployServerSide(org.apache.ws.policy.PrimitiveAssertion,
org.jboss.ws.metadata.umdm.ExtensibleMetaData)
- */
- public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData) throws UnsupportedAssertionException
- {
- deploy(assertion, extMetaData);
- }
-
- private static void deploy(PrimitiveAssertion assertion, ExtensibleMetaData
extMetaData)
- throws UnsupportedAssertionException
- {
- if (extMetaData instanceof EndpointMetaData)
- {
- EndpointMetaData endpointMD = (EndpointMetaData) extMetaData;
-
- // prepare wsrm metadata
- ReliableMessagingMetaData rmMD = endpointMD.getConfig().getRMMetaData();
- if (rmMD == null)
- {
- rmMD = new ReliableMessagingMetaData();
- endpointMD.getConfig().setRMMetaData(rmMD);
- }
-
- // construct new port metadata
- PortMetaData portMD = new PortMetaData();
- portMD.setPortName(endpointMD.getPortName());
- List<PrimitiveAssertion> wsrmpAssertions = getWSRMPAssertions(assertion);
- portMD.setDeliveryAssurance(constructDeliveryAssurance(wsrmpAssertions));
-
- // ensure port does not exists yet
- for (PortMetaData pMD : rmMD.getPorts())
- {
- assert ! pMD.getPortName().equals(portMD.getPortName());
- }
-
- // set up port WSRMP metadata
- rmMD.getPorts().add(portMD);
- }
- }
-
- private static DeliveryAssuranceMetaData
constructDeliveryAssurance(List<PrimitiveAssertion> assertions)
- throws UnsupportedAssertionException
- {
- if (assertions.size() == 1)
- {
- QName assertionQN = assertions.get(0).getName();
- assertIsWSRMPAssertion(assertionQN);
-
- DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
- deliveryMD.setInOrder(FALSE);
- deliveryMD.setQuality(assertionQN.getLocalPart());
- return deliveryMD;
- }
- if (assertions.size() == 2)
- {
- QName firstAssertionQN = assertions.get(0).getName();
- assertIsWSRMPAssertion(firstAssertionQN);
- QName secondAssertionQN = assertions.get(1).getName();
- assertIsWSRMPAssertion(secondAssertionQN);
-
- boolean firstIsInOrder = firstAssertionQN.equals(IN_ORDER);
-
- DeliveryAssuranceMetaData deliveryMD = new DeliveryAssuranceMetaData();
- deliveryMD.setInOrder(TRUE);
- if (firstIsInOrder)
- {
- deliveryMD.setQuality(secondAssertionQN.getLocalPart());
- }
- else
- {
- deliveryMD.setQuality(firstAssertionQN.getLocalPart());
- }
-
- return deliveryMD;
- }
-
- throw new IllegalArgumentException();
- }
-
- private static void assertIsWSRMPAssertion(QName assertionQN) throws
UnsupportedAssertionException
- {
- if (assertionQN.equals(EXACTLY_ONCE)
- || assertionQN.equals(AT_LEAST_ONCE)
- || assertionQN.equals(AT_MOST_ONCE)
- || assertionQN.equals(IN_ORDER))
- {
- return; // recognized assertion - silently return
- }
-
- throw new UnsupportedAssertionException();
- }
-
- private static List<PrimitiveAssertion> getWSRMPAssertions(PrimitiveAssertion
assertion)
- {
- Policy policy = (Policy)assertion.getTerms().get(0);
- XorCompositeAssertion xor = (XorCompositeAssertion)policy.getTerms().get(0);
- AndCompositeAssertion and = (AndCompositeAssertion)xor.getTerms().get(0);
- List<?> primitiveAssertions = and.getTerms();
-
- List<PrimitiveAssertion> retVal = new
LinkedList<PrimitiveAssertion>();
- for (int i = 0; i < primitiveAssertions.size(); i++)
- {
- retVal.add((PrimitiveAssertion)primitiveAssertions.get(i));
- }
-
- return retVal;
- }
-
-}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200502;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
@@ -132,7 +132,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200502;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
@@ -182,7 +182,7 @@
public void validate()
{
if (this.acksTo == null)
- throw new ReliableMessagingException("AcksTo must be set");
+ throw new RMException("AcksTo must be set");
}
/*
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200502;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
@@ -196,7 +196,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier must be set");
+ throw new RMException("Identifier must be set");
}
/*
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -25,7 +25,7 @@
import java.util.LinkedList;
import java.util.Collections;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
@@ -215,9 +215,9 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0))
- throw new ReliableMessagingException("AcknowledgementRange or Nack must be
set");
+ throw new RMException("AcknowledgementRange or Nack must be set");
}
private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200502;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
@@ -138,7 +138,7 @@
public void validate()
{
if (this.faultCode == null)
- throw new ReliableMessagingException("FaultCode must be set");
+ throw new RMException("FaultCode must be set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200502;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
@@ -152,9 +152,9 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier must be set");
+ throw new RMException("Identifier must be set");
if (this.messageNumber == 0)
- throw new ReliableMessagingException("MessageNumber must be set");
+ throw new RMException("MessageNumber must be set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200502;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
@@ -123,7 +123,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/AckRequestedImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
@@ -123,7 +123,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
@@ -132,7 +132,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CloseSequenceResponseImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
@@ -107,7 +107,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
@@ -182,7 +182,7 @@
public void validate()
{
if (this.acksTo == null)
- throw new ReliableMessagingException("AcksTo must be set");
+ throw new RMException("AcksTo must be set");
}
/*
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/CreateSequenceResponseImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
@@ -210,7 +210,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier must be set");
+ throw new RMException("Identifier must be set");
}
/*
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceAcknowledgementImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -25,7 +25,7 @@
import java.util.LinkedList;
import java.util.Collections;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
@@ -237,9 +237,9 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0)
&& (!this.isNone))
- throw new ReliableMessagingException("AcknowledgementRange or Nack or None
must be set");
+ throw new RMException("AcknowledgementRange or Nack or None must be
set");
}
private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceFaultImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
@@ -138,7 +138,7 @@
public void validate()
{
if (this.faultCode == null)
- throw new ReliableMessagingException("FaultCode must be set");
+ throw new RMException("FaultCode must be set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
@@ -148,9 +148,9 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier must be set");
+ throw new RMException("Identifier must be set");
if (this.messageNumber == 0)
- throw new ReliableMessagingException("MessageNumber must be set");
+ throw new RMException("MessageNumber must be set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
@@ -132,7 +132,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/TerminateSequenceResponseImpl.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.spec200702;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
import org.jboss.ws.extensions.wsrm.common.serialization.AbstractSerializable;
import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
@@ -107,7 +107,7 @@
public void validate()
{
if (this.identifier == null)
- throw new ReliableMessagingException("Identifier not set");
+ throw new RMException("Identifier not set");
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Serializable.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -23,7 +23,7 @@
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.extensions.wsrm.ReliableMessagingException;
+import org.jboss.ws.extensions.wsrm.RMException;
/**
* This interface identifies classes that are de/serializable from/to SOAP messages
@@ -36,20 +36,20 @@
/**
* Serialize object instance to SOAP message
* @param soapMessage
- * @throws ReliableMessagingException is something went wrong
+ * @throws RMException is something went wrong
*/
- void serializeTo(SOAPMessage soapMessage) throws ReliableMessagingException;
+ void serializeTo(SOAPMessage soapMessage) throws RMException;
/**
* Deserialize object instance from SOAP message
* @param soapMessage ReliableMessagingException is something went wrong
*/
- void deserializeFrom(SOAPMessage soapMessage) throws ReliableMessagingException;
+ void deserializeFrom(SOAPMessage soapMessage) throws RMException;
/**
* Validate object state if everything is all right
- * @throws ReliableMessagingException if object is in incorrect state
+ * @throws RMException if object is in incorrect state
*/
- void validate() throws ReliableMessagingException;
+ void validate() throws RMException;
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -28,6 +28,7 @@
import java.util.*;
import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingType;
@@ -36,6 +37,7 @@
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder;
+import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -110,6 +112,30 @@
throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
}
}
+
+ private void setupRMOperations(EndpointMetaData endpointMD)
+ {
+ String rmSpecVersion =
endpointMD.getConfig().getRMMetaData().getProvider().getSpecVersion();
+ Provider rmProvider = Provider.getInstance(rmSpecVersion);
+
+ // register createSequence method
+ QName createSequenceQName = rmProvider.getConstants().getCreateSequenceQName();
+ OperationMetaData createSequenceMD = new OperationMetaData(endpointMD,
createSequenceQName, "createSequence");
+ createSequenceMD.setOneWay(false);
+ endpointMD.addOperation(createSequenceMD);
+
+ // register closeSequence method
+ QName closeSequenceQName = rmProvider.getConstants().getCloseSequenceQName();
+ OperationMetaData closeSequenceMD = new OperationMetaData(endpointMD,
closeSequenceQName, "closeSequence");
+ closeSequenceMD.setOneWay(false);
+ endpointMD.addOperation(closeSequenceMD);
+
+ // register terminateSequence method
+ QName terminateSequenceQName =
rmProvider.getConstants().getTerminateSequenceQName();
+ OperationMetaData terminateSequenceMD = new OperationMetaData(endpointMD,
terminateSequenceQName, "terminateSequence");
+ terminateSequenceMD.setOneWay(false);
+ endpointMD.addOperation(terminateSequenceMD);
+ }
/** Build from WSDL and service name
*/
@@ -307,6 +333,12 @@
// Eager initialization
epMetaData.eagerInitialize();
+ // wsrm initialization
+ if (epMetaData.getConfig().getRMMetaData() != null)
+ {
+ setupRMOperations(epMetaData);
+ }
+
if(log.isDebugEnabled()) log.debug("END: rebuildMetaData\n" +
epMetaData.getServiceMetaData());
}
Added:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/RMEndpointEmulator.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/RMEndpointEmulator.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/RMEndpointEmulator.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -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.test.ws.jaxws.wsrm.emulator;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * RM endpoint emulator
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 23, 2007
+ */
+public class RMEndpointEmulator extends HttpServlet
+{
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ doPost(req, resp);
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ String requestMessage = getRequestMessage(req);
+ String responseMessage = getResponseMessage(requestMessage);
+ resp.setContentType("text/xml");
+ PrintWriter out = resp.getWriter();
+ out.write(responseMessage);
+ out.flush();
+ out.close();
+ }
+
+ private String getResponseMessage(String requestMessage)
+ {
+ return "";
+ }
+
+ private String getRequestMessage(HttpServletRequest req) throws IOException
+ {
+ BufferedReader reader = req.getReader();
+ String line = null;
+ StringBuilder sb = new StringBuilder();
+ while ((line = reader.readLine()) != null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/RMEndpointEmulator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -29,8 +29,8 @@
import junit.framework.Test;
+import org.jboss.ws.extensions.wsrm.RMProvider;
import org.jboss.ws.extensions.wsrm.RMSequence;
-import org.jboss.ws.extensions.wsrm.RMSequenceFactory;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.jboss.test.ws.jaxws.wsrm.OneWayServiceIface;
@@ -64,13 +64,14 @@
public void testOneWayMethods() throws Exception
{
System.out.println("FIXME [JBWS-515] Provide an initial implementation for
WS-ReliableMessaging");
- RMSequence sequence = RMSequenceFactory.newInstance(proxy);
+ RMProvider wsrmProvider = (RMProvider)proxy;
+ RMSequence sequence = wsrmProvider.createSequence();
System.out.println("Created sequence with id=" + sequence.getId());
proxy.method1();
proxy.method2("Hello World");
sequence.setLastMessage();
proxy.method3(new String[] {"Hello","World"});
- if (!sequence.completed(1000, TimeUnit.MILLISECONDS)) {
+ if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
fail("Sequence not completed within specified time amount");
} else {
sequence.terminate();
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java 2007-10-23
18:18:43 UTC (rev 4867)
@@ -21,33 +21,27 @@
*/
package org.jboss.test.ws.jaxws.wsrm.reqres;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-import java.io.StringReader;
import java.net.URL;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Dispatch;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Response;
import javax.xml.ws.Service;
-import javax.xml.ws.Service.Mode;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
import junit.framework.Test;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.DOMWriter;
import org.jboss.test.ws.jaxws.wsrm.ReqResServiceIface;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.wsrm.RMSequence;
-import org.jboss.ws.extensions.wsrm.RMSequenceFactory;
+import org.jboss.ws.extensions.wsrm.RMProvider;
/**
* Reliable JBoss WebService client invoking req/res methods
@@ -57,17 +51,16 @@
*/
public class ReqResTestCase extends JBossWSTest
{
+ private final String serviceURL = "http://" + getServerHost() +
":8080/jaxws-wsrm/ReqResService";
private static final String HELLO_WORLD_MSG = "Hello World";
private static final String TARGET_NS = "http://org.jboss.ws/jaxws/wsrm";
- private static final String REQ_PAYLOAD = "<ns2:echo xmlns:ns2='" +
TARGET_NS + "'><String_1>" + HELLO_WORLD_MSG +
"</String_1></ns2:echo>";
private Exception handlerException;
private boolean asyncHandlerCalled;
private ReqResServiceIface proxy;
- private Dispatch<Source> dispatch;
private enum InvocationType
{
- SYNC, ASYNC, ASYNC_DISPATCH, ASYNC_FUTURE
+ SYNC, ASYNC, ASYNC_FUTURE
}
public static Test suite()
@@ -80,12 +73,13 @@
{
super.setUp();
- QName serviceName = new QName(TARGET_NS, "ReqResService");
- QName portName = new QName(TARGET_NS, "ReqResPort");
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-wsrm/ReqResService?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
- proxy = (ReqResServiceIface)service.getPort(ReqResServiceIface.class);
+ if (proxy == null)
+ {
+ QName serviceName = new QName(TARGET_NS, "ReqResService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = (ReqResServiceIface)service.getPort(ReqResServiceIface.class);
+ }
}
public void testSynchronousInvocation() throws Exception
@@ -103,11 +97,6 @@
doReliableMessageExchange(proxy, InvocationType.ASYNC_FUTURE);
}
- public void testAsynchronousInvocationUsingDispatch() throws Exception
- {
- doReliableMessageExchange(dispatch, InvocationType.ASYNC_DISPATCH);
- }
-
private void doSynchronousInvocation() throws Exception
{
assertEquals(proxy.echo(HELLO_WORLD_MSG), HELLO_WORLD_MSG);
@@ -142,29 +131,6 @@
ensureAsyncStatus();
}
- private void doAsynchronousInvocationUsingDispatch() throws Exception
- {
- AsyncHandler<Source> handler = new AsyncHandler<Source>()
- {
- public void handleResponse(Response<Source> response)
- {
- try
- {
- verifyResponse(response.get());
- asyncHandlerCalled = true;
- }
- catch (Exception ex)
- {
- handlerException = ex;
- }
- }
- };
- StreamSource reqObj = new StreamSource(new StringReader(REQ_PAYLOAD));
- Future<?> future = dispatch.invokeAsync(reqObj, handler);
- future.get(1000, TimeUnit.MILLISECONDS);
- ensureAsyncStatus();
- }
-
private void ensureAsyncStatus() throws Exception
{
if (handlerException != null) throw handlerException;
@@ -173,37 +139,41 @@
asyncHandlerCalled = false;
}
- private void verifyResponse(Source result) throws IOException
- {
- Element resElement = DOMUtils.sourceToElement(result);
- String resStr = DOMWriter.printNode(resElement, false);
- assertTrue("Unexpected response: " + resStr,
resStr.contains("<result>" + HELLO_WORLD_MSG +
"</result>"));
- }
-
private void invokeWebServiceMethod(InvocationType invocationType) throws Exception
{
switch (invocationType) {
case SYNC: doSynchronousInvocation(); break;
case ASYNC: doAsynchronousInvocation(); break;
case ASYNC_FUTURE: doAsynchronousInvocationUsingFuture(); break;
- case ASYNC_DISPATCH: doAsynchronousInvocationUsingDispatch(); break;
default : fail("Unknown invocation type");
}
}
private void doReliableMessageExchange(Object proxyObject, InvocationType
invocationType) throws Exception
{
+
setAddressingProperties("http://docs.oasis-open.org/ws-rx/wsrm/20070...;
System.out.println("FIXME [JBWS-515] Provide an initial implementation for
WS-ReliableMessaging");
- RMSequence sequence = RMSequenceFactory.newInstance(proxyObject);
+ RMProvider wsrmProvider = (RMProvider)proxyObject;
+ RMSequence sequence = wsrmProvider.createSequence();
System.out.println("Created sequence with id=" + sequence.getId());
+ setAddressingProperties("http://useless/action");
invokeWebServiceMethod(invocationType);
+ setAddressingProperties("http://useless/action");
invokeWebServiceMethod(invocationType);
sequence.setLastMessage();
+ setAddressingProperties("http://useless/action");
invokeWebServiceMethod(invocationType);
- if (!sequence.completed(1000, TimeUnit.MILLISECONDS)) {
+ if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
fail("Sequence not completed within specified time amount");
} else {
sequence.terminate();
}
}
+
+ private void setAddressingProperties(String wsaAction) {
+ BindingProvider bp = (BindingProvider)proxy;
+ AddressingProperties props = AddressingClientUtil.createAnonymousProps(wsaAction,
serviceURL);
+ bp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
props);
+ }
+
}
Modified:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml 2007-10-23
18:18:43 UTC (rev 4867)
@@ -15,6 +15,19 @@
<config-file>META-INF/config.xml</config-file>
</message-store>
</reliable-messaging>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>WSRM Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.wsrm.RMClientHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
</client-config>
</jaxws-config>
Modified:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml 2007-10-23
17:50:38 UTC (rev 4866)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/WEB-INF/wsrm-jaxws-endpoint-config.xml 2007-10-23
18:18:43 UTC (rev 4867)
@@ -11,15 +11,23 @@
<reliable-messaging>
<delivery-assurance inOrder="true"
quality="AtLeastOnce"/>
<provider
specVersion="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
- <message-store
- id="wsrmStoreId"
- class="custom.MessageStoreImpl">
+ <message-store id="wsrmStoreId"
class="custom.MessageStoreImpl">
<config-file>META-INF/config.xml</config-file>
</message-store>
- <port name="{http://org.jboss.ws/jaxws/wsrm}ReqResPort">
- <delivery-assurance inOrder="false"
quality="AtMostOnce"/>
- </port>
</reliable-messaging>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ <!--javaee:handler>
+ <javaee:handler-name>WSRM Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.ws.extensions.wsrm.RMServerHandler</javaee:handler-class>
+ </javaee:handler-->
+ </javaee:handler-chain>
+ </post-handler-chains>
</endpoint-config>
</jaxws-config>
Added:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>RMEndpointEmulator</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.wsrm.emulator.RMEndpointEmulator</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>RMEndpointEmulator</servlet-name>
+ <url-pattern>/ReqResService</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="ReqResService"
targetNamespace="http://org.jboss.ws/jaxws/wsrm"
xmlns:tns="http://org.jboss.ws/jaxws/wsrm"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ </types>
+ <message name="ReqRes_echo">
+ <part name="String_1" type="xsd:string">
+ </part>
+ </message>
+ <message name="ReqRes_echoResponse">
+ <part name="result" type="xsd:string">
+ </part>
+ </message>
+ <portType name="ReqRes">
+ <operation name="echo" parameterOrder="String_1">
+ <input message="tns:ReqRes_echo">
+ </input>
+ <output message="tns:ReqRes_echoResponse">
+ </output>
+ </operation>
+ </portType>
+ <binding name="ReqResBinding" type="tns:ReqRes">
+ <wsp:PolicyReference URI="#exactly_one_in_order_rm_delivery"/>
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"
namespace="http://org.jboss.ws/jaxws/wsrm"/>
+ </input>
+ <output>
+ <soap:body use="literal"
namespace="http://org.jboss.ws/jaxws/wsrm"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="ReqResService">
+ <port name="ReqResPort" binding="tns:ReqResBinding">
+ <soap:address
location="http://127.0.0.1:8080/jaxws-wsrm/ReqResService"/>
+ </port>
+ </service>
+ <wsp:Policy wsu:Id="exactly_one_in_order_rm_delivery"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsp:All>
+ <wsrmp:DeliveryAssurance
xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+ </wsp:All>
+ </wsp:Policy>
+</definitions>
Property changes on:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/ReqResService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/test.log
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/test.log
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/test.log 2007-10-23
18:18:43 UTC (rev 4867)
@@ -0,0 +1,8 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+ <env:Header/>
+ <env:Body>
+ <ns1:echoResponse xmlns:ns1='http://org.jboss.ws/jaxws/wsrm'>
+ <result>Hello World</result>
+ </ns1:echoResponse>
+ </env:Body>
+</env:Envelope>