JBossWS SVN: r5196 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/wsrm/transport and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-05 13:16:22 -0500 (Wed, 05 Dec 2007)
New Revision: 5196
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
Log:
implementing resending functionality - first prototype
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-12-05 16:34:09 UTC (rev 5195)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-12-05 18:16:22 UTC (rev 5196)
@@ -31,8 +31,6 @@
import java.util.Map;
import java.util.Observable;
import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java 2007-12-05 16:34:09 UTC (rev 5195)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java 2007-12-05 18:16:22 UTC (rev 5196)
@@ -23,10 +23,14 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.wsrm.api.RMException;
/**
* WS-RM channel manager ensures message reliable delivery according to sequence configuration
@@ -41,6 +45,8 @@
private static final Logger logger = Logger.getLogger(RMChannelManagerImpl.class);
private static RMChannelManager instance = new RMChannelManagerImpl();
private static final ExecutorService rmChannelPool = Executors.newFixedThreadPool(5, new RMThreadFactory());
+ private static final int countOfAttempts = 10;
+ private static final int timeToWait = 2;
private static final class RMThreadFactory implements ThreadFactory
{
@@ -96,8 +102,35 @@
public final RMMessage send(RMMessage request) throws Throwable
{
- RMChannelResponse result = rmChannelPool.submit(new RMChannelTask(request)).get();
+ // submit new task to channel
+ // if response has no fault - delete saved request and return response to the client
+ // if response has fault - try to detect it's type
+
+ RMChannelResponse result = null;
+ long startTime = 0L;
+ long endTime = 0L;
+
+ for (int i = 0; i < countOfAttempts; i++)
+ {
+ Future<RMChannelResponse> futureResult = rmChannelPool.submit(new RMChannelTask(request));
+ try
+ {
+ startTime = System.currentTimeMillis();
+ result = futureResult.get(timeToWait, TimeUnit.SECONDS);
+ endTime = System.currentTimeMillis();
+ logger.debug("Response message received in " + (endTime - startTime) + " miliseconds");
+ break;
+ }
+ catch (TimeoutException te)
+ {
+ endTime = System.currentTimeMillis();
+ logger.warn("Response message not received in " + (endTime - startTime) + " miliseconds");
+ }
+ }
+ if (result == null)
+ throw new RMException("Unable to deliver message with addressing id: " + RMTransportHelper.getMessageId(request));
+
Throwable fault = result.getFault();
if (fault != null)
{
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java 2007-12-05 16:34:09 UTC (rev 5195)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java 2007-12-05 18:16:22 UTC (rev 5196)
@@ -29,8 +29,10 @@
import java.io.PrintWriter;
import java.net.Socket;
import java.net.URL;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Random;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@@ -52,9 +54,11 @@
public class EndpointEmulator extends HttpServlet
{
+ private static final Random generator = new Random();
private String configFile;
private ServletContext ctx;
private List<View> views;
+ private Map<String, Integer> delayedMessages;
@Override
public void init(ServletConfig config) throws ServletException
@@ -89,6 +93,7 @@
protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
+ delayedMessages = new HashMap<String, Integer>();
handleRequest(HTTP_GET, req, res);
}
@@ -127,6 +132,37 @@
}
}
+ try
+ {
+ boolean sleep = generator.nextBoolean();
+ if (sleep)
+ {
+ Integer countOfDelayedMessages = this.delayedMessages.get(view.getId());
+ if (countOfDelayedMessages == null)
+ {
+ countOfDelayedMessages = 0;
+ }
+ if (countOfDelayedMessages.intValue() < 5)
+ {
+ Thread.sleep(5 * 1000);
+ ctx.log("serving request after " + 5 + " seconds");
+ this.delayedMessages.put(view.getId(), countOfDelayedMessages.intValue() + 1);
+ }
+ else
+ {
+ ctx.log("serving request immediately");
+ }
+ }
+ else
+ {
+ ctx.log("serving request immediately");
+ }
+ }
+ catch (InterruptedException ie)
+ {
+ ctx.log(ie.getMessage(), ie);
+ }
+
if (responseTo == null)
{
ctx.log("Sending response through ServletResponse");
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-12-05 16:34:09 UTC (rev 5195)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-12-05 18:16:22 UTC (rev 5196)
@@ -28,7 +28,10 @@
import java.io.IOException;
import java.net.URL;
import java.util.Properties;
+import java.util.concurrent.Executor;
import java.util.concurrent.Future;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.xml.namespace.QName;
@@ -58,6 +61,11 @@
private Exception handlerException;
private boolean asyncHandlerCalled;
private ReqResServiceIface proxy;
+ private static final TimeUnit testTimeUnit = TimeUnit.SECONDS;
+ private static final long testWaitPeriod = 180L;
+ private static final Executor testExecutor = new ThreadPoolExecutor(
+ 0, 5, testWaitPeriod, testTimeUnit, new SynchronousQueue<Runnable>()
+ );
static
{
@@ -91,6 +99,7 @@
QName serviceName = new QName(TARGET_NS, "ReqResService");
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
+ service.setExecutor(testExecutor);
proxy = (ReqResServiceIface)service.getPort(ReqResServiceIface.class);
}
}
@@ -129,7 +138,7 @@
{
try
{
- String retStr = (String) response.get(1000, TimeUnit.MILLISECONDS);
+ String retStr = (String) response.get(testWaitPeriod, testTimeUnit);
assertEquals(HELLO_WORLD_MSG, retStr);
asyncHandlerCalled = true;
}
@@ -140,7 +149,7 @@
}
};
Future<?> future = proxy.echoAsync(HELLO_WORLD_MSG, handler);
- future.get(1000, TimeUnit.MILLISECONDS);
+ future.get(testWaitPeriod, testTimeUnit);
ensureAsyncStatus();
}
17 years, 1 month
JBossWS SVN: r5195 - framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/eardeployment.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-05 11:34:09 -0500 (Wed, 05 Dec 2007)
New Revision: 5195
Modified:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java
Log:
Remove stale FIXME
Modified: framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java 2007-12-05 16:31:47 UTC (rev 5194)
+++ framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/eardeployment/EarTestCase.java 2007-12-05 16:34:09 UTC (rev 5195)
@@ -56,7 +56,6 @@
{
if (isIntegrationCXF())
{
- System.out.println("FIXME: [JBWS-1746] - Add support for configurable invoker in cxf.xml");
System.out.println("FIXME: [JBWS-1655] - Add support for endpoint address rewriting");
return;
}
@@ -66,9 +65,9 @@
Service service = Service.create(new URL(soapAddress + "?wsdl"), serviceName);
TestEndpoint port = service.getPort(TestEndpoint.class);
- Definition wsdl = getWSDLDefinition(soapAddress + "?wsdl");
- String nsURI = wsdl.getNamespace("jbws1616");
- assertEquals("http://jira.jboss.org/jira/browse/JBWS-1616", nsURI);
+ Definition wsdl = getWSDLDefinition(soapAddress + "?wsdl");
+ String nsURI = wsdl.getNamespace("jbws1616");
+ assertEquals("http://jira.jboss.org/jira/browse/JBWS-1616", nsURI);
BindingProvider bp = (BindingProvider)port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, soapAddress);
17 years, 1 month
JBossWS SVN: r5194 - framework/trunk/src/test/resources/jaxws/samples/webservice/META-INF02/wsdl.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-05 11:31:47 -0500 (Wed, 05 Dec 2007)
New Revision: 5194
Modified:
framework/trunk/src/test/resources/jaxws/samples/webservice/META-INF02/wsdl/TestService.wsdl
Log:
Use default CXF message part names.
Modified: framework/trunk/src/test/resources/jaxws/samples/webservice/META-INF02/wsdl/TestService.wsdl
===================================================================
--- framework/trunk/src/test/resources/jaxws/samples/webservice/META-INF02/wsdl/TestService.wsdl 2007-12-05 15:43:57 UTC (rev 5193)
+++ framework/trunk/src/test/resources/jaxws/samples/webservice/META-INF02/wsdl/TestService.wsdl 2007-12-05 16:31:47 UTC (rev 5194)
@@ -3,13 +3,13 @@
<definitions name="TestService" targetNamespace="http://www.openuri.org/2004/04/HelloWorld" xmlns:tns="http://www.openuri.org/2004/04/HelloWorld" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types/>
<message name="EndpointInterface_echo">
- <part name="String_1" type="xsd:string"/>
+ <part name="arg0" type="xsd:string"/>
</message>
<message name="EndpointInterface_echoResponse">
- <part name="result" type="xsd:string"/>
+ <part name="return" type="xsd:string"/>
</message>
<portType name="EndpointInterface">
- <operation name="echo" parameterOrder="String_1">
+ <operation name="echo" parameterOrder="arg0">
<input message="tns:EndpointInterface_echo"/>
<output message="tns:EndpointInterface_echoResponse"/>
</operation>
17 years, 1 month
JBossWS SVN: r5193 - in stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm: transport and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-05 10:43:57 -0500 (Wed, 05 Dec 2007)
New Revision: 5193
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManager.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java
Log:
refactoring - all WS-RM messages will go through RMChannelManager
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-12-05 15:25:26 UTC (rev 5192)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-12-05 15:43:57 UTC (rev 5193)
@@ -25,7 +25,6 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
-import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -66,6 +65,7 @@
public final class RMSequenceImpl implements RMSequence, RMUnassignedMessageListener
{
private static final Logger logger = Logger.getLogger(RMSequenceImpl.class);
+ private static final String PATH_PREFIX = "/temporary_listen_address/";
private static final RMConstants wsrmConstants = RMProvider.get().getConstants();
private final RMConfig wsrmConfig;
@@ -111,7 +111,7 @@
logger.debug("Backports server configuration omits host configuration - using autodetected " + host);
}
String port = wsrmConfig.getBackPortsServer().getPort();
- String path = "/temporary_listen_address/" + UUIDGenerator.generateRandomUUIDString();
+ String path = PATH_PREFIX + UUIDGenerator.generateRandomUUIDString();
this.backPort = new URI("http://" + host + ":" + port + path);
}
catch (URISyntaxException use)
@@ -128,7 +128,7 @@
public final Set<Long> getReceivedInboundMessages()
{
- return Collections.unmodifiableSet(this.receivedInboundMessages);
+ return this.receivedInboundMessages;
}
public final BindingProvider getBindingProvider()
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java 2007-12-05 15:25:26 UTC (rev 5192)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannel.java 2007-12-05 15:43:57 UTC (rev 5193)
@@ -32,10 +32,6 @@
import java.io.ByteArrayOutputStream;
import java.util.Map;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.atomic.AtomicInteger;
/**
* RM Channel
@@ -56,30 +52,8 @@
}
// Holds the list of tasks that will be send to the remoting transport channel
- private static final ExecutorService rmChannelPool = Executors.newFixedThreadPool(5, new RMThreadFactory());
+ private static final RMChannelManager rmChannelManager = RMChannelManagerImpl.getInstance();
- private static final class RMThreadFactory implements ThreadFactory
- {
- final ThreadGroup group;
- final AtomicInteger threadNumber = new AtomicInteger(1);
- final String namePrefix = "rm-pool-thread-";
-
- private RMThreadFactory()
- {
- SecurityManager sm = System.getSecurityManager();
- group = (sm != null) ? sm.getThreadGroup() : Thread.currentThread().getThreadGroup();
- }
-
- public Thread newThread(Runnable r)
- {
- Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0);
- if (t.isDaemon())
- t.setDaemon(false);
- if (t.getPriority() != Thread.NORM_PRIORITY)
- t.setPriority(Thread.NORM_PRIORITY);
- return t;
- }
- }
private RMMessage createRMMessage(MessageAbstraction request, RMMetadata rmMetadata) throws Throwable
{
@@ -122,16 +96,7 @@
private RMMessage sendToChannel(RMMessage request) throws Throwable
{
- RMChannelResponse result = rmChannelPool.submit(new RMChannelRequest(request)).get();
-
- Throwable fault = result.getFault();
- if (fault != null)
- {
- throw fault;
- }
- else
- {
- return result.getResponse();
- }
+ return rmChannelManager.send(request);
}
+
}
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManager.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManager.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManager.java 2007-12-05 15:43:57 UTC (rev 5193)
@@ -0,0 +1,41 @@
+/*
+ * 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.transport;
+
+/**
+ * WS-RM channel manager interface
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Dec 5, 2007
+ */
+public interface RMChannelManager
+{
+
+ /**
+ * Send request to server reliably
+ * @param request RM request wrapper
+ * @return RM response wrapper
+ */
+ RMMessage send(RMMessage request) throws Throwable;
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java 2007-12-05 15:43:57 UTC (rev 5193)
@@ -0,0 +1,112 @@
+/*
+ * 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.transport;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.jboss.logging.Logger;
+
+/**
+ * WS-RM channel manager ensures message reliable delivery according to sequence configuration
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Dec 5, 2007
+ */
+public final class RMChannelManagerImpl implements Runnable, RMChannelManager
+{
+
+ private static final Logger logger = Logger.getLogger(RMChannelManagerImpl.class);
+ private static RMChannelManager instance = new RMChannelManagerImpl();
+ private static final ExecutorService rmChannelPool = Executors.newFixedThreadPool(5, new RMThreadFactory());
+
+ private static final class RMThreadFactory implements ThreadFactory
+ {
+ final ThreadGroup group;
+ final AtomicInteger threadNumber = new AtomicInteger(1);
+ final String namePrefix = "rm-pool-thread-";
+
+ private RMThreadFactory()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ group = (sm != null) ? sm.getThreadGroup() : Thread.currentThread().getThreadGroup();
+ }
+
+ public Thread newThread(Runnable r)
+ {
+ Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0);
+ if (t.isDaemon())
+ t.setDaemon(false);
+ if (t.getPriority() != Thread.NORM_PRIORITY)
+ t.setPriority(Thread.NORM_PRIORITY);
+ return t;
+ }
+ }
+
+ private RMChannelManagerImpl()
+ {
+ Thread thread = new Thread(this, "RMChannelManager");
+ thread.setDaemon(true);
+ thread.start();
+ }
+
+ public static final RMChannelManager getInstance()
+ {
+ return instance;
+ }
+
+ public final void run()
+ {
+ while (true)
+ {
+ logger.debug("checking persistent store for undelivered messages");
+ try
+ {
+ Thread.sleep(10);
+ }
+ catch (InterruptedException ie)
+ {
+ logger.warn(ie.getMessage(), ie);
+ }
+ }
+
+ }
+
+ public final RMMessage send(RMMessage request) throws Throwable
+ {
+ RMChannelResponse result = rmChannelPool.submit(new RMChannelTask(request)).get();
+
+ Throwable fault = result.getFault();
+ if (fault != null)
+ {
+ throw fault;
+ }
+ else
+ {
+ return result.getResponse();
+ }
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java 2007-12-05 15:25:26 UTC (rev 5192)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelRequest.java 2007-12-05 15:43:57 UTC (rev 5193)
@@ -1,143 +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.transport;
-
-import static org.jboss.ws.extensions.wsrm.RMConstant.*;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.util.Map;
-import java.util.concurrent.Callable;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.ws.core.MessageTrace;
-import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
-import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandler;
-import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandlerFactory;
-
-/**
- * Represents request that goes to the RM channel
- * @see org.jboss.ws.extensions.wsrm.transport.RMChannel
- * @author richard.opalka(a)jboss.com
- */
-public final class RMChannelRequest implements Callable<RMChannelResponse>
-{
- private static final Logger logger = Logger.getLogger(RMChannelRequest.class);
- private static final String JBOSSWS_SUBSYSTEM = "jbossws";
- private final RMMessage rmRequest;
-
- RMChannelRequest(RMMessage rmRequest)
- {
- super();
- this.rmRequest = rmRequest;
- }
-
- public RMChannelResponse call()
- {
- InvokerLocator locator = null;
- try
- {
- locator = new InvokerLocator((String)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT).get(TARGET_ADDRESS));
- }
- catch (MalformedURLException e)
- {
- return new RMChannelResponse(new IllegalArgumentException("Malformed endpoint address", e));
- }
-
- try
- {
- URI backPort = RMTransportHelper.getBackPortURI(rmRequest);
- String messageId = RMTransportHelper.getMessageId(rmRequest);
-
- logger.debug("[WS-RM] backport URI is: " + backPort);
- RMCallbackHandler callbackHandler = null;
- // TODO: we should remember WSA:MessageId here too
-
- if (backPort != null)
- {
- callbackHandler = RMCallbackHandlerFactory.getCallbackHandler(backPort);
- RMSequenceImpl sequence = RMTransportHelper.getSequence(rmRequest);
- if (sequence != null)
- {
- callbackHandler.addUnassignedMessageListener(sequence);
- }
- }
- boolean oneWay = RMTransportHelper.isOneWayOperation(rmRequest);
-
- Client client = new Client(locator, JBOSSWS_SUBSYSTEM, rmRequest.getMetadata().getContext(REMOTING_CONFIGURATION_CONTEXT));
- client.connect();
-
- client.setMarshaller(RMMarshaller.getInstance());
-
- if ((false == oneWay) && (null == backPort))
- client.setUnMarshaller(RMUnMarshaller.getInstance());
-
- Map<String, Object> remotingInvocationContext = rmRequest.getMetadata().getContext(REMOTING_INVOCATION_CONTEXT);
- if (logger.isDebugEnabled())
- logger.debug("Remoting metadata: " + remotingInvocationContext);
-
- // debug the outgoing request message
- MessageTrace.traceMessage("Outgoing RM Request Message", rmRequest.getPayload());
-
- RMMessage rmResponse = null;
- if (oneWay && (null == backPort))
- {
- client.invokeOneway(rmRequest.getPayload(), remotingInvocationContext, false);
- }
- else
- {
- Object retVal = client.invoke(rmRequest.getPayload(), remotingInvocationContext);
- if ((null != retVal) && (false == (retVal instanceof RMMessage)))
- {
- String msg = retVal.getClass().getName() + ": '" + retVal + "'";
- logger.warn(msg);
- throw new RuntimeException(msg);
- }
- rmResponse = (RMMessage)retVal;
- }
-
- // Disconnect the remoting client
- client.disconnect();
-
- // trace the incomming response message
- if (rmResponse != null)
- MessageTrace.traceMessage("Incoming RM Response Message", rmResponse.getPayload());
-
- if (backPort != null) // TODO: backport support
- {
- if ((null != messageId) && (false == RMTransportHelper.isOneWayOperation(rmRequest)))
- {
- // register callbacks only for outbound messages with messageId
- return new RMChannelResponse(callbackHandler, messageId);
- }
- }
-
- return new RMChannelResponse(rmResponse);
- }
- catch (Throwable t)
- {
- return new RMChannelResponse(t);
- }
- }
-}
\ No newline at end of file
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java 2007-12-05 15:43:57 UTC (rev 5193)
@@ -0,0 +1,143 @@
+/*
+ * 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.transport;
+
+import static org.jboss.ws.extensions.wsrm.RMConstant.*;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.ws.core.MessageTrace;
+import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
+import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandler;
+import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandlerFactory;
+
+/**
+ * Represents request that goes to the RM channel
+ * @see org.jboss.ws.extensions.wsrm.transport.RMChannel
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMChannelTask implements Callable<RMChannelResponse>
+{
+ private static final Logger logger = Logger.getLogger(RMChannelTask.class);
+ private static final String JBOSSWS_SUBSYSTEM = "jbossws";
+ private final RMMessage rmRequest;
+
+ RMChannelTask(RMMessage rmRequest)
+ {
+ super();
+ this.rmRequest = rmRequest;
+ }
+
+ public RMChannelResponse call()
+ {
+ InvokerLocator locator = null;
+ try
+ {
+ locator = new InvokerLocator((String)rmRequest.getMetadata().getContext(INVOCATION_CONTEXT).get(TARGET_ADDRESS));
+ }
+ catch (MalformedURLException e)
+ {
+ return new RMChannelResponse(new IllegalArgumentException("Malformed endpoint address", e));
+ }
+
+ try
+ {
+ URI backPort = RMTransportHelper.getBackPortURI(rmRequest);
+ String messageId = RMTransportHelper.getMessageId(rmRequest);
+
+ logger.debug("[WS-RM] backport URI is: " + backPort);
+ RMCallbackHandler callbackHandler = null;
+ // TODO: we should remember WSA:MessageId here too
+
+ if (backPort != null)
+ {
+ callbackHandler = RMCallbackHandlerFactory.getCallbackHandler(backPort);
+ RMSequenceImpl sequence = RMTransportHelper.getSequence(rmRequest);
+ if (sequence != null)
+ {
+ callbackHandler.addUnassignedMessageListener(sequence);
+ }
+ }
+ boolean oneWay = RMTransportHelper.isOneWayOperation(rmRequest);
+
+ Client client = new Client(locator, JBOSSWS_SUBSYSTEM, rmRequest.getMetadata().getContext(REMOTING_CONFIGURATION_CONTEXT));
+ client.connect();
+
+ client.setMarshaller(RMMarshaller.getInstance());
+
+ if ((false == oneWay) && (null == backPort))
+ client.setUnMarshaller(RMUnMarshaller.getInstance());
+
+ Map<String, Object> remotingInvocationContext = rmRequest.getMetadata().getContext(REMOTING_INVOCATION_CONTEXT);
+ if (logger.isDebugEnabled())
+ logger.debug("Remoting metadata: " + remotingInvocationContext);
+
+ // debug the outgoing request message
+ MessageTrace.traceMessage("Outgoing RM Request Message", rmRequest.getPayload());
+
+ RMMessage rmResponse = null;
+ if (oneWay && (null == backPort))
+ {
+ client.invokeOneway(rmRequest.getPayload(), remotingInvocationContext, false);
+ }
+ else
+ {
+ Object retVal = client.invoke(rmRequest.getPayload(), remotingInvocationContext);
+ if ((null != retVal) && (false == (retVal instanceof RMMessage)))
+ {
+ String msg = retVal.getClass().getName() + ": '" + retVal + "'";
+ logger.warn(msg);
+ throw new RuntimeException(msg);
+ }
+ rmResponse = (RMMessage)retVal;
+ }
+
+ // Disconnect the remoting client
+ client.disconnect();
+
+ // trace the incomming response message
+ if (rmResponse != null)
+ MessageTrace.traceMessage("Incoming RM Response Message", rmResponse.getPayload());
+
+ if (backPort != null) // TODO: backport support
+ {
+ if ((null != messageId) && (false == RMTransportHelper.isOneWayOperation(rmRequest)))
+ {
+ // register callbacks only for outbound messages with messageId
+ return new RMChannelResponse(callbackHandler, messageId);
+ }
+ }
+
+ return new RMChannelResponse(rmResponse);
+ }
+ catch (Throwable t)
+ {
+ return new RMChannelResponse(t);
+ }
+ }
+}
\ No newline at end of file
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMChannelTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 1 month
JBossWS SVN: r5192 - stack/cxf/trunk/src/test/resources.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-05 10:25:26 -0500 (Wed, 05 Dec 2007)
New Revision: 5192
Modified:
stack/cxf/trunk/src/test/resources/test-excludes-jboss500.txt
Log:
Update CXF excludes
Modified: stack/cxf/trunk/src/test/resources/test-excludes-jboss500.txt
===================================================================
--- stack/cxf/trunk/src/test/resources/test-excludes-jboss500.txt 2007-12-05 15:01:02 UTC (rev 5191)
+++ stack/cxf/trunk/src/test/resources/test-excludes-jboss500.txt 2007-12-05 15:25:26 UTC (rev 5192)
@@ -40,16 +40,7 @@
# [CXF-1253] CXF does not respect @HandlerChain on client SEI
org/jboss/test/ws/jaxws/samples/logicalhandler/**
-# [JBWS-1757] Investigate CXF samples soapbinding
-org/jboss/test/ws/jaxws/samples/soapbinding/**
+# [CXF-1261] Handler does not see XOP message properly
+org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
-# [JBWS-1758] Investigate CXF samples webmethod
-org/jboss/test/ws/jaxws/samples/webmethod/**
-# [JBWS-1759] Investigate CXF samples webservice
-org/jboss/test/ws/jaxws/samples/webservice/**
-
-# [JBWS-1760] Investigate CXF samples xop
-org/jboss/test/ws/jaxws/samples/xop/**
-
-
17 years, 1 month
JBossWS SVN: r5191 - in framework/trunk/src/test: resources/jaxws/samples/webservice/WEB-INF02/wsdl and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-05 10:01:02 -0500 (Wed, 05 Dec 2007)
New Revision: 5191
Modified:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface.java
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceBase.java
framework/trunk/src/test/resources/jaxws/samples/webservice/WEB-INF02/wsdl/TestService.wsdl
Log:
Remove RemoteException from SEI.
Use default CXF message part names.
Modified: framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface.java 2007-12-05 13:43:53 UTC (rev 5190)
+++ framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface.java 2007-12-05 15:01:02 UTC (rev 5191)
@@ -37,7 +37,7 @@
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld")
@SOAPBinding(style = Style.RPC)
-public interface EndpointInterface extends Remote
+public interface EndpointInterface
{
- String echo(String input) throws RemoteException;
+ String echo(String input);
}
Modified: framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java 2007-12-05 13:43:53 UTC (rev 5190)
+++ framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java 2007-12-05 15:01:02 UTC (rev 5191)
@@ -35,9 +35,9 @@
*/
@WebService(targetNamespace = "http://foo")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface EndpointInterface03 extends Remote
+public interface EndpointInterface03
{
// SEI with @WebService should expose all methods
// http://jira.jboss.org/jira/browse/JBWS-755
- String echo(String input) throws RemoteException;
+ String echo(String input);
}
Modified: framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceBase.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceBase.java 2007-12-05 13:43:53 UTC (rev 5190)
+++ framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceBase.java 2007-12-05 15:01:02 UTC (rev 5191)
@@ -58,21 +58,18 @@
return service.getPort(EndpointInterface03.class);
}
- private void sayHello(String endpointURI) throws RemoteException, MalformedURLException
+ public void webServiceTest(String endpointURI) throws Exception
{
String helloWorld = "Hello world!";
Object retObj = getPort(endpointURI).echo(helloWorld);
assertEquals(helloWorld, retObj);
}
- public void webServiceTest(String endpointURI) throws Exception
- {
- sayHello(endpointURI);
- }
-
public void webServiceWsdlLocationTest(String endpointURI) throws Exception
{
- sayHello(endpointURI);
+ String helloWorld = "Hello world!";
+ Object retObj = getPort(endpointURI).echo(helloWorld);
+ assertEquals(helloWorld, retObj);
}
public void webServiceEndpointInterfaceTest(String endpointURI) throws Exception
Modified: framework/trunk/src/test/resources/jaxws/samples/webservice/WEB-INF02/wsdl/TestService.wsdl
===================================================================
--- framework/trunk/src/test/resources/jaxws/samples/webservice/WEB-INF02/wsdl/TestService.wsdl 2007-12-05 13:43:53 UTC (rev 5190)
+++ framework/trunk/src/test/resources/jaxws/samples/webservice/WEB-INF02/wsdl/TestService.wsdl 2007-12-05 15:01:02 UTC (rev 5191)
@@ -3,13 +3,13 @@
<definitions name="TestService" targetNamespace="http://www.openuri.org/2004/04/HelloWorld" xmlns:tns="http://www.openuri.org/2004/04/HelloWorld" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types/>
<message name="EndpointInterface_echo">
- <part name="String_1" type="xsd:string"/>
+ <part name="arg0" type="xsd:string"/>
</message>
<message name="EndpointInterface_echoResponse">
- <part name="result" type="xsd:string"/>
+ <part name="return" type="xsd:string"/>
</message>
<portType name="EndpointInterface">
- <operation name="echo" parameterOrder="String_1">
+ <operation name="echo" parameterOrder="arg0">
<input message="tns:EndpointInterface_echo"/>
<output message="tns:EndpointInterface_echoResponse"/>
</operation>
17 years, 1 month
JBossWS SVN: r5190 - framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webmethod.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-05 08:43:53 -0500 (Wed, 05 Dec 2007)
New Revision: 5190
Modified:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
Log:
FIXME [CXF-1258] soap:Fault response does not cause SOAPFaultException
Modified: framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java 2007-12-05 13:33:53 UTC (rev 5189)
+++ framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java 2007-12-05 13:43:53 UTC (rev 5190)
@@ -139,6 +139,12 @@
" <faultstring>Endpoint {http://webmethod.samples.jaxws.ws.test.jboss.org/}TestEndpointPort does not contain operation meta data for: {http://webmethod.samples.jaxws.ws.test.jboss.org/}noWebMethod</faultstring>" +
"</env:Fault>";
+ if (isIntegrationCXF())
+ {
+ System.out.println("FIXME [CXF-1258] soap:Fault response does not cause SOAPFaultException");
+ return;
+ }
+
Service service = Service.create(wsdlURL, serviceName);
Dispatch dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
try
17 years, 1 month
JBossWS SVN: r5189 - framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/soapbinding.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-12-05 08:33:53 -0500 (Wed, 05 Dec 2007)
New Revision: 5189
Modified:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java
Log:
FIXME [CXF-1257] Cannot create proxy for namespaced doc/wrapped
Modified: framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java 2007-12-05 12:55:00 UTC (rev 5188)
+++ framework/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java 2007-12-05 13:33:53 UTC (rev 5189)
@@ -157,6 +157,12 @@
public void testDocWrappedService() throws Exception
{
+ if (isIntegrationCXF())
+ {
+ System.out.println("FIXME [CXF-1257] Cannot create proxy for namespaced doc/wrapped");
+ return;
+ }
+
QName serviceName = new QName(targetNS, "DocWrappedService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-soapbinding/DocWrappedService?wsdl");
17 years, 1 month
JBossWS SVN: r5188 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/wsrm/config and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-05 07:55:00 -0500 (Wed, 05 Dec 2007)
New Revision: 5188
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMBackPortsServerConfig.java
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
stack/native/trunk/src/main/resources/schema/jaxws-config_2_0.xsd
stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
Log:
backports server is now configurable
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-12-05 10:10:32 UTC (rev 5187)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-12-05 12:55:00 UTC (rev 5188)
@@ -21,8 +21,10 @@
*/
package org.jboss.ws.extensions.wsrm;
+import java.net.InetAddress;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.UnknownHostException;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
@@ -94,18 +96,34 @@
{
super();
if (wsrmConfig == null)
- throw new IllegalArgumentException();
+ throw new RMException("WS-RM configuration missing");
+ if (wsrmConfig.getBackPortsServer() == null)
+ throw new RMException("WS-RM backports server configuration missing");
this.addressableClient = addrType;
this.wsrmConfig = wsrmConfig;
try
{
- this.backPort = new URI("http://localhost:8888/temporary_listen_address/" + UUIDGenerator.generateRandomUUIDString());
+ String host = wsrmConfig.getBackPortsServer().getHost();
+ if (host == null)
+ {
+ host = InetAddress.getLocalHost().getCanonicalHostName();
+ logger.debug("Backports server configuration omits host configuration - using autodetected " + host);
+ }
+ String port = wsrmConfig.getBackPortsServer().getPort();
+ String path = "/temporary_listen_address/" + UUIDGenerator.generateRandomUUIDString();
+ this.backPort = new URI("http://" + host + ":" + port + path);
}
catch (URISyntaxException use)
{
logger.warn(use);
+ throw new RMException(use.getMessage(), use);
}
+ catch (UnknownHostException uhe)
+ {
+ logger.warn(uhe);
+ throw new RMException(uhe.getMessage(), uhe);
+ }
}
public final Set<Long> getReceivedInboundMessages()
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMBackPortsServerConfig.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMBackPortsServerConfig.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMBackPortsServerConfig.java 2007-12-05 12:55:00 UTC (rev 5188)
@@ -0,0 +1,57 @@
+/*
+ * 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.config;
+
+/**
+ * Reliable messaging backports server provider metadata
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Dec 5, 2007
+ */
+public final class RMBackPortsServerConfig
+{
+
+ private String host;
+ private String port;
+
+ public final String getHost()
+ {
+ return host;
+ }
+
+ public final void setHost(String hostname)
+ {
+ this.host = hostname;
+ }
+
+ public final String getPort()
+ {
+ return port;
+ }
+
+ public final void setPort(String port)
+ {
+ this.port = port;
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMBackPortsServerConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java 2007-12-05 10:10:32 UTC (rev 5187)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/config/RMConfig.java 2007-12-05 12:55:00 UTC (rev 5188)
@@ -34,6 +34,7 @@
private RMDeliveryAssuranceConfig deliveryAssurance;
private RMProviderConfig provider;
+ private RMBackPortsServerConfig backportsServer;
private RMMessageStoreConfig messageStore;
private List<RMPortConfig> ports = new LinkedList<RMPortConfig>();
@@ -50,6 +51,16 @@
return this.deliveryAssurance;
}
+ public final void setBackPortsServer(RMBackPortsServerConfig backportsServer)
+ {
+ this.backportsServer = backportsServer;
+ }
+
+ public final RMBackPortsServerConfig getBackPortsServer()
+ {
+ return this.backportsServer;
+ }
+
public final void setProvider(RMProviderConfig provider)
{
if (provider == null)
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2007-12-05 10:10:32 UTC (rev 5187)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2007-12-05 12:55:00 UTC (rev 5188)
@@ -38,6 +38,7 @@
import org.xml.sax.Attributes;
import org.jboss.ws.extensions.wsrm.RMDeliveryAssurance;
import org.jboss.ws.extensions.wsrm.RMDeliveryAssuranceFactory;
+import org.jboss.ws.extensions.wsrm.config.RMBackPortsServerConfig;
import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
import org.jboss.ws.extensions.wsrm.config.RMMessageStoreConfig;
import org.jboss.ws.extensions.wsrm.config.RMConfig;
@@ -152,6 +153,24 @@
wsrmConfig.setDeliveryAssurance(deliveryAssurance);
return deliveryAssurance;
}
+ if (localName.equals("backports-server"))
+ {
+ String host = null, port = null;
+ for (int i = 0; i < countOfAttributes && (host == null || port == null); i++)
+ {
+ String attrLocalName = attrs.getLocalName(i);
+ if (attrLocalName.equals("host"))
+ host = attrs.getValue(i);
+ if (attrLocalName.equals("port"))
+ port = attrs.getValue(i);
+ }
+
+ RMBackPortsServerConfig backportsServer = new RMBackPortsServerConfig();
+ backportsServer.setHost(host);
+ backportsServer.setPort(port);
+ wsrmConfig.setBackPortsServer(backportsServer);
+ return backportsServer;
+ }
if (localName.equals("provider"))
{
String specVersion = null;
Modified: stack/native/trunk/src/main/resources/schema/jaxws-config_2_0.xsd
===================================================================
--- stack/native/trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2007-12-05 10:10:32 UTC (rev 5187)
+++ stack/native/trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2007-12-05 12:55:00 UTC (rev 5188)
@@ -71,6 +71,14 @@
</xsd:documentation>
</xsd:annotation>
</xsd:element>
+ <xsd:element name="backports-server" type="tns:backportsServerType" minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+ Backports server configuration to be used for addressable clients.
+ Users must always configure backports server on client machines.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
<xsd:element name="provider" type="tns:providerType">
<xsd:annotation>
<xsd:documentation>
@@ -94,6 +102,23 @@
</xsd:element>
</xsd:sequence>
</xsd:complexType>
+ <xsd:complexType name="backportsServerType">
+ <xsd:attribute name="host" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+ Host name to be used for backports server. If not specified default one will be detected.
+ Make sure you have DNS correctly configured so runtime is able to detect your real hostname.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="port" type="xsd:int" use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+ Port number to be used for backports server.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
<xsd:complexType name="msgStoreType">
<xsd:sequence>
<xsd:element name="config-file" type="xsd:string">
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2007-12-05 10:10:32 UTC (rev 5187)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2007-12-05 12:55:00 UTC (rev 5188)
@@ -26,14 +26,12 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.extensions.wsrm.RMDeliveryAssurance;
-import org.jboss.ws.extensions.wsrm.RMDeliveryQuality;
+import org.jboss.ws.extensions.wsrm.config.RMBackPortsServerConfig;
import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
import org.jboss.ws.extensions.wsrm.config.RMMessageStoreConfig;
import org.jboss.ws.extensions.wsrm.config.RMConfig;
import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
import org.jboss.ws.extensions.wsrm.config.RMProviderConfig;
-import org.jboss.ws.extensions.wsrm.spi.RMProvider;
import org.jboss.ws.metadata.config.EndpointProperty;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.ws.metadata.config.jaxrpc.CommonConfigJAXRPC;
@@ -157,5 +155,8 @@
assertEquals(port2.getPortName(), new QName("http://custom/namespace/", "Port2"));
assertEquals(port2.getDeliveryAssurance().getInOrder(), "true");
assertEquals(port2.getDeliveryAssurance().getQuality(), "ExactlyOnce");
+ RMBackPortsServerConfig backportsServer = wsrmConfig.getBackPortsServer();
+ assertEquals(backportsServer.getHost(), "realhostname.realdomain");
+ assertEquals(backportsServer.getPort(), "9999");
}
}
Modified: stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
===================================================================
--- stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2007-12-05 10:10:32 UTC (rev 5187)
+++ stack/native/trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2007-12-05 12:55:00 UTC (rev 5188)
@@ -46,6 +46,7 @@
<config-name>Standard WSRM Endpoint</config-name>
<reliable-messaging>
<delivery-assurance inOrder="true" quality="AtLeastOnce"/>
+ <backports-server host="realhostname.realdomain" port="9999"/>
<provider
specVersion="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
<message-store
Modified: stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml 2007-12-05 10:10:32 UTC (rev 5187)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml 2007-12-05 12:55:00 UTC (rev 5188)
@@ -10,6 +10,7 @@
<config-name>Standard WSRM Client</config-name>
<reliable-messaging>
<delivery-assurance inOrder="true" quality="AtLeastOnce"/>
+ <backports-server port="7777"/>
<provider specVersion="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
<message-store id="wsrmStoreId" class="custom.MessageStoreImpl">
<config-file>META-INF/config.xml</config-file>
17 years, 1 month
JBossWS SVN: r5187 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/wsrm and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-12-05 05:10:32 -0500 (Wed, 05 Dec 2007)
New Revision: 5187
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMAddressingType.java
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java
Log:
wsrm API enhancement - added javadoc
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -70,7 +70,6 @@
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.RMSequenceImpl;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.common.RMHelper;
import org.jboss.ws.extensions.wsrm.spi.RMConstants;
@@ -508,21 +507,19 @@
// WS-RM support //
///////////////////
@SuppressWarnings("unchecked")
- public org.jboss.ws.extensions.wsrm.api.RMSequence createSequence(RMAddressingType addrType) throws RMException
+ public org.jboss.ws.extensions.wsrm.api.RMSequence createSequence(boolean addressableClient) throws RMException
{
if (this.wsrmSequence != null)
throw new IllegalStateException("Sequence already registered with proxy instance");
- if (addrType == null)
- throw new IllegalArgumentException("Addressing type cannot be null");
try
{
// set up addressing data
- RMSequenceImpl candidateSequence = new RMSequenceImpl(addrType, getEndpointMetaData().getConfig().getRMMetaData());
+ RMSequenceImpl candidateSequence = new RMSequenceImpl(addressableClient, getEndpointMetaData().getConfig().getRMMetaData());
String address = getEndpointMetaData().getEndpointAddress();
String action = RMConstant.CREATE_SEQUENCE_WSA_ACTION;
AddressingProperties addressingProps = null;
- if (addrType == RMAddressingType.ADDRESSABLE)
+ if (addressableClient)
{
addressingProps = AddressingClientUtil.createDefaultProps(action, address);
addressingProps.setReplyTo(AddressingBuilder.getAddressingBuilder().newEndpointReference(candidateSequence.getBackPort()));
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -45,7 +45,6 @@
import org.jboss.ws.core.utils.UUIDGenerator;
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.wsrm.config.RMConfig;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.ws.extensions.wsrm.api.RMException;
import org.jboss.ws.extensions.wsrm.api.RMSequence;
import org.jboss.ws.extensions.wsrm.spi.RMConstants;
@@ -68,7 +67,7 @@
private static final RMConstants wsrmConstants = RMProvider.get().getConstants();
private final RMConfig wsrmConfig;
- private final RMAddressingType addrType;
+ private final boolean addressableClient;
private final Set<Long> acknowledgedOutboundMessages = new TreeSet<Long>();
private final Set<Long> receivedInboundMessages = new TreeSet<Long>();
private RMIncompleteSequenceBehavior behavior = RMIncompleteSequenceBehavior.NO_DISCARD;
@@ -91,13 +90,13 @@
logger.debug("Unassigned message available in callback handler");
}
- public RMSequenceImpl(RMAddressingType addrType, RMConfig wsrmConfig)
+ public RMSequenceImpl(boolean addrType, RMConfig wsrmConfig)
{
super();
- if ((addrType == null) || (wsrmConfig == null))
+ if (wsrmConfig == null)
throw new IllegalArgumentException();
- this.addrType = addrType;
+ this.addressableClient = addrType;
this.wsrmConfig = wsrmConfig;
try
{
@@ -180,7 +179,7 @@
public final URI getBackPort()
{
// no need for synchronization
- return (this.addrType == RMAddressingType.ADDRESSABLE) ? this.backPort : null;
+ return (this.addressableClient) ? this.backPort : null;
}
public final long newMessageNumber()
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMAddressingType.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMAddressingType.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMAddressingType.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -1,41 +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.api;
-
-/**
- * This enumeration specifies client type that will be used for WS-RM exchange
- *
- * @author richard.opalka(a)jboss.com
- *
- * @since Nov 28, 2007
- */
-public enum RMAddressingType
-{
- /**
- * Specifies that client is anonymous
- */
- ANONYMOUS,
- /**
- * Specifies that client is addressable
- */
- ADDRESSABLE
-}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMException.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -24,8 +24,13 @@
import javax.xml.ws.WebServiceException;
/**
- * Reliable messaging exception
+ * WS-RM exception
+ *
* @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 22, 2007
+ * @see org.jboss.ws.extensions.wsrm.api.RMProvider
+ * @see org.jboss.ws.extensions.wsrm.api.RMSequence
*/
public class RMException extends WebServiceException
{
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMProvider.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -22,11 +22,24 @@
package org.jboss.ws.extensions.wsrm.api;
/**
- * TODO: add comment
+ * WS-RM provider used for sequence creation. Typical usecase is:
+ *
+ * <p><blockquote><pre>
+ * boolean addressableClient = true;
+ * SEI sei = (SEI)service.getPort(SEI.class)
+ * RMSequence sequence = ((RMProvider)sei).createSequence(addressableClient);
+ * ...
+ * sei.callMethod1();
+ * sei.callMethod2();
+ * ...
+ * sequence.close();
+ * </pre></blockquote></p>
*
* @author richard.opalka(a)jboss.com
*
* @since Oct 22, 2007
+ * @see org.jboss.ws.extensions.wsrm.api.RMSequence
+ * @see org.jboss.ws.extensions.wsrm.api.RMException
*/
public interface RMProvider
{
@@ -34,7 +47,7 @@
* Creates new WS-RM sequence
* @param addressableClient
* @return created sequence
- * @throws RMException
+ * @throws unchecked RMException if sequence creation error occurs
*/
- RMSequence createSequence(RMAddressingType addrType);
+ RMSequence createSequence(boolean addressableClient);
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/api/RMSequence.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -21,7 +21,23 @@
*/
package org.jboss.ws.extensions.wsrm.api;
+/**
+ * WS-RM sequence. User can only create sequence using <b>RMProvider</b>
+ * interface and close sequence using <b>RMSequence</b> interface
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 22, 2007
+ * @see org.jboss.ws.extensions.wsrm.api.RMProvider
+ * @see org.jboss.ws.extensions.wsrm.api.RMException
+ */
public interface RMSequence
{
+
+ /**
+ * Close the sequence
+ * @throws unchecked RMException if sequence termination failed
+ */
void close();
+
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -35,7 +35,7 @@
import org.jboss.ws.extensions.wsrm.transport.RMUnassignedMessageListener;
/**
- * TODO: Add comment
+ * Reliable messaging callback handler listens for incomming requests on specified path
*
* @author richard.opalka(a)jboss.com
*
@@ -50,6 +50,10 @@
private List<RMMessage> arrivedUnassignedMessages = new LinkedList<RMMessage>();
private RMUnassignedMessageListener listener;
+ /**
+ * Request path to listen for incomming messages
+ * @param handledPath
+ */
public RMCallbackHandlerImpl(String handledPath)
{
super();
@@ -59,7 +63,7 @@
public Throwable getFault(String messageId)
{
- // TODO Auto-generated method stub
+ // TODO implement
return null;
}
@@ -75,7 +79,9 @@
{
logger.debug("Setting response object");
MessageTrace.traceMessage("Incoming RM Response Message", requestMessage.getBytes());
- RMMessage message = RMMessageFactory.newMessage(requestMessage.getBytes(), new RMMetadata(new java.util.HashMap<String, Object>())); // TODO create map metadata
+ // TODO: is it necessary to initialize metadata from request message?
+ RMMetadata metadata = new RMMetadata(new java.util.HashMap<String, Object>());
+ RMMessage message = RMMessageFactory.newMessage(requestMessage.getBytes(), metadata);
String startPattern = "<wsa:RelatesTo>"; // TODO: remove this with XML content inspection
String endPattern = "</wsa:RelatesTo>";
int begin = requestMessage.indexOf(startPattern) + startPattern.length();
@@ -118,12 +124,12 @@
{
try
{
- logger.debug("waiting for response object associated with message id: " + messageId);
+ logger.debug("waiting for response with message id: " + messageId);
instanceLock.wait(100);
}
- catch (InterruptedException ignore)
+ catch (InterruptedException ie)
{
- // TODO: never ignore exceptions - LOG it using logger
+ logger.warn(ie.getMessage(), ie);
}
}
return this.arrivedMessages.get(messageId);
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAbstractOneWayTest.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -32,7 +32,6 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.ws.extensions.wsrm.api.RMSequence;
import org.jboss.wsf.test.JBossWSTest;
@@ -88,7 +87,7 @@
RMSequence sequence = null;
if (emulatorOn)
{
- sequence = ((RMProvider)proxy).createSequence(getAddressingType());
+ sequence = ((RMProvider)proxy).createSequence(isClientAddressable());
}
setAddrProps(proxy, "http://useless/action1", serviceURL);
proxy.method1();
@@ -107,6 +106,6 @@
return props.getProperty("archives");
}
- protected abstract RMAddressingType getAddressingType();
+ protected abstract boolean isClientAddressable();
}
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAddressableOneWayTestCase.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -23,7 +23,6 @@
import junit.framework.Test;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -41,9 +40,9 @@
return new JBossWSTestSetup(RMAddressableOneWayTestCase.class, getClasspath());
}
- public final RMAddressingType getAddressingType()
+ public final boolean isClientAddressable()
{
- return RMAddressingType.ADDRESSABLE;
+ return true;
}
}
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/RMAnonymousOneWayTestCase.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -21,14 +21,8 @@
*/
package org.jboss.test.ws.jaxws.wsrm.oneway;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
import junit.framework.Test;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -46,9 +40,9 @@
return new JBossWSTestSetup(RMAnonymousOneWayTestCase.class, getClasspath());
}
- public final RMAddressingType getAddressingType()
+ public final boolean isClientAddressable()
{
- return RMAddressingType.ANONYMOUS;
+ return false;
}
}
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAbstractReqResTest.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -39,7 +39,6 @@
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.test.ws.jaxws.wsrm.ReqResServiceIface;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.ws.extensions.wsrm.api.RMSequence;
@@ -170,7 +169,7 @@
RMSequence sequence = null;
if (emulatorOn)
{
- sequence = ((RMProvider)proxyObject).createSequence(getAddressingType());
+ sequence = ((RMProvider)proxyObject).createSequence(isClientAddressable());
}
setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
@@ -189,6 +188,6 @@
return props.getProperty("archives");
}
- protected abstract RMAddressingType getAddressingType();
+ protected abstract boolean isClientAddressable();
}
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAddressableReqResTestCase.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -23,7 +23,6 @@
import junit.framework.Test;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -41,9 +40,9 @@
return new JBossWSTestSetup(RMAddressableReqResTestCase.class, getClasspath());
}
- public final RMAddressingType getAddressingType()
+ public final boolean isClientAddressable()
{
- return RMAddressingType.ADDRESSABLE;
+ return true;
}
}
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java 2007-12-05 09:14:23 UTC (rev 5186)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/RMAnonymousReqResTestCase.java 2007-12-05 10:10:32 UTC (rev 5187)
@@ -23,7 +23,6 @@
import junit.framework.Test;
-import org.jboss.ws.extensions.wsrm.api.RMAddressingType;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -41,9 +40,9 @@
return new JBossWSTestSetup(RMAnonymousReqResTestCase.class, getClasspath());
}
- public final RMAddressingType getAddressingType()
+ public final boolean isClientAddressable()
{
- return RMAddressingType.ANONYMOUS;
+ return false;
}
}
17 years, 1 month