org.mule.transport.ajax
Class AjaxMessageDispatcher

java.lang.Object
  extended by org.mule.transport.AbstractTransportMessageHandler
      extended by org.mule.transport.AbstractMessageDispatcher
          extended by org.mule.transport.ajax.AjaxMessageDispatcher
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, MessageProcessor, Connectable, MessageDispatcher, BayeuxAware

public class AjaxMessageDispatcher
extends AbstractMessageDispatcher
implements BayeuxAware

Will dispatch Mule events to ajax clients available in Bayeux that are listening to this endpoint.


Field Summary
protected  org.mortbay.cometd.AbstractBayeux bayeux
           
protected  boolean cacheMessages
           
protected  String channel
           
protected  org.cometd.Client client
           
protected  org.apache.commons.collections.Buffer messageCache
           
protected  int messageCacheSize
           
 
Fields inherited from class org.mule.transport.AbstractMessageDispatcher
defaultOutboundTransformers, defaultResponseTransformers
 
Fields inherited from class org.mule.transport.AbstractTransportMessageHandler
connected, connector, endpoint, lifecycleManager, logger, muleMessageFactory, retryTemplate
 
Fields inherited from interface org.mule.api.transport.MessageDispatcher
RECEIVE_NO_WAIT, RECEIVE_WAIT_INDEFINITELY
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
AjaxMessageDispatcher(OutboundEndpoint endpoint)
           
 
Method Summary
protected  void deliver(org.cometd.Client theClient, String channelName, Object data)
           
protected  void doDispatch(MuleEvent event)
           
protected  void doDispose()
           
protected  void doInitialise()
           
protected  MuleMessage doSend(MuleEvent event)
           
 org.mortbay.cometd.AbstractBayeux getBayeux()
           
protected  org.cometd.Client getClient()
           
 void setBayeux(org.mortbay.cometd.AbstractBayeux bayeux)
           
 
Methods inherited from class org.mule.transport.AbstractMessageDispatcher
applyOutboundTransformers, applyResponseTransformers, createLifecycleManager, getDispatcherName, getEndpoint, getWorkManager, process, returnResponse, returnResponse
 
Methods inherited from class org.mule.transport.AbstractTransportMessageHandler
activate, connect, connectHandler, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doConnect, doDisconnect, doStart, doStartHandler, doStop, getConnectEventId, getConnectionDescription, getConnector, getLifecycleState, initialise, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopped, isStopping, passivate, setEndpoint, start, stop, toString, validate, validateConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transport.MessageDispatcher
activate, createMuleMessage, createMuleMessage, getConnector, passivate, validate
 
Methods inherited from interface org.mule.api.transport.Connectable
connect, disconnect, getConnectionDescription, isConnected, validateConnection
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.lifecycle.LifecycleStateEnabled
getLifecycleState
 

Field Detail

bayeux

protected org.mortbay.cometd.AbstractBayeux bayeux

cacheMessages

protected boolean cacheMessages

messageCacheSize

protected int messageCacheSize

messageCache

protected org.apache.commons.collections.Buffer messageCache

channel

protected String channel

client

protected org.cometd.Client client
Constructor Detail

AjaxMessageDispatcher

public AjaxMessageDispatcher(OutboundEndpoint endpoint)
                      throws CreateException
Throws:
CreateException
Method Detail

getBayeux

public org.mortbay.cometd.AbstractBayeux getBayeux()
Specified by:
getBayeux in interface BayeuxAware

setBayeux

public void setBayeux(org.mortbay.cometd.AbstractBayeux bayeux)
Specified by:
setBayeux in interface BayeuxAware

doInitialise

protected void doInitialise()
                     throws InitialisationException
Overrides:
doInitialise in class AbstractTransportMessageHandler
Throws:
InitialisationException

getClient

protected org.cometd.Client getClient()

doDispatch

protected void doDispatch(MuleEvent event)
                   throws Exception
Specified by:
doDispatch in class AbstractMessageDispatcher
Throws:
Exception

deliver

protected void deliver(org.cometd.Client theClient,
                       String channelName,
                       Object data)

doSend

protected MuleMessage doSend(MuleEvent event)
                      throws Exception
Specified by:
doSend in class AbstractMessageDispatcher
Throws:
Exception

doDispose

protected void doDispose()
Overrides:
doDispose in class AbstractTransportMessageHandler


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.