org.mule.transport.ajax.embedded
Class AjaxConnector

java.lang.Object
  extended by org.mule.transport.AbstractConnector
      extended by org.mule.transport.servlet.ServletConnector
          extended by org.mule.transport.ajax.container.AjaxServletConnector
              extended by org.mule.transport.ajax.embedded.AjaxConnector
All Implemented Interfaces:
ExceptionListener, EventListener, javax.resource.spi.work.WorkListener, MuleContextAware, MuleContextNotificationListener<MuleContextNotification>, ServerNotificationListener<MuleContextNotification>, Disposable, Initialisable, Lifecycle, Startable, Stoppable, NamedObject, Connectable, Connector

public class AjaxConnector
extends AjaxServletConnector
implements MuleContextNotificationListener<MuleContextNotification>

Creates an 'embedded' Ajax server using Jetty and allows Mule to receiver and send events to browsers. The browser will need to use the

mule.js
class to publish and subscribe events.


Nested Class Summary
 class AjaxConnector.BayeuxHolder
           
 
Field Summary
static String PROTOCOL
           
 
Fields inherited from class org.mule.transport.ajax.container.AjaxServletConnector
bayeux
 
Fields inherited from class org.mule.transport.servlet.ServletConnector
SERVLET, servletUrl
 
Fields inherited from class org.mule.transport.AbstractConnector
connected, createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatchers, disposed, exceptionListener, initialised, initialStateStopped, logger, muleContext, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, started, startOnConnect
 
Fields inherited from interface org.mule.api.transport.Connector
INT_VALUE_NOT_SET
 
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
AjaxConnector()
           
 
Method Summary
protected  org.mortbay.jetty.AbstractConnector createJettyConnector()
           
protected  org.mortbay.cometd.continuation.ContinuationCometdServlet createServletForConnector(org.mortbay.jetty.Connector connector, ImmutableEndpoint endpoint)
           
 void destroyReceiver(MessageReceiver receiver, ImmutableEndpoint endpoint)
           
protected  void doConnect()
          Template method where any connections should be made for the connector
protected  void doDisconnect()
          Template method where any connected resources used by the connector should be disconnected
protected  void doDispose()
          Template method to dispose any resources associated with this receiver.
protected  void doInitialise()
           
protected  void doStart()
           
protected  void doStop()
           
 org.mortbay.jetty.Server getHttpServer()
           
 String getProtocol()
           
 void onNotification(MuleContextNotification notification)
           
 AjaxConnector.BayeuxHolder registerBayeuxEndpoint(ImmutableEndpoint endpoint)
           
 MessageReceiver registerListener(Service service, InboundEndpoint endpoint)
           
 void setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)
           
 
Methods inherited from class org.mule.transport.ajax.container.AjaxServletConnector
getBayeux, getFilters, getInterval, getLogLevel, getMaxInterval, getMultiFrameInterval, getRefsThreshold, getReplyToHandler, getTimeout, isJsonCommented, isRequestAvailable, setBayeux, setFilters, setInterval, setJsonCommented, setLogLevel, setMaxInterval, setMultiFrameInterval, setRefsThreshold, setRequestAvailable, setTimeout
 
Methods inherited from class org.mule.transport.servlet.ServletConnector
getReceiverKey, getReceivers, getServletUrl, setServletUrl
 
Methods inherited from class org.mule.transport.AbstractConnector
checkDisposed, configureDispatcherPool, connect, createReceiver, createScheduler, disconnect, dispatch, dispose, disposeDispatchers, disposeReceivers, disposeRequesters, disposeWorkManagers, doUnregisterListener, exceptionThrown, fireNotification, getConnectEventId, getConnectionDescription, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getExceptionListener, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMessageAdapter, getMessageAdapter, getMuleContext, getName, getNumberOfConcurrentTransactedReceivers, getOutputStream, getReceiver, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, handleException, handleException, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isInitialStateStopped, isResponseEnabled, isStarted, isSyncEnabled, isValidateConnections, lookupReceiver, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, send, setConnected, setCreateMultipleTransactedReceivers, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setExceptionListener, setInitialStateStopped, setMaxDispatchersActive, setMaxRequestersActive, setMuleContext, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterPoolMaxWait, setRequesterPoolWhenExhaustedAction, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, shutdownScheduler, start, startAfterConnect, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, validateConnection, workAccepted, workCompleted, workRejected, workStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOCOL

public static final String PROTOCOL
See Also:
Constant Field Values
Constructor Detail

AjaxConnector

public AjaxConnector()
Method Detail

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface Connector
Overrides:
getProtocol in class AjaxServletConnector

doInitialise

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

onNotification

public void onNotification(MuleContextNotification notification)
Specified by:
onNotification in interface ServerNotificationListener<MuleContextNotification>

doDispose

protected void doDispose()
Template method to dispose any resources associated with this receiver. There is not need to dispose the connector as this is already done by the framework

Overrides:
doDispose in class ServletConnector

doStart

protected void doStart()
                throws MuleException
Overrides:
doStart in class ServletConnector
Throws:
MuleException

doStop

protected void doStop()
               throws MuleException
Overrides:
doStop in class ServletConnector
Throws:
MuleException

doConnect

protected void doConnect()
                  throws Exception
Template method where any connections should be made for the connector

Overrides:
doConnect in class ServletConnector
Throws:
Exception

doDisconnect

protected void doDisconnect()
                     throws Exception
Template method where any connected resources used by the connector should be disconnected

Overrides:
doDisconnect in class ServletConnector
Throws:
Exception

registerListener

public MessageReceiver registerListener(Service service,
                                        InboundEndpoint endpoint)
                                 throws Exception
Specified by:
registerListener in interface Connector
Overrides:
registerListener in class AjaxServletConnector
Throws:
Exception

registerBayeuxEndpoint

public AjaxConnector.BayeuxHolder registerBayeuxEndpoint(ImmutableEndpoint endpoint)
                                                  throws MuleException
Throws:
MuleException

destroyReceiver

public void destroyReceiver(MessageReceiver receiver,
                            ImmutableEndpoint endpoint)
                     throws Exception
Overrides:
destroyReceiver in class AbstractConnector
Throws:
Exception

setDispatcherFactory

public void setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)
Specified by:
setDispatcherFactory in interface Connector
Overrides:
setDispatcherFactory in class AbstractConnector

createJettyConnector

protected org.mortbay.jetty.AbstractConnector createJettyConnector()

getHttpServer

public org.mortbay.jetty.Server getHttpServer()

createServletForConnector

protected org.mortbay.cometd.continuation.ContinuationCometdServlet createServletForConnector(org.mortbay.jetty.Connector connector,
                                                                                              ImmutableEndpoint endpoint)
                                                                                       throws MuleException
Throws:
MuleException


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