Author: richard.opalka(a)jboss.com
Date: 2007-12-18 10:45:14 -0500 (Tue, 18 Dec 2007)
New Revision: 5347
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
Log:
fix callbacks server handler so it will use our custom unmarshaller instead of default one
that trims CRNLs
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java 2007-12-18
14:15:41 UTC (rev 5346)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMMarshaller.java 2007-12-18
15:45:14 UTC (rev 5347)
@@ -33,7 +33,7 @@
*
* @author richard.opalka(a)jboss.com
*/
-final class RMMarshaller implements Marshaller
+public final class RMMarshaller implements Marshaller
{
private static final Marshaller instance = new RMMarshaller();
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java 2007-12-18
14:15:41 UTC (rev 5346)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/RMUnMarshaller.java 2007-12-18
15:45:14 UTC (rev 5347)
@@ -33,7 +33,7 @@
*
* @author richard.opalka(a)jboss.com
*/
-final class RMUnMarshaller implements UnMarshaller
+public final class RMUnMarshaller implements UnMarshaller
{
private static final UnMarshaller instance = new RMUnMarshaller();
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java 2007-12-18
14:15:41 UTC (rev 5346)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java 2007-12-18
15:45:14 UTC (rev 5347)
@@ -26,9 +26,10 @@
import org.jboss.logging.Logger;
import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
import org.jboss.remoting.transport.Connector;
import org.jboss.ws.extensions.wsrm.api.RMException;
+import org.jboss.ws.extensions.wsrm.transport.RMMarshaller;
+import org.jboss.ws.extensions.wsrm.transport.RMUnMarshaller;
/**
* Back ports server used by addressable clients
@@ -78,7 +79,9 @@
this.port = port;
try
{
- InvokerLocator il = new InvokerLocator(this.scheme + "://" + this.host
+ ":" + this.port);
+ // we have to use custom unmarshaller because default one removes CRNLs
+ String customUnmarshaller = "/?unmarshaller=" +
RMUnMarshaller.class.getName();
+ InvokerLocator il = new InvokerLocator(this.scheme + "://" + this.host
+ ":" + this.port + customUnmarshaller);
this.connector = new Connector();
this.connector.setInvokerLocator(il.getLocatorURI());
this.connector.create();
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-18
14:15:41 UTC (rev 5346)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java 2007-12-18
15:45:14 UTC (rev 5347)
@@ -28,10 +28,9 @@
import org.jboss.logging.Logger;
import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.transport.coyote.RequestMap;
import org.jboss.ws.core.MessageTrace;
import org.jboss.ws.extensions.wsrm.transport.RMMessage;
-import org.jboss.ws.extensions.wsrm.transport.RMMessageFactory;
-import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
import org.jboss.ws.extensions.wsrm.transport.RMUnassignedMessageListener;
/**
@@ -74,14 +73,11 @@
public final void handle(InvocationRequest request)
{
- String requestMessage = (String)request.getParameter();
+ RMMessage message = (RMMessage)request.getParameter();
synchronized (instanceLock)
{
- logger.debug("Setting response object");
- MessageTrace.traceMessage("Incoming RM Response Message",
requestMessage.getBytes());
- // 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 requestMessage = new String(message.getPayload());
+ MessageTrace.traceMessage("Incoming RM Response Message (callback)",
requestMessage);
String startPattern = "<wsa:RelatesTo>"; // TODO: remove this
with XML content inspection
String endPattern = "</wsa:RelatesTo>";
int begin = requestMessage.indexOf(startPattern) + startPattern.length();
@@ -101,7 +97,6 @@
this.listener.unassignedMessageReceived();
}
}
- MessageTrace.traceMessage("Incoming RM Response Message (callback)",
requestMessage.getBytes());
}
}
Show replies by date