org.mule.transport.ajax.embedded
Class AjaxConnector
java.lang.Object
org.mule.transport.AbstractConnector
org.mule.transport.servlet.ServletConnector
org.mule.transport.ajax.container.AjaxServletConnector
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.
| 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 |
| 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.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 |
PROTOCOL
public static final String PROTOCOL
- See Also:
- Constant Field Values
AjaxConnector
public AjaxConnector()
getProtocol
public String getProtocol()
- Specified by:
getProtocol in interface Connector- Overrides:
getProtocol in class AjaxServletConnector
- Returns:
- the primary protocol name for endpoints of this connector
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
- Description copied from class:
AbstractConnector
- Template method to perform any work when starting the connectoe
- Overrides:
doStart in class ServletConnector
- Throws:
MuleException - if the method fails
doStop
protected void doStop()
throws MuleException
- Description copied from class:
AbstractConnector
- Template method to perform any work when stopping the connectoe
- Overrides:
doStop in class ServletConnector
- Throws:
MuleException - if the method fails
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
- Description copied from interface:
Connector
- This creates a
MessageReceiver associated with this endpoint
and registers it with the connector
- Specified by:
registerListener in interface Connector- Overrides:
registerListener in class AjaxServletConnector
- Parameters:
service - the listening serviceendpoint - the endpoint contains the listener endpointUri on which to
listen on.
- Throws:
Exception - if the MessageReceiver cannot be created or the Receiver
cannot be registered
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)
- Description copied from interface:
Connector
- The dispatcher factory is used to create a message dispatcher of the current
request
- Specified by:
setDispatcherFactory in interface Connector- Overrides:
setDispatcherFactory in class AbstractConnector
- Parameters:
dispatcherFactory - The dispatcherFactory to set.
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.