org.jboss.soa.esb.listeners.message
Class HttpListener

java.lang.Object
  extended by org.jboss.soa.esb.listeners.message.AbstractListener
      extended by org.jboss.soa.esb.listeners.message.AbstractPassiveListener
          extended by org.jboss.soa.esb.listeners.message.HttpListener
All Implemented Interfaces:
java.lang.Runnable, org.jboss.remoting.ServerInvocationHandler

public class HttpListener
extends AbstractPassiveListener
implements org.jboss.remoting.ServerInvocationHandler

Http listener implementation using the JBoss Remoting channel. 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"> 
        <action class=&quotorg.jboss.soa.esb.actions.routing.EchoRouter"/>     
  </HttpListener>
 

Author:
Johan Kumps

Field Summary
protected  boolean info
           
 java.lang.String listenHttpUrl
           
protected  org.apache.log4j.Logger logger
           
 
Fields inherited from class org.jboss.soa.esb.listeners.message.AbstractListener
_config, _controller, m_iMaxThr, m_iUpperThreadLimit, PARM_MAX_THREADS, pipelineExecutorPool
 
Constructor Summary
HttpListener(EsbListenerController esbListenerController, ConfigTree configuration)
          Constructor initialising this HttpListener
 
Method Summary
 void addListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
          Adds a callback handler that will listen for callbacks from the server invoker handler.
 java.lang.String getListenHttpUrl()
          Method getting the url this HttpListener instance is listening on
 java.lang.Object invoke(org.jboss.remoting.InvocationRequest invocationRequest)
           
 void removeListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
          Removes the callback handler that was listening for callbacks from the server invoker handler.
 void setInvoker(org.jboss.remoting.ServerInvoker invoker)
          set the invoker that owns this handler
 void setListenHttpUrl(java.lang.String listenHttpUrl)
          Method setting the listenHttpUrl property to listen on
 void setMBeanServer(javax.management.MBeanServer server)
          set the mbean server that the handler can reference
 
Methods inherited from class org.jboss.soa.esb.listeners.message.AbstractPassiveListener
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.apache.log4j.Logger logger

info

protected boolean info

listenHttpUrl

public java.lang.String listenHttpUrl
Constructor Detail

HttpListener

public HttpListener(EsbListenerController esbListenerController,
                    ConfigTree configuration)
             throws ConfigurationException,
                    ListenerInitializationException
Constructor initialising this HttpListener

Parameters:
commandListener -
listenerConfig -
actionDefinitionFactory -
Throws:
java.lang.Exception
ConfigurationException
ListenerInitializationException
Method Detail

invoke

public java.lang.Object invoke(org.jboss.remoting.InvocationRequest invocationRequest)
                        throws java.lang.Throwable
Specified by:
invoke in interface org.jboss.remoting.ServerInvocationHandler
Throws:
java.lang.Throwable

addListener

public void addListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
Adds a callback handler that will listen for callbacks from the server invoker handler.

Specified by:
addListener in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
callbackHandler -

removeListener

public void removeListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
Removes the callback handler that was listening for callbacks from the server invoker handler.

Specified by:
removeListener in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
callbackHandler -

setMBeanServer

public void setMBeanServer(javax.management.MBeanServer server)
set the mbean server that the handler can reference

Specified by:
setMBeanServer in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
server -

setInvoker

public void setInvoker(org.jboss.remoting.ServerInvoker invoker)
set the invoker that owns this handler

Specified by:
setInvoker in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
invoker -

getListenHttpUrl

public java.lang.String getListenHttpUrl()
Method getting the url this HttpListener instance is listening on

Returns:
the current listenHttpUrl

setListenHttpUrl

public void setListenHttpUrl(java.lang.String listenHttpUrl)
Method setting the listenHttpUrl property to listen on

Parameters:
listenHttpUrl - the listenHttpUrl to be used by this HttpListener instance