[jbossws-commits] JBossWS SVN: r10242 - in stack/native/branches/netty: modules/client and 11 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Fri Jun 26 10:18:14 EDT 2009
Author: alessio.soldano at jboss.com
Date: 2009-06-26 10:18:13 -0400 (Fri, 26 Jun 2009)
New Revision: 10242
Added:
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/Marshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/UnMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSClientPipelineFactory.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java
Modified:
stack/native/branches/netty/modules/client/pom.xml
stack/native/branches/netty/modules/core/pom.xml
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/JsonConnectionHTTP.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageUnMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageUnMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageAssembler.java
stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.bat
stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.sh
stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.bat
stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.sh
stack/native/branches/netty/modules/resources/src/main/resources/resources/default-deploy.conf
stack/native/branches/netty/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
stack/native/branches/netty/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wseventing/SubscriptionManagerTestCase.java
stack/native/branches/netty/pom.xml
stack/native/branches/netty/src/main/scripts/assembly-deploy-artifacts.xml
Log:
Netty client, first cut. This is really a WIP, RM completely disabled, correct chunks handling still to do, SSL / HTTPS not supported yet, further major refactoring required
Modified: stack/native/branches/netty/modules/client/pom.xml
===================================================================
--- stack/native/branches/netty/modules/client/pom.xml 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/client/pom.xml 2009-06-26 14:18:13 UTC (rev 10242)
@@ -49,7 +49,7 @@
<configuration>
<archive>
<manifestEntries>
- <Class-Path>jbossws-spi.jar jbossws-common.jar jbossws-framework.jar jbossws-native-core.jar jbossws-native-jaxrpc.jar jbossws-native-jaxws.jar jbossws-native-jaxws-ext.jar jbossws-native-saaj.jar activation.jar commons-logging.jar concurrent.jar javassist.jar jaxb-api.jar jaxb-impl.jar mail.jar jboss-remoting.jar jboss-xml-binding.jar policy.jar stax-api.jar wsdl4j.jar</Class-Path>
+ <Class-Path>jbossws-spi.jar jbossws-common.jar jbossws-framework.jar jbossws-native-core.jar jbossws-native-jaxrpc.jar jbossws-native-jaxws.jar jbossws-native-jaxws-ext.jar jbossws-native-saaj.jar activation.jar commons-logging.jar concurrent.jar javassist.jar jaxb-api.jar jaxb-impl.jar mail.jar jboss-remoting.jar jboss-xml-binding.jar netty.jar policy.jar stax-api.jar wsdl4j.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
Modified: stack/native/branches/netty/modules/core/pom.xml
===================================================================
--- stack/native/branches/netty/modules/core/pom.xml 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/pom.xml 2009-06-26 14:18:13 UTC (rev 10242)
@@ -149,6 +149,10 @@
<artifactId>jboss-remoting</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ </dependency>
+ <dependency>
<groupId>wscommons-policy</groupId>
<artifactId>policy</artifactId>
</dependency>
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -333,11 +333,12 @@
Map<String, Object> callProps = new HashMap<String, Object>(getRequestContext());
EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress, callProps);
- if (shouldMaintainSession())
+ boolean maintainSession = shouldMaintainSession();
+ if (maintainSession)
addSessionInfo(reqMessage, callProps);
RemoteConnection remoteConnection = new RemoteConnectionFactory().getRemoteConnection(epInfo);
- MessageAbstraction resMessage = remoteConnection.invoke(reqMessage, epInfo, oneway);
+ MessageAbstraction resMessage = remoteConnection.invoke(reqMessage, epInfo, oneway, maintainSession);
if (shouldMaintainSession())
saveSessionInfo(callProps, getRequestContext());
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -25,8 +25,6 @@
import javax.xml.soap.MimeHeaders;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.soap.FastInfosetMarshaller;
import org.jboss.ws.core.soap.FastInfosetUnMarshaller;
@@ -53,10 +51,12 @@
@Override
protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
{
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- mimeHeaders.setHeader(MimeConstants.CONTENT_TYPE, MimeConstants.TYPE_FASTINFOSET);
- mimeHeaders.addHeader(MimeConstants.ACCEPT, MimeConstants.TYPE_FASTINFOSET);
-
+ if (reqMessage != null)
+ {
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
+ mimeHeaders.setHeader(MimeConstants.CONTENT_TYPE, MimeConstants.TYPE_FASTINFOSET);
+ mimeHeaders.addHeader(MimeConstants.ACCEPT, MimeConstants.TYPE_FASTINFOSET);
+ }
super.populateHeaders(reqMessage, metadata);
}
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -21,8 +21,6 @@
*/
package org.jboss.ws.core.client;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.ws.core.jaxws.binding.HTTPMessageMarshaller;
import org.jboss.ws.core.jaxws.binding.HTTPMessageUnMarshaller;
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -22,14 +22,15 @@
package org.jboss.ws.core.client;
import java.io.IOException;
-import java.lang.reflect.Field;
-import java.net.MalformedURLException;
-import java.net.SocketTimeoutException;
-import java.net.URL;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.Properties;
+import java.util.concurrent.Executors;
import javax.xml.rpc.Stub;
import javax.xml.soap.MimeHeader;
@@ -38,13 +39,23 @@
import javax.xml.ws.addressing.EndpointReference;
import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.Version;
-import org.jboss.remoting.marshal.MarshalFactory;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.transport.http.HTTPClientInvoker;
+import org.jboss.netty.bootstrap.ClientBootstrap;
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBufferOutputStream;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.channel.ChannelFactory;
+import org.jboss.netty.channel.ChannelFuture;
+import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
+import org.jboss.netty.handler.codec.http.DefaultHttpChunk;
+import org.jboss.netty.handler.codec.http.DefaultHttpRequest;
+import org.jboss.netty.handler.codec.http.HttpChunk;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
+import org.jboss.netty.handler.codec.http.HttpMessage;
+import org.jboss.netty.handler.codec.http.HttpMethod;
+import org.jboss.netty.handler.codec.http.HttpRequest;
+import org.jboss.netty.handler.codec.http.HttpVersion;
+import org.jboss.security.Base64Encoder;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.MessageTrace;
@@ -52,7 +63,6 @@
import org.jboss.ws.core.WSTimeoutException;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.wsrm.transport.RMChannel;
-import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
import org.jboss.ws.extensions.wsrm.transport.RMTransportHelper;
import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.ws.metadata.config.CommonConfig;
@@ -77,32 +87,32 @@
// provide logging
private static Logger log = Logger.getLogger(HTTPRemotingConnection.class);
- private Map<String, Object> clientConfig = new HashMap<String, Object>();
+ // private Map<String, Object> clientConfig = new HashMap<String, Object>();
- private static Map<String, String> metadataMap = new HashMap<String, String>();
- static
- {
- metadataMap.put(Stub.USERNAME_PROPERTY, "http.basic.username");
- metadataMap.put(Stub.PASSWORD_PROPERTY, "http.basic.password");
- metadataMap.put(BindingProvider.USERNAME_PROPERTY, "http.basic.username");
- metadataMap.put(BindingProvider.PASSWORD_PROPERTY, "http.basic.password");
- }
- private static Map<String, String> configMap = new HashMap<String, String>();
- static
- {
- configMap.put(StubExt.PROPERTY_KEY_ALIAS, "org.jboss.remoting.keyAlias");
- configMap.put(StubExt.PROPERTY_KEY_STORE, "org.jboss.remoting.keyStore");
- configMap.put(StubExt.PROPERTY_KEY_STORE_ALGORITHM, "org.jboss.remoting.keyStoreAlgorithm");
- configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD, "org.jboss.remoting.keyStorePassword");
- configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE, "org.jboss.remoting.keyStoreType");
- configMap.put(StubExt.PROPERTY_SOCKET_FACTORY, "socketFactoryClassName");
- configMap.put(StubExt.PROPERTY_SSL_PROTOCOL, "org.jboss.remoting.sslProtocol");
- configMap.put(StubExt.PROPERTY_SSL_PROVIDER_NAME, "org.jboss.remoting.sslProviderName");
- configMap.put(StubExt.PROPERTY_TRUST_STORE, "org.jboss.remoting.trustStore");
- configMap.put(StubExt.PROPERTY_TRUST_STORE_ALGORITHM, "org.jboss.remoting.truststoreAlgorithm");
- configMap.put(StubExt.PROPERTY_TRUST_STORE_PASSWORD, "org.jboss.remoting.trustStorePassword");
- configMap.put(StubExt.PROPERTY_TRUST_STORE_TYPE, "org.jboss.remoting.trustStoreType");
- }
+ // private static Map<String, String> metadataMap = new HashMap<String, String>();
+ // static
+ // {
+ // metadataMap.put(Stub.USERNAME_PROPERTY, "http.basic.username");
+ // metadataMap.put(Stub.PASSWORD_PROPERTY, "http.basic.password");
+ // metadataMap.put(BindingProvider.USERNAME_PROPERTY, "http.basic.username");
+ // metadataMap.put(BindingProvider.PASSWORD_PROPERTY, "http.basic.password");
+ // }
+ // private static Map<String, String> configMap = new HashMap<String, String>();
+ // static
+ // {
+ // configMap.put(StubExt.PROPERTY_KEY_ALIAS, "org.jboss.remoting.keyAlias");
+ // configMap.put(StubExt.PROPERTY_KEY_STORE, "org.jboss.remoting.keyStore");
+ // configMap.put(StubExt.PROPERTY_KEY_STORE_ALGORITHM, "org.jboss.remoting.keyStoreAlgorithm");
+ // configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD, "org.jboss.remoting.keyStorePassword");
+ // configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE, "org.jboss.remoting.keyStoreType");
+ // configMap.put(StubExt.PROPERTY_SOCKET_FACTORY, "socketFactoryClassName");
+ // configMap.put(StubExt.PROPERTY_SSL_PROTOCOL, "org.jboss.remoting.sslProtocol");
+ // configMap.put(StubExt.PROPERTY_SSL_PROVIDER_NAME, "org.jboss.remoting.sslProviderName");
+ // configMap.put(StubExt.PROPERTY_TRUST_STORE, "org.jboss.remoting.trustStore");
+ // configMap.put(StubExt.PROPERTY_TRUST_STORE_ALGORITHM, "org.jboss.remoting.truststoreAlgorithm");
+ // configMap.put(StubExt.PROPERTY_TRUST_STORE_PASSWORD, "org.jboss.remoting.trustStorePassword");
+ // configMap.put(StubExt.PROPERTY_TRUST_STORE_TYPE, "org.jboss.remoting.trustStoreType");
+ // }
private boolean closed;
private Integer chunkedLength;
@@ -111,10 +121,10 @@
public HTTPRemotingConnection()
{
- // HTTPClientInvoker connect sends gratuitous POST
- // http://jira.jboss.com/jira/browse/JBWS-711
- clientConfig.put(Client.ENABLE_LEASE, false);
- clientConfig.put(HTTPClientInvoker.UNMARSHAL_NULL_STREAM, "true");
+ // // HTTPClientInvoker connect sends gratuitous POST
+ // // http://jira.jboss.com/jira/browse/JBWS-711
+ // clientConfig.put(Client.ENABLE_LEASE, false);
+ // clientConfig.put(HTTPClientInvoker.UNMARSHAL_NULL_STREAM, "true");
}
public boolean isClosed()
@@ -137,20 +147,26 @@
this.chunkedLength = chunkedLength;
}
+ public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ {
+ return this.invoke(reqMessage, endpoint, oneway, true);
+ }
+
/**
* Sends the given message to the specified endpoint.
*
* A null reqMessage signifies a HTTP GET request.
*/
- public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway, boolean maintainSession) throws IOException
{
+// System.out.println("Entro...");
if (endpoint == null)
throw new IllegalArgumentException("Given endpoint cannot be null");
if (closed)
throw new IOException("Connection is already closed");
- Object timeout = null;
+ Long timeout = null;
String targetAddress;
Map<String, Object> callProps = new HashMap<String, Object>();
@@ -162,8 +178,7 @@
if (callProps.containsKey(StubExt.PROPERTY_CLIENT_TIMEOUT))
{
- timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
- targetAddress = addURLParameter(targetAddress, "timeout", timeout.toString());
+ timeout = new Long(callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT).toString());
}
}
@@ -177,254 +192,400 @@
targetAddress = endpoint.toString();
}
- // setup remoting client
- Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
- Marshaller marshaller = getMarshaller();
+ //Netty client
+ // Map<String, Object> metadata = getMetadata(reqMessage, callProps);
UnMarshaller unmarshaller = getUnmarshaller();
- InvokerLocator locator = null;
- try
- {
- // Get the invoker from Remoting for a given endpoint address
- log.debug("Get locator for: " + endpoint);
- /**
- * [JBWS-1704] The Use Of Remoting Causes An Additional 'datatype' Parameter To Be Sent On All Requests
- *
- * An HTTPClientInvoker may disconnect from the server and recreated by the remoting layer.
- * In that case the new invoker does not inherit the marshaller/unmarshaller from the disconnected invoker.
- * We therefore explicitly specify the invoker locator datatype and register the SOAP marshaller/unmarshaller
- * with the MarshalFactory.
- *
- * This applies to remoting-1.4.5 and less
- */
- String version = getRemotingVersion();
- if (version.startsWith("1.4"))
- {
- targetAddress = addURLParameter(targetAddress, InvokerLocator.DATATYPE, "JBossWSMessage");
- MarshalFactory.addMarshaller("JBossWSMessage", marshaller, unmarshaller);
- }
+ ChannelFactory factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
+ // ChannelFactory factory = new NioClientSocketChannelFactory(clientExecutor, clientExecutor);
- locator = new InvokerLocator(targetAddress);
- }
- catch (MalformedURLException e)
+ ClientBootstrap bootstrap = new ClientBootstrap(factory);
+ WSClientPipelineFactory channelPipelineFactory = new WSClientPipelineFactory();
+ WSResponseHandler responseHandler = null;
+ if (!oneway || maintainSession)
{
- throw new IllegalArgumentException("Malformed endpoint address", e);
+ responseHandler = new WSResponseHandler(unmarshaller);
+ channelPipelineFactory.setResponseHandler(responseHandler);
}
+ bootstrap.setPipelineFactory(channelPipelineFactory);
- try
+ if (RMTransportHelper.isRMMessage(callProps))
{
- if (RMTransportHelper.isRMMessage(callProps))
+ // try
+ // {
+ // RMMetadata rmMetadata = new RMMetadata(null, targetAddress, marshaller, unmarshaller, callProps, metadata, null); //TODO!! remoting version, client config, etc.
+ // return RM_CHANNEL.send(reqMessage, rmMetadata);
+ // }
+ // catch (Throwable t)
+ // {
+ // IOException io = new IOException();
+ // io.initCause(t);
+ // throw io;
+ // }
+ return null; //TODO!!!
+ }
+ else
+ {
+ Channel channel = null;
+ try
{
- RMMetadata rmMetadata = new RMMetadata(getRemotingVersion(), targetAddress, marshaller, unmarshaller, callProps, metadata, clientConfig);
- return RM_CHANNEL.send(reqMessage, rmMetadata);
- }
- else
- {
- Client client = new Client(locator, "jbossws", clientConfig);
- client.connect();
+// System.out.println(new Date() + " Inizio connection attempt...");
+ //Start the connection attempt
+ URI target;
+ try
+ {
+ System.out.println("targetAddress: "+targetAddress);
+ target = new URI(targetAddress);
+ System.out.println("target.getHost: "+target.getHost());
+ System.out.println("target.getPort: "+target.getPort());
+ }
+ catch (URISyntaxException e)
+ {
+ throw new RuntimeException("Invalid address: " + targetAddress, e);
+ }
+ ChannelFuture future = bootstrap.connect(new InetSocketAddress(target.getHost(), target.getPort()));
- client.setMarshaller(marshaller);
+ //Wait until the connection attempt succeeds or fails
+ awaitUninterruptibly(future, timeout);
+ if (!future.isSuccess())
+ {
+ IOException io = new IOException("Could not connect to " + target.getHost());
+ io.initCause(future.getCause());
+ factory.releaseExternalResources();
+ throw io;
+ }
+ channel = future.getChannel();
- client.setUnMarshaller(unmarshaller);
+ //Trace the outgoing message
+ MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
- if (log.isDebugEnabled())
- log.debug("Remoting metadata: " + metadata);
+ //Send the HTTP request
+ HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, reqMessage != null ? HttpMethod.POST : HttpMethod.GET, target.toASCIIString());
+ request.addHeader(HttpHeaders.Names.HOST, target.getHost());
+ request.addHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
+ Map<String, Object> additionalHeaders = new HashMap<String, Object>();
+ populateHeaders(reqMessage, additionalHeaders);
+ setAdditionalHeaders(request, additionalHeaders);
+ setActualChunkedLength(request);
+ setAuthorization(request, callProps);
- // debug the outgoing message
- MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
+ writeRequest(channel, request, reqMessage);
+// System.out.println("oneway=" + oneway + " maintainSession=" + maintainSession);
+ if (oneway && !maintainSession)
+ {
+ //No need to wait for the connection to be closed
+ return null;
+ }
+ //Wait for the server to close the connection
+ ChannelFuture closeFuture = channel.getCloseFuture();
+ awaitUninterruptibly(closeFuture, timeout);
+ if (responseHandler.getError() != null)
+ {
+ throw responseHandler.getError();
+ }
MessageAbstraction resMessage = null;
-
- if (oneway == true)
+ Map<String, Object> resHeaders = null;
+ if (!oneway)
{
- client.invokeOneway(reqMessage, metadata, false);
+ //Get the response
+ resMessage = responseHandler.getResponseMessage();
+ resHeaders = responseHandler.getResponseHeaders();
}
- else
+ //Update props with response headers (required to maintain session using cookies)
+ callProps.clear();
+ if (resHeaders != null)
{
- resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
+ callProps.putAll(resHeaders);
}
- // Disconnect the remoting client
- client.disconnect();
-
- callProps.clear();
- callProps.putAll(metadata);
-
- // trace the incomming response message
+ //Trace the incoming response message
MessageTrace.traceMessage("Incoming Response Message", resMessage);
-
+// System.out.println(new Date() + " Fatto.");
return resMessage;
}
+ catch (IOException ioe)
+ {
+ ioe.printStackTrace();
+ throw ioe;
+ }
+ catch (WSTimeoutException toe)
+ {
+ throw toe;
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ IOException io = new IOException("Could not transmit message");
+ io.initCause(t);
+ throw io;
+ }
+ finally
+ {
+// System.out.println("Mi preparo a rilasciare...");
+ if (channel != null)
+ {
+ channel.close();
+ }
+ //Shut down executor threads to exit
+ factory.releaseExternalResources();
+// System.out.println("Rilasciato");
+ }
}
- catch (Throwable th)
+ }
+
+ private void writeRequest(Channel channel, HttpRequest request, MessageAbstraction reqMessage) throws IOException
+ {
+ if (reqMessage == null)
{
- if (timeout != null && (th.getCause() instanceof SocketTimeoutException))
+ channel.write(request);
+ }
+ else
+ {
+ ChannelBuffer content = ChannelBuffers.dynamicBuffer();
+ OutputStream os = new ChannelBufferOutputStream(content);
+ getMarshaller().write(reqMessage, os);
+ if (request.isChunked())
{
- throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
+ //TODO!! handle chunks here...
+ channel.write(request);
+
+ HttpChunk chunk = new DefaultHttpChunk(content);
+ channel.write(chunk);
+
+ channel.write(HttpChunk.LAST_CHUNK);
}
-
- IOException io = new IOException("Could not transmit message");
- io.initCause(th);
- throw io;
+ else
+ {
+ request.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.writerIndex()));
+ request.setContent(content);
+ channel.write(request);
+ }
}
}
- private String addURLParameter(String urlStr, String key, String value) throws MalformedURLException
+ /**
+ * Utility method for awaiting with or without timeout (timeout == null or <=0 implies not timeout)
+ *
+ * @param future
+ * @param timeout
+ * @throws WSTimeoutException
+ */
+ private static void awaitUninterruptibly(ChannelFuture future, Long timeout) throws WSTimeoutException
{
- URL url = new URL(urlStr);
- urlStr += (url.getQuery() == null ? "?" : "&") + key + "=" + value;
- return urlStr;
- }
-
- private String getRemotingVersion()
- {
- String version = null;
- try
+// System.out.println(new Date() + " Inizio attesa...");
+ if (timeout != null && timeout.longValue() > 0)
{
- // Access the constant dynamically, otherwise it will be the compile time value
- Field field = Version.class.getDeclaredField("VERSION");
- version = (String)field.get(null);
+ boolean bool = future.awaitUninterruptibly(timeout);
+ if (!bool)
+ {
+ throw new WSTimeoutException("Timeout after: " + timeout + "ms", timeout);
+ }
}
- catch (Exception ex)
+ else
{
- throw new RuntimeException("Cannot obtain remoting version", ex);
+ future.awaitUninterruptibly();
}
-
- if (version == null)
- {
- URL codeURL = Version.class.getProtectionDomain().getCodeSource().getLocation();
- throw new RuntimeException("Cannot obtain remoting version from: " + codeURL);
- }
- return version;
+// System.out.println(new Date() + " Fine attesa.");
}
- private Map<String, Object> createRemotingMetaData(MessageAbstraction reqMessage, Map callProps)
+ protected void setActualChunkedLength(HttpRequest message)
{
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-
- Map<String, Object> metadata = new HashMap<String, Object>();
-
- // We need to unmarshall faults (HTTP 500)
- // metadata.put(HTTPMetadataConstants.NO_THROW_ON_ERROR, "true"); // since 2.0.0.GA
- metadata.put("NoThrowOnError", "true");
-
- if (reqMessage != null)
+ if (HttpMethod.POST.equals(message.getMethod()))
{
- populateHeaders(reqMessage, metadata);
-
- // Enable chunked encoding. This is the default size.
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ //We always use chunked transfer encoding
int chunkSizeValue = (chunkedLength != null ? chunkedLength : 1024);
-
// Overwrite, through endpoint config
if (msgContext != null)
{
EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
CommonConfig config = epMetaData.getConfig();
-
+
String sizeValue = config.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
if (sizeValue != null)
chunkSizeValue = Integer.valueOf(sizeValue);
-
if (epMetaData.isFeatureEnabled(FastInfosetFeature.class))
chunkSizeValue = 0;
}
-
if (chunkSizeValue > 0)
{
- clientConfig.put("chunkedLength", String.valueOf(chunkSizeValue));
+ message.addHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
}
- else
- {
- clientConfig.remove("chunkedLength");
- }
}
- else
+ }
+
+ protected void setAuthorization(HttpMessage message, Map callProps) throws IOException
+ {
+ //Get authentication type, default to BASIC authetication
+ String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
+ if (authType == null)
+ authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
+ String username = (String)callProps.get(Stub.USERNAME_PROPERTY);
+ String password = (String)callProps.get(Stub.PASSWORD_PROPERTY);
+ if (username == null || password == null)
{
- metadata.put("TYPE", "GET");
+ username = (String)callProps.get(BindingProvider.USERNAME_PROPERTY);
+ password = (String)callProps.get(BindingProvider.PASSWORD_PROPERTY);
}
-
- if (callProps != null)
+ if (username != null && password != null)
{
- Iterator it = callProps.entrySet().iterator();
+ if (authType.equals(StubExt.PROPERTY_AUTH_TYPE_BASIC))
+ {
+ message.addHeader(HttpHeaders.Names.AUTHORIZATION, getBasicAuthHeader(username, password));
+ }
+ }
+ }
- // Get authentication type, default to BASIC authetication
- String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
- if (authType == null)
- authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
+ private static String getBasicAuthHeader(String username, String password) throws IOException
+ {
+ return "Basic " + Base64Encoder.encode(username + ":" + password);
+ }
- while (it.hasNext())
+ protected void setAdditionalHeaders(HttpMessage message, Map<String, Object> headers)
+ {
+ for (String key : headers.keySet())
+ {
+ try
{
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Object val = entry.getValue();
-
- // pass properties to remoting meta data
- if (metadataMap.containsKey(key))
- {
- String remotingKey = metadataMap.get(key);
- if ("http.basic.username".equals(remotingKey) || "http.basic.password".equals(remotingKey))
- {
- if (authType.equals(StubExt.PROPERTY_AUTH_TYPE_BASIC))
- {
- metadata.put(remotingKey, val);
- }
- else
- {
- log.warn("Ignore '" + key + "' with auth typy: " + authType);
- }
- }
- else
- {
- metadata.put(remotingKey, val);
- }
- }
-
- // pass properties to remoting client config
- if (configMap.containsKey(key))
- {
- String remotingKey = configMap.get(key);
- clientConfig.put(remotingKey, val);
- }
+ String header = (String)headers.get(key);
+ message.addHeader(key, header.replaceAll("[\r\n\f]", " "));
}
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
}
-
- return metadata;
}
+ // private Map<String, Object> createRemotingMetaData(MessageAbstraction reqMessage, Map callProps)
+ // {
+ // CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ //
+ // Map<String, Object> metadata = new HashMap<String, Object>();
+ //
+ // // We need to unmarshall faults (HTTP 500)
+ // // metadata.put(HTTPMetadataConstants.NO_THROW_ON_ERROR, "true"); // since 2.0.0.GA
+ // metadata.put("NoThrowOnError", "true");
+ //
+ // if (reqMessage != null)
+ // {
+ // populateHeaders(reqMessage, metadata);
+ //
+ // // Enable chunked encoding. This is the default size.
+ // int chunkSizeValue = (chunkedLength != null ? chunkedLength : 1024);
+ //
+ // // Overwrite, through endpoint config
+ // if (msgContext != null)
+ // {
+ // EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ // CommonConfig config = epMetaData.getConfig();
+ //
+ // String sizeValue = config.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
+ // if (sizeValue != null)
+ // chunkSizeValue = Integer.valueOf(sizeValue);
+ //
+ // if (epMetaData.isFeatureEnabled(FastInfosetFeature.class))
+ // chunkSizeValue = 0;
+ // }
+ //
+ // if (chunkSizeValue > 0)
+ // {
+ // clientConfig.put("chunkedLength", String.valueOf(chunkSizeValue));
+ // }
+ // else
+ // {
+ // clientConfig.remove("chunkedLength");
+ // }
+ // }
+ // else
+ // {
+ // metadata.put("TYPE", "GET");
+ // }
+ //
+ // if (callProps != null)
+ // {
+ // Iterator it = callProps.entrySet().iterator();
+ //
+ // // Get authentication type, default to BASIC authetication
+ // String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
+ // if (authType == null)
+ // authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
+ //
+ // while (it.hasNext())
+ // {
+ // Map.Entry entry = (Map.Entry)it.next();
+ // String key = (String)entry.getKey();
+ // Object val = entry.getValue();
+ //
+ // // pass properties to remoting meta data
+ // if (metadataMap.containsKey(key))
+ // {
+ // String remotingKey = metadataMap.get(key);
+ // if ("http.basic.username".equals(remotingKey) || "http.basic.password".equals(remotingKey))
+ // {
+ // if (authType.equals(StubExt.PROPERTY_AUTH_TYPE_BASIC))
+ // {
+ // metadata.put(remotingKey, val);
+ // }
+ // else
+ // {
+ // log.warn("Ignore '" + key + "' with auth typy: " + authType);
+ // }
+ // }
+ // else
+ // {
+ // metadata.put(remotingKey, val);
+ // }
+ // }
+ //
+ // // pass properties to remoting client config
+ // if (configMap.containsKey(key))
+ // {
+ // String remotingKey = configMap.get(key);
+ // clientConfig.put(remotingKey, val);
+ // }
+ // }
+ // }
+ //
+ // return metadata;
+ // }
+
protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
{
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
-
- Properties props = new Properties();
- metadata.put("HEADER", props);
-
- Iterator i = mimeHeaders.getAllHeaders();
- while (i.hasNext())
+ if (reqMessage != null)
{
- MimeHeader header = (MimeHeader)i.next();
- String currentValue = props.getProperty(header.getName());
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- /*
- * Coalesce multiple headers into one
- *
- * From HTTP/1.1 RFC 2616:
- *
- * Multiple message-header fields with the same field-name MAY be
- * present in a message if and only if the entire field-value for that
- * header field is defined as a comma-separated list [i.e., #(values)].
- * It MUST be possible to combine the multiple header fields into one
- * "field-name: field-value" pair, without changing the semantics of
- * the message, by appending each subsequent field-value to the first,
- * each separated by a comma.
- */
- if (currentValue != null)
+ Iterator i = mimeHeaders.getAllHeaders();
+ while (i.hasNext())
{
- props.put(header.getName(), currentValue + "," + header.getValue());
+ MimeHeader header = (MimeHeader)i.next();
+ Object currentValue = metadata.get(header.getName());
+
+ /*
+ * Coalesce multiple headers into one
+ *
+ * From HTTP/1.1 RFC 2616:
+ *
+ * Multiple message-header fields with the same field-name MAY be
+ * present in a message if and only if the entire field-value for that
+ * header field is defined as a comma-separated list [i.e., #(values)].
+ * It MUST be possible to combine the multiple header fields into one
+ * "field-name: field-value" pair, without changing the semantics of
+ * the message, by appending each subsequent field-value to the first,
+ * each separated by a comma.
+ */
+ if (currentValue != null)
+ {
+ metadata.put(header.getName(), currentValue + "," + header.getValue());
+ }
+ else
+ {
+ metadata.put(header.getName(), header.getValue());
+ }
}
- else
- {
- props.put(header.getName(), header.getValue());
- }
}
}
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/JsonConnectionHTTP.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/JsonConnectionHTTP.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/JsonConnectionHTTP.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -26,8 +26,6 @@
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPConstants;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.jaxws.binding.JsonMessageMarshaller;
import org.jboss.ws.core.jaxws.binding.JsonMessageUnMarshaller;
@@ -55,9 +53,11 @@
protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
{
// TODO: fix the content-type
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- mimeHeaders.setHeader(MimeConstants.CONTENT_TYPE, SOAPConstants.SOAP_1_1_CONTENT_TYPE);
-
+ if (reqMessage != null)
+ {
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
+ mimeHeaders.setHeader(MimeConstants.CONTENT_TYPE, SOAPConstants.SOAP_1_1_CONTENT_TYPE);
+ }
super.populateHeaders(reqMessage, metadata);
}
}
Added: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/Marshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/Marshaller.java (rev 0)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/Marshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.core.client;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Interface that all data marshallers must implements.
+ * Requires them to take Java data objects and convert
+ * primitive java data types (i.e. byte[]) and write
+ * to output provided.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 24-Jun-2009
+ *
+ */
+public interface Marshaller
+{
+ /**
+ * Marshaller will need to take the dataObject and convert
+ * into primitive java data types and write to the
+ * given output.
+ *
+ * @param dataObject Object to be writen to output
+ * @param output The data output to write the object
+ * data to.
+ */
+ public void write(Object dataObject, OutputStream output) throws IOException;
+}
Property changes on: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/Marshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -23,8 +23,6 @@
import java.io.IOException;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.ws.core.MessageAbstraction;
@@ -39,6 +37,8 @@
Marshaller getMarshaller();
UnMarshaller getUnmarshaller();
+
+ MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException;
- MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException;
+ MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway, boolean maintainSession) throws IOException;
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -23,14 +23,11 @@
import java.io.IOException;
import java.util.Map;
-import java.util.Properties;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.soap.SOAPMessageMarshaller;
import org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP;
@@ -55,7 +52,8 @@
return new SOAPMessageMarshaller();
}
- public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ @Override
+ public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway, boolean maintainSession) throws IOException
{
try
{
@@ -68,7 +66,7 @@
if (reqMessage != null && soapMessage.saveRequired())
soapMessage.saveChanges();
- return super.invoke(reqMessage, endpoint, oneway);
+ return super.invoke(reqMessage, endpoint, oneway, maintainSession);
}
catch (SOAPException ex)
{
@@ -82,33 +80,33 @@
{
super.populateHeaders(reqMessage, metadata);
- Properties props = (Properties)metadata.get("HEADER");
+ if (reqMessage != null)
+ {
+ // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
+ // with a quoted value equal to the value of the soapAction attribute of
+ // soapbind:operation, if present in the corresponding WSDL description.
- // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted value equal to the value of the soapAction attribute of
- // soapbind:operation, if present in the corresponding WSDL description.
+ // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
+ // with a quoted empty string value, if in the corresponding WSDL description,
+ // the soapAction attribute of soapbind:operation is either not present, or
+ // present with an empty string as its value.
- // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted empty string value, if in the corresponding WSDL description,
- // the soapAction attribute of soapbind:operation is either not present, or
- // present with an empty string as its value.
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
+ String[] action = mimeHeaders.getHeader("SOAPAction");
+ if (action != null && action.length > 0)
+ {
+ String soapAction = action[0];
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- String[] action = mimeHeaders.getHeader("SOAPAction");
- if (action != null && action.length > 0)
- {
- String soapAction = action[0];
+ // R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE MUST be a quoted string.
+ if (soapAction.startsWith("\"") == false || soapAction.endsWith("\"") == false)
+ soapAction = "\"" + soapAction + "\"";
- // R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE MUST be a quoted string.
- if (soapAction.startsWith("\"") == false || soapAction.endsWith("\"") == false)
- soapAction = "\"" + soapAction + "\"";
-
- props.put("SOAPAction", soapAction);
+ metadata.put("SOAPAction", soapAction);
+ }
+ else
+ {
+ metadata.put("SOAPAction", "\"\"");
+ }
}
- else
- {
- props.put("SOAPAction", "\"\"");
- }
-
}
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -41,8 +41,6 @@
import javax.naming.InitialContext;
import javax.xml.ws.addressing.EndpointReference;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.soap.SOAPMessageMarshaller;
import org.jboss.ws.core.soap.SOAPMessageUnMarshaller;
@@ -66,9 +64,14 @@
{
return new SOAPMessageMarshaller();
}
-
+
public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
{
+ return this.invoke(reqMessage, endpoint, oneway, true);
+ }
+
+ public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway, boolean maintainSession) throws IOException
+ {
if (endpoint == null)
throw new IllegalArgumentException("Given endpoint cannot be null");
Added: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/UnMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/UnMarshaller.java (rev 0)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/UnMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.core.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+/**
+ * Takes a marshalled byte array and converts to a Java data object.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 24-Jun-2009
+ *
+ */
+public interface UnMarshaller
+{
+ /**
+ * Will read from the inputstream and convert contents to java Object.
+ *
+ * @param inputStream stream to read data from to do conversion.
+ * @param metadata can be any transport specific metadata (such as headers from http transport).
+ * This can be null, depending on if transport supports metadata.
+ *
+ * @return
+ * @throws IOException all specific i/o exceptions need to be thrown as this.
+ */
+ Object read(InputStream inputStream, Map<String, Object> metadata) throws IOException;
+}
Property changes on: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/UnMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSClientPipelineFactory.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSClientPipelineFactory.java (rev 0)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSClientPipelineFactory.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.core.client;
+
+import static org.jboss.netty.channel.Channels.pipeline;
+
+import org.jboss.netty.channel.ChannelHandler;
+import org.jboss.netty.channel.ChannelPipeline;
+import org.jboss.netty.channel.ChannelPipelineFactory;
+import org.jboss.netty.handler.codec.http.HttpChunkAggregator;
+import org.jboss.netty.handler.codec.http.HttpRequestEncoder;
+import org.jboss.netty.handler.codec.http.HttpResponseDecoder;
+
+/**
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 24-Jun-2009
+ *
+ */
+public class WSClientPipelineFactory implements ChannelPipelineFactory
+{
+ private static final int MAX_CONTENT_SIZE = 1073741824;
+ private ChannelHandler responseHandler;
+ private ChannelHandler sshHandler;
+
+ public ChannelPipeline getPipeline() throws Exception
+ {
+ // Create a default pipeline implementation.
+ ChannelPipeline pipeline = pipeline();
+ pipeline.addLast("decoder", new HttpResponseDecoder());
+ // Uncomment the following line if you don't want to handle HttpChunks.
+ pipeline.addLast("aggregator", new HttpChunkAggregator(MAX_CONTENT_SIZE));
+ pipeline.addLast("encoder", new HttpRequestEncoder());
+ if (responseHandler != null)
+ {
+ pipeline.addLast("handler", responseHandler);
+ }
+ return pipeline;
+ }
+
+ public ChannelHandler getResponseHandler()
+ {
+ return responseHandler;
+ }
+
+ public void setResponseHandler(ChannelHandler responseHandler)
+ {
+ this.responseHandler = responseHandler;
+ }
+
+ public ChannelHandler getSshHandler()
+ {
+ return sshHandler;
+ }
+
+ public void setSshHandler(ChannelHandler sshHandler)
+ {
+ this.sshHandler = sshHandler;
+ }
+
+
+}
Property changes on: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSClientPipelineFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java (rev 0)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.core.client;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBufferInputStream;
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.ChannelPipelineCoverage;
+import org.jboss.netty.channel.MessageEvent;
+import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
+import org.jboss.netty.handler.codec.http.HttpResponse;
+import org.jboss.ws.core.MessageAbstraction;
+
+/**
+ * A Netty channel upstream handler that receives MessageEvent
+ * and extract the JBossWS message using the provided unmarshaller.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 24-Jun-2009
+ *
+ */
+ at ChannelPipelineCoverage("one")
+public class WSResponseHandler extends SimpleChannelUpstreamHandler
+{
+ private UnMarshaller unmarshaller;
+ private MessageAbstraction responseMessage;
+ private Map<String, Object> responseHeaders;
+ private Throwable error;
+
+ public WSResponseHandler(UnMarshaller unmarshaller)
+ {
+ super();
+ this.unmarshaller = unmarshaller;
+ }
+
+ @Override
+ public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception
+ {
+ try
+ {
+// System.out.println(new Date() + " Message received");
+ reset();
+ HttpResponse response = (HttpResponse)e.getMessage();
+
+ //TODO!! fix constants
+ responseHeaders.put("ResponseCode", response.getStatus().getCode());
+ responseHeaders.put("ResponseCodeMessage", response.getStatus().getReasonPhrase());
+ for (String headerName : response.getHeaderNames())
+ {
+ responseHeaders.put(headerName, response.getHeaders(headerName));
+ }
+
+ ChannelBuffer content = response.getContent();
+// System.out.println(new Date() + " Unmarshall...");
+ this.responseMessage = (MessageAbstraction)unmarshaller.read(content.readable() ? new ChannelBufferInputStream(content) : null, responseHeaders);
+// System.out.println(new Date() + " Esco da message received...");
+ }
+ catch (Throwable t)
+ {
+ this.error = t;
+ }
+ finally
+ {
+ e.getChannel().close();
+ }
+ }
+
+ private void reset()
+ {
+ this.error = null;
+ this.responseMessage = null;
+ this.responseHeaders = new HashMap<String, Object>();
+ }
+
+ public MessageAbstraction getResponseMessage()
+ {
+ return this.responseMessage;
+ }
+
+ public Map<String, Object> getResponseHeaders()
+ {
+ return responseHeaders;
+ }
+
+ public Throwable getError()
+ {
+ return error;
+ }
+}
\ No newline at end of file
Property changes on: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageMarshaller.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -25,15 +25,14 @@
import java.io.OutputStream;
import org.jboss.logging.Logger;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.invocation.OnewayInvocation;
-import org.jboss.remoting.marshal.Marshaller;
import org.jboss.ws.core.HTTPMessageImpl;
+import org.jboss.ws.core.client.Marshaller;
import org.jboss.wsf.common.DOMWriter;
import org.w3c.dom.Element;
/**
* @author Thomas.Diesler at jboss.org
+ * @author alessio.soldano at jboss.com
* @since 25-Nov-2004
*/
public class HTTPMessageMarshaller implements Marshaller
@@ -52,12 +51,6 @@
*/
public void write(Object dataObject, OutputStream output) throws IOException
{
- if (dataObject instanceof InvocationRequest)
- dataObject = ((InvocationRequest)dataObject).getParameter();
-
- if (dataObject instanceof OnewayInvocation)
- dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
-
if ((dataObject instanceof HTTPMessageImpl) == false)
throw new IllegalArgumentException("Not a HTTPMessage: " + dataObject);
@@ -72,9 +65,4 @@
new DOMWriter(output).print(root);
}
-
- public Marshaller cloneMarshaller() throws CloneNotSupportedException
- {
- return new HTTPMessageMarshaller();
- }
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageUnMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageUnMarshaller.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPMessageUnMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -32,10 +31,9 @@
import javax.xml.soap.MimeHeaders;
import org.jboss.logging.Logger;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.HTTPMessageImpl;
+import org.jboss.ws.core.client.UnMarshaller;
/**
* @author Thomas.Diesler at jboss.org
@@ -46,7 +44,7 @@
// Provide logging
private static Logger log = Logger.getLogger(HTTPMessageUnMarshaller.class);
- private static List validResponseCodes = new ArrayList();
+ private static List<Integer> validResponseCodes = new ArrayList<Integer>();
static
{
validResponseCodes.add(HttpServletResponse.SC_OK);
@@ -54,15 +52,16 @@
validResponseCodes.add(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
- public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
+ public Object read(InputStream inputStream, Map<String, Object> metadata) throws IOException
{
if (log.isTraceEnabled())
{
log.trace("Read input stream with metadata=" + metadata);
}
- Integer resCode = (Integer)metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
- String resMessage = (String)metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
+ //TODO!!! fix constants
+ Integer resCode = (Integer)metadata.get("ResponseCode");
+ String resMessage = (String)metadata.get("ResponseCodeMessage");
if (resCode != null && validResponseCodes.contains(resCode) == false)
throw new WSException("Invalid HTTP server response [" + resCode + "] - " + resMessage);
@@ -71,37 +70,17 @@
return soapMsg;
}
- /**
- * Set the class loader to use for unmarhsalling. This may
- * be needed when need to have access to class definitions that
- * are not part of this unmarshaller's parent classloader (especially
- * when doing remote classloading).
- *
- * @param classloader
- */
- public void setClassLoader(ClassLoader classloader)
+ private MimeHeaders getMimeHeaders(Map<String, Object> metadata)
{
- //NO OP
- }
-
- public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
- {
- return new HTTPMessageUnMarshaller();
- }
-
- private MimeHeaders getMimeHeaders(Map metadata)
- {
log.debug("getMimeHeaders from: " + metadata);
MimeHeaders headers = new MimeHeaders();
- Iterator i = metadata.keySet().iterator();
- while (i.hasNext())
+ for (String key : metadata.keySet())
{
- String key = (String)i.next();
Object value = metadata.get(key);
if (key != null && value instanceof List)
{
- for (Object listValue : (List)value)
+ for (Object listValue : (List<?>)value)
{
headers.addHeader(key, listValue.toString());
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageMarshaller.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -28,23 +28,18 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.logging.Logger;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.invocation.OnewayInvocation;
-import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.ws.core.client.Marshaller;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.extensions.json.BadgerFishDOMDocumentSerializer;
/**
* @author Thomas.Diesler at jboss.org
+ * @author alessio.soldano at jboss.com
* @since 25-Nov-2004
*/
public class JsonMessageMarshaller implements Marshaller
{
- // Provide logging
- private static Logger log = Logger.getLogger(JsonMessageMarshaller.class);
-
/**
* Marshaller will need to take the dataObject and convert
* into primitive java data types and write to the
@@ -56,12 +51,6 @@
*/
public void write(Object dataObject, OutputStream output) throws IOException
{
- if (dataObject instanceof InvocationRequest)
- dataObject = ((InvocationRequest)dataObject).getParameter();
-
- if (dataObject instanceof OnewayInvocation)
- dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
-
// TODO: this should not be a SOAP message
if ((dataObject instanceof SOAPMessageImpl) == false)
throw new IllegalArgumentException("Not a SOAPMessageImpl: " + dataObject);
@@ -80,9 +69,4 @@
throw ioex;
}
}
-
- public Marshaller cloneMarshaller() throws CloneNotSupportedException
- {
- return new JsonMessageMarshaller();
- }
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageUnMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageUnMarshaller.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/JsonMessageUnMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -23,16 +23,13 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
-import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.client.UnMarshaller;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.extensions.json.BadgerFishDOMDocumentParser;
import org.w3c.dom.Document;
@@ -46,7 +43,7 @@
// Provide logging
private static Logger log = Logger.getLogger(JsonMessageUnMarshaller.class);
- public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
+ public Object read(InputStream inputStream, Map<String, Object> metadata) throws IOException
{
if (log.isTraceEnabled())
{
@@ -69,43 +66,4 @@
throw ioex;
}
}
-
- /**
- * Set the class loader to use for unmarhsalling. This may
- * be needed when need to have access to class definitions that
- * are not part of this unmarshaller's parent classloader (especially
- * when doing remote classloading).
- *
- * @param classloader
- */
- public void setClassLoader(ClassLoader classloader)
- {
- //NO OP
- }
-
- public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
- {
- return new JsonMessageUnMarshaller();
- }
-
- private MimeHeaders getMimeHeaders(Map metadata)
- {
- log.debug("getMimeHeaders from: " + metadata);
-
- MimeHeaders headers = new MimeHeaders();
- Iterator i = metadata.keySet().iterator();
- while (i.hasNext())
- {
- String key = (String)i.next();
- Object value = metadata.get(key);
- if (key != null && value instanceof List)
- {
- for (Object listValue : (List)value)
- {
- headers.addHeader(key, listValue.toString());
- }
- }
- }
- return headers;
- }
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -89,6 +89,7 @@
{
return null;
}
+ log.error("Exception while building envelope", ex);
QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
throw new CommonSOAPFaultException(faultCode, ex.getMessage());
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -28,14 +28,13 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.invocation.OnewayInvocation;
-import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.ws.core.client.Marshaller;
import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
/**
* @author Thomas.Diesler at jboss.org
+ * @author alessio.soldano at jboss.com
* @since 12-Mar-2008
*/
public class FastInfosetMarshaller implements Marshaller
@@ -51,12 +50,6 @@
*/
public void write(Object dataObject, OutputStream output) throws IOException
{
- if (dataObject instanceof InvocationRequest)
- dataObject = ((InvocationRequest)dataObject).getParameter();
-
- if (dataObject instanceof OnewayInvocation)
- dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
-
if ((dataObject instanceof SOAPMessage) == false)
throw new IllegalArgumentException("Not a SOAPMessage: " + dataObject);
@@ -78,9 +71,4 @@
throw ioex;
}
}
-
- public Marshaller cloneMarshaller() throws CloneNotSupportedException
- {
- return new FastInfosetMarshaller();
- }
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -27,12 +27,11 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.invocation.OnewayInvocation;
-import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.ws.core.client.Marshaller;
/**
* @author Thomas.Diesler at jboss.org
+ * @author alessio.soldano at jboss.com
* @since 25-Nov-2004
*/
public class SOAPMessageMarshaller implements Marshaller
@@ -51,21 +50,10 @@
*/
public void write(Object dataObject, OutputStream output) throws IOException
{
- if (dataObject instanceof InvocationRequest)
- dataObject = ((InvocationRequest)dataObject).getParameter();
-
- if (dataObject instanceof OnewayInvocation)
- dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
-
if ((dataObject instanceof SOAPMessage) == false)
throw new IllegalArgumentException("Not a SOAPMessage: " + dataObject);
SOAPMessageImpl soapMessage = (SOAPMessageImpl)dataObject;
soapMessage.writeTo(output);
}
-
- public Marshaller cloneMarshaller() throws CloneNotSupportedException
- {
- return new SOAPMessageMarshaller();
- }
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -29,10 +29,11 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.client.UnMarshaller;
/**
* @author Thomas.Diesler at jboss.org
+ * @author alessio.soldano at jboss.com
* @since 25-Nov-2004
*/
public class SOAPMessageUnMarshaller implements UnMarshaller
@@ -40,7 +41,7 @@
// Provide logging
private static Logger log = Logger.getLogger(SOAPMessageUnMarshaller.class);
- public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
+ public Object read(InputStream inputStream, Map<String, Object> metadata) throws IOException
{
if (log.isTraceEnabled())
log.trace("Read input stream with metadata=" + metadata);
@@ -64,13 +65,4 @@
{
return new MessageFactoryImpl();
}
-
- public void setClassLoader(ClassLoader classloader)
- {
- }
-
- public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
- {
- return new SOAPMessageUnMarshaller();
- }
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -34,12 +33,12 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.client.UnMarshaller;
/**
* @author Thomas.Diesler at jboss.org
+ * @author alessio.soldano at jboss.com
* @since 25-Nov-2004
*/
public class SOAPMessageUnMarshallerHTTP implements UnMarshaller
@@ -47,7 +46,7 @@
// Provide logging
private static Logger log = Logger.getLogger(SOAPMessageUnMarshallerHTTP.class);
- private static List validResponseCodes = new ArrayList();
+ private static List<Integer> validResponseCodes = new ArrayList<Integer>();
static
{
validResponseCodes.add(HttpServletResponse.SC_OK);
@@ -56,21 +55,22 @@
validResponseCodes.add(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
- public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
+ public Object read(InputStream inputStream, Map<String, Object> metadata) throws IOException
{
if (log.isTraceEnabled())
log.trace("Read input stream with metadata=" + metadata);
try
{
- Integer resCode = (Integer)metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
+ //TODO!!!! fix constants
+ Integer resCode = (Integer)metadata.get("ResponseCode");
if (resCode == null)
{
log.warn("No HTTP resonse code, assuming: SC_OK");
resCode = HttpServletResponse.SC_OK;
}
- String resMessage = (String)metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
+ String resMessage = (String)metadata.get("ResponseCodeMessage");
if (validResponseCodes.contains(resCode) == false)
throw new WSException("Invalid HTTP server response [" + resCode + "] - " + resMessage);
@@ -98,37 +98,17 @@
return new MessageFactoryImpl();
}
- /**
- * Set the class loader to use for unmarhsalling. This may
- * be needed when need to have access to class definitions that
- * are not part of this unmarshaller's parent classloader (especially
- * when doing remote classloading).
- *
- * @param classloader
- */
- public void setClassLoader(ClassLoader classloader)
+ private MimeHeaders getMimeHeaders(Map<String, Object> metadata)
{
- //NO OP
- }
-
- public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
- {
- return new SOAPMessageUnMarshallerHTTP();
- }
-
- private MimeHeaders getMimeHeaders(Map metadata)
- {
log.debug("getMimeHeaders from: " + metadata);
MimeHeaders headers = new MimeHeaders();
- Iterator i = metadata.keySet().iterator();
- while (i.hasNext())
+ for (String key : metadata.keySet())
{
- String key = (String)i.next();
Object value = metadata.get(key);
if (key != null && value instanceof List)
{
- for (Object listValue : (List)value)
+ for (Object listValue : (List<?>)value)
{
headers.addHeader(key, listValue.toString());
}
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -42,17 +42,17 @@
* SOAP message context
* @see org.jboss.ws.core.soap.MessageContextAssociation
*/
- private static ThreadLocal<Stack<CommonMessageContext>> msgContextAssoc = new ThreadLocal<Stack<CommonMessageContext>>();
+ private static ThreadLocal<Stack<CommonMessageContext>> msgContextAssoc = new InheritableThreadLocal<Stack<CommonMessageContext>>();
/**
* @see org.jboss.ws.extensions.security.STRTransform
*/
- private static ThreadLocal<SecurityStore> strTransformAssoc = new ThreadLocal<SecurityStore>();
+ private static ThreadLocal<SecurityStore> strTransformAssoc = new InheritableThreadLocal<SecurityStore>();
/**
* Public keys used to sign incoming message
*/
- private static ThreadLocal<List<PublicKey>> signatureKeysAssoc = new ThreadLocal<List<PublicKey>>();
+ private static ThreadLocal<List<PublicKey>> signatureKeysAssoc = new InheritableThreadLocal<List<PublicKey>>();
public static ThreadLocal<Stack<CommonMessageContext>> localMsgContextAssoc()
{
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageAssembler.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageAssembler.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMessageAssembler.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -28,9 +28,9 @@
import java.io.InputStream;
import java.util.Map;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.client.Marshaller;
+import org.jboss.ws.core.client.UnMarshaller;
/**
* Translates JBoss messages to RM sources and vice-versa.
Modified: stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java
===================================================================
--- stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMetadata.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -23,9 +23,10 @@
import java.util.Map;
import java.util.HashMap;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.client.Marshaller;
+import org.jboss.ws.core.client.UnMarshaller;
+
/**
* RM metadata heavily used by this RM transport
*
Modified: stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.bat
===================================================================
--- stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.bat 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.bat 2009-06-26 14:18:13 UTC (rev 10242)
@@ -53,6 +53,7 @@
set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/FastInfoset.jar
set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar
set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
+set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/netty.jar
set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/policy.jar
set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/xmlsec.jar
Modified: stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.sh
===================================================================
--- stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.sh 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/resources/src/main/resources/bin/wsrunclient.sh 2009-06-26 14:18:13 UTC (rev 10242)
@@ -80,6 +80,7 @@
WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/FastInfoset.jar"
WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/mail.jar"
+WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/netty.jar"
WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/policy.jar"
WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/stax-api.jar"
WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/xmlsec.jar"
Modified: stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.bat
===================================================================
--- stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.bat 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.bat 2009-06-26 14:18:13 UTC (rev 10242)
@@ -18,6 +18,7 @@
set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JAVA_HOME%/lib/tools.jar
set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/activation.jar
set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/getopt.jar
+set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/netty.jar
set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/wstx.jar
set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/wsdl4j.jar
set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
Modified: stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.sh
===================================================================
--- stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.sh 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/resources/src/main/resources/bin/wstools.sh 2009-06-26 14:18:13 UTC (rev 10242)
@@ -48,6 +48,7 @@
WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JAVA_HOME/lib/tools.jar"
WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/activation.jar"
WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/getopt.jar"
+WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/netty.jar"
WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/wstx.jar"
WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/wsdl4j.jar"
WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar"
Modified: stack/native/branches/netty/modules/resources/src/main/resources/resources/default-deploy.conf
===================================================================
--- stack/native/branches/netty/modules/resources/src/main/resources/resources/default-deploy.conf 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/resources/src/main/resources/resources/default-deploy.conf 2009-06-26 14:18:13 UTC (rev 10242)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jboss-jaxrpc.jar client/jboss-jaxws-ext.jar client/jboss-jaxws.jar client/jboss-saaj.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jbossws-native-saaj.jar client/jbossws-client.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jboss-jaxrpc.jar common/lib/jboss-jaxws-ext.jar common/lib/jboss-jaxws.jar common/lib/jboss-saaj.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native!
-jaxws.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar server/default/deploy/jbossws.sar server/default/deploy/juddi-service.sar server/default/deploy/jbossws-container-jboss-beans.xml server/default/deployers/jbossws.deployer/FastInfoset.jar server/default/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/default/deployers/jbossws.deployer/jbossws-native-core.jar server/default/deployers/jbossws.deployer/jettison.jar server/default/deployers/jbossws.deployer/policy.jar server/default/deployers/jbossws.deployer/wsdl4j.jar server/default/deployers/jbossws.deployer/xmlsec.jar server/default/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jboss-jaxrpc.jar client/jboss-jaxws-ext.jar client/jboss-jaxws.jar client/jboss-saaj.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jbossws-native-saaj.jar client/jbossws-client.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jboss-jaxrpc.jar common/lib/jboss-jaxws-ext.jar common/lib/jboss-jaxws.jar common/lib/jboss-saaj.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/l!
ib/jbossws-native-jaxws.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar server/default/deploy/jbossws.sar server/default/deploy/juddi-service.sar server/default/deploy/jbossws-container-jboss-beans.xml server/default/deployers/jbossws.deployer/FastInfoset.jar server/default/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/default/deployers/jbossws.deployer/jbossws-native-core.jar server/default/deployers/jbossws.deployer/jettison.jar server/default/deployers/jbossws.deployer/netty.jar server/default/deployers/jbossws.deployer/policy.jar server/default/deployers/jbossws.deployer/wsdl4j.jar server/default/deployers/jbossws.deployer/xmlsec.jar server/default/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar
Modified: stack/native/branches/netty/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
===================================================================
--- stack/native/branches/netty/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2009-06-26 14:18:13 UTC (rev 10242)
@@ -44,6 +44,7 @@
<include name="**/jbossws-native-saaj.jar"/>
<include name="**/jbossws-spi.jar"/>
<include name="**/jettison.jar"/>
+ <include name="**/netty.jar"/>
<include name="**/policy.jar"/>
<include name="**/stax-api.jar"/>
<include name="**/stax-ex.jar"/>
@@ -79,6 +80,7 @@
<include name="**/jboss-jaxb-intros.jar"/>
<include name="**/jbossws-native-core.jar"/>
<include name="**/jettison.jar"/>
+ <include name="**/netty.jar"/>
<include name="**/policy.jar"/>
<include name="**/wsdl4j.jar"/>
<include name="**/xmlsec.jar"/>
Modified: stack/native/branches/netty/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wseventing/SubscriptionManagerTestCase.java
===================================================================
--- stack/native/branches/netty/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wseventing/SubscriptionManagerTestCase.java 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/wseventing/SubscriptionManagerTestCase.java 2009-06-26 14:18:13 UTC (rev 10242)
@@ -114,6 +114,7 @@
assertNotNull(subscriptionTicket.getExpires());
assertTrue(subscriptionTicket.getExpires().getTime() > System.currentTimeMillis());
assertNotNull(subscriptionTicket.getSubscriptionManager());
+ zzzz();
}
/**
@@ -135,6 +136,7 @@
{
// ignore expected exception
}
+ zzzz();
}
public void testExceedsMaxLeaseTime() throws Exception
@@ -149,6 +151,7 @@
{
// ignore expected exception
}
+ zzzz();
}
/**
@@ -175,6 +178,7 @@
{
// ignore expected exception
}
+ zzzz();
}
public void testDispatch() throws Exception
@@ -187,6 +191,7 @@
Element payload = DOMUtils.parse(eventString);
subscriptionManager.dispatch(eventSourceNS, payload);
+ zzzz();
}
public void testXPathFilter() throws Exception
@@ -198,5 +203,14 @@
Element event = DOMUtils.parse(eventString);
subscriptionManager.dispatch(eventSourceNS, event);
+ zzzz();
}
+
+ private void zzzz() {
+ try
+ {
+ Thread.currentThread().sleep(30000);
+ }
+ catch (Exception e) {}
+ }
}
Modified: stack/native/branches/netty/pom.xml
===================================================================
--- stack/native/branches/netty/pom.xml 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/pom.xml 2009-06-26 14:18:13 UTC (rev 10242)
@@ -72,6 +72,7 @@
<jboss.jaxr.version>1.2.1.GA</jboss.jaxr.version>
<apache.scout.version>0.7rc2</apache.scout.version>
<juddi.version>0.9RC4</juddi.version>
+ <netty.version>3.1.0.CR1</netty.version>
<sun.fastinfoset.version>1.2.2</sun.fastinfoset.version>
<sun.jaxws.version>2.1.3</sun.jaxws.version>
<woodstox.version>3.2.6</woodstox.version>
@@ -337,6 +338,11 @@
<artifactId>xmlsec</artifactId>
<version>${xmlsec.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: stack/native/branches/netty/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/native/branches/netty/src/main/scripts/assembly-deploy-artifacts.xml 2009-06-26 13:23:05 UTC (rev 10241)
+++ stack/native/branches/netty/src/main/scripts/assembly-deploy-artifacts.xml 2009-06-26 14:18:13 UTC (rev 10242)
@@ -52,6 +52,7 @@
<include>com.sun.xml.stream.buffer:streambuffer:jar</include>
<include>wsdl4j:wsdl4j:jar</include>
<include>org.apache:xmlsec:jar</include>
+ <include>org.jboss.netty:netty:jar</include>
</includes>
</dependencySet>
<dependencySet>
More information about the jbossws-commits
mailing list