[jboss-svn-commits] JBL Code SVN: r7375 - labs/jbossesb/workspace/jokum/product/core/listeners/src/org/jboss/soa/esb/listeners/message
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Nov 3 14:25:13 EST 2006
Author: jokum
Date: 2006-11-03 14:25:11 -0500 (Fri, 03 Nov 2006)
New Revision: 7375
Modified:
labs/jbossesb/workspace/jokum/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java
Log:
HttpListener expects an object message whose type is an org.jboss.soa.esb.message.Message
Modified: labs/jbossesb/workspace/jokum/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java
===================================================================
--- labs/jbossesb/workspace/jokum/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java 2006-11-03 18:58:56 UTC (rev 7374)
+++ labs/jbossesb/workspace/jokum/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java 2006-11-03 19:25:11 UTC (rev 7375)
@@ -33,12 +33,9 @@
import org.jboss.remoting.callback.InvokerCallbackHandler;
import org.jboss.remoting.transport.Connector;
import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionUtils;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.ListenerInitializationException;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
/**
* Http listener implementation using the JBoss Remoting channel.
@@ -46,14 +43,16 @@
* The listener will listen to messages on the configured listenHttpUrl. If this
* is not set, the default http://localhost:5400 will be used.
*
+ * This listener expects an Object message whose type is org.jboss.soa.esb.message.Message
+ *
* Sample listener Configuration:
*
- * <HttpListener listenerClass="org.jboss.soa.esb.listeners.message.HttpListener" actions="HttpInvocationToFile"/>
+ * <HttpListener listenerClass="org.jboss.soa.esb.listeners.message.HttpListener"/>
*
* <pre>
- * <HttpListener listenerClass="org.jboss.soa.esb.listeners.message.HttpListener">
- * <action class="org.jboss.soa.esb.actions.routing.EchoRouter"/>
- * </HttpListener>
+ * <HttpListener listenerClass="org.jboss.soa.esb.listeners.message.HttpListener">
+ * <action class=&quotorg.jboss.soa.esb.actions.routing.EchoRouter"/>
+ * </HttpListener>
* </pre>
*
* @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
@@ -108,7 +107,7 @@
*
* @see org.jboss.remoting.ServerInvocationHandler#invoke(org.jboss.remoting.InvocationRequest)
*/
- @SuppressWarnings("unchecked")
+ at SuppressWarnings("unchecked")
public Object invoke(InvocationRequest invocationRequest) throws Throwable {
// Retrieving the real payload of this invocationRequest
Object payload = invocationRequest.getParameter();
@@ -118,19 +117,17 @@
.info("HttpInvocationListener is invoked...The given payload is : "
+ payload);
}
- // Message creation...
- Message msg = MessageFactory.getInstance().getMessage(
- MessageType.JAVA_SERIALIZED);
- ActionUtils.setTaskObject(msg,payload);
+ if (payload instanceof Message){
+ // Start the action processing pipeline
+ ActionProcessingPipeline pipelineRunner = new ActionProcessingPipeline(
+ (Message)payload, this._config);
+ this.pipelineExecutorPool.submit(pipelineRunner);
+ } else {
+ this.logger.error("Unsupported HttpListener message type: " + payload.getClass().getName());
+ }
- // Start the action processing pipeline
- ActionProcessingPipeline pipelineRunner = new ActionProcessingPipeline(
- msg, this._config);
- this.pipelineExecutorPool.submit(pipelineRunner);
-
return payload;
}
-
/**
* Adds a callback handler that will listen for callbacks from the server
* invoker handler.
@@ -196,8 +193,10 @@
this.listenHttpUrl = this._config.getAttribute(LISTEN_HTTP_URL);
if (this.listenHttpUrl == null) {
this.listenHttpUrl = this.getDefaultListenHttpUrl();
- if (this.logger.isInfoEnabled()){
- this.logger.info("Attribute listenHttpUrl has not been set on the HttpListener. Using default " + this.getDefaultListenHttpUrl());
+ if (this.logger.isInfoEnabled()) {
+ this.logger
+ .info("Attribute listenHttpUrl has not been set on the HttpListener. Using default "
+ + this.getDefaultListenHttpUrl());
}
}
}
More information about the jboss-svn-commits
mailing list