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

java.lang.Object
  extended by java.util.Observable
      extended by org.jboss.soa.esb.listeners.AbstractManagedListener
          extended by org.jboss.soa.esb.listeners.message.HttpListener
All Implemented Interfaces:
java.lang.Runnable, java.util.Observer, org.jboss.remoting.ServerInvocationHandler

public class HttpListener
extends AbstractManagedListener
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.AbstractManagedListener
_bRegistered, _config, _controller, _defaultMaxThreads, _epr, _eprCategoryName, _eprName, _execService, _logger, _maxThreads, _pauseLapseInMillis
 
Constructor Summary
HttpListener(ListenerManager 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.
 boolean finalizeRun()
           
 java.lang.String getListenHttpUrl()
          Method getting the url this HttpListener instance is listening on
 boolean initializeRun()
           
 java.lang.Object invoke(org.jboss.remoting.InvocationRequest invocationRequest)
           
 boolean isMessageAware()
           
 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
 void waitForEventAndProcess(long maxWaitMillis)
           
 
Methods inherited from class org.jboss.soa.esb.listeners.AbstractManagedListener
checkMyParms, hasActiveTreads, obtainAttribute, registerProcess, resetThreadCount, run, unregisterProcess, update, updateThreadCount, waitUntilReady
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
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(ListenerManager 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

waitForEventAndProcess

public void waitForEventAndProcess(long maxWaitMillis)
Specified by:
waitForEventAndProcess in class AbstractManagedListener

isMessageAware

public boolean isMessageAware()
Specified by:
isMessageAware in class AbstractManagedListener

initializeRun

public boolean initializeRun()
Specified by:
initializeRun in class AbstractManagedListener

finalizeRun

public boolean finalizeRun()
Specified by:
finalizeRun in class AbstractManagedListener