public class JettyHttpConnector extends AbstractConnector
JettyConnector
can be using to embed a Jetty server to receive requests on an
http inbound endpoint. One server is created for each connector declared, many Jetty endpoints
can share the same connector.Modifier and Type | Class and Description |
---|---|
class |
JettyHttpConnector.MuleReceiverConnectorHolder |
Modifier and Type | Field and Description |
---|---|
protected HashMap<String,ConnectorHolder> |
holders |
static String |
JETTY |
static String |
MULE_CONTEXT_ATTRIBUTE |
static String |
ROOT |
createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, logger, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, PROPERTY_POLLING_FREQUENCY, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect
INT_VALUE_NOT_SET
PHASE_NAME
Constructor and Description |
---|
JettyHttpConnector(MuleContext context) |
Modifier and Type | Method and Description |
---|---|
protected void |
addHandler(org.eclipse.jetty.server.Handler handler) |
boolean |
canHostFullWars()
A helper method to differentiate between jetty-based connectors which can host full wars and ones which can't.
|
protected void |
configureConnector(org.eclipse.jetty.server.AbstractNetworkConnector connector,
String host,
int port) |
protected ConnectorHolder |
createContextHolder(org.eclipse.jetty.server.Connector connector,
InboundEndpoint endpoint,
MessageReceiver receiver) |
protected org.eclipse.jetty.server.AbstractNetworkConnector |
createJettyConnector() |
protected MessageReceiver |
createReceiver(FlowConstruct flowConstruct,
InboundEndpoint endpoint)
Create a Message receiver for this connector
|
protected Servlet |
createServlet(org.eclipse.jetty.server.AbstractNetworkConnector connector,
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()
Template method to perform any work when starting the connectoe
|
protected void |
doStop()
Template method to perform any work when stopping the connectoe
|
int |
getAcceptors()
Get the number of "acceptor" threads Jetty should use
|
String |
getConfigFile() |
protected String |
getHolderKey(ImmutableEndpoint endpoint) |
org.eclipse.jetty.server.Server |
getHttpServer() |
String |
getProtocol() |
JettyReceiverServlet |
getReceiverServlet() |
String |
getResourceBase() |
int |
getSelectors()
Get the number of "selector" threads Jetty should use.
|
protected String |
getVirtualHostName(org.eclipse.jetty.server.AbstractNetworkConnector connector)
Returns the virtual host name required to map contexts to a specific connector.
|
WebappsConfiguration |
getWebappsConfiguration() |
protected void |
initialiseFromConfigFile() |
boolean |
isUseContinuations() |
void |
setAcceptors(int acceptors)
Set the number of "acceptor" threads Jetty should use
|
void |
setConfigFile(String configFile) |
void |
setReceiverServlet(JettyReceiverServlet receiverServlet) |
void |
setResourceBase(String resourceBase) |
void |
setSelectors(int selectors)
Set the number of "selector" threads Jetty should use.
|
protected void |
setupJettyLogging() |
void |
setUseContinuations(boolean useContinuations) |
void |
setWebappsConfiguration(WebappsConfiguration webappsConfiguration) |
void |
unregisterListener(MessageReceiver receiver) |
borrowDispatcher, clearDispatchers, clearRequesters, configureDispatcherPool, connect, createDefaultRedeliveryPolicy, createDispatcherMessageProcessor, createMuleMessageFactory, createOperationResource, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, getCanonicalURI, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOperationResourceFactory, getOutboundExchangePatterns, getOutputStream, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, getTransactionalResource, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isConnecting, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isInitialised, isInitialStateStopped, isResponseEnabled, isStarted, isStarting, isStopped, isStopping, isValidateConnections, lookupReceiver, registerListener, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, returnDispatcher, setConnected, setConnecting, setCreateMultipleTransactedReceivers, setDispatcherFactory, setDispatcherPoolFactory, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setInitialStateStopped, setMaxDispatchersActive, setMaxRequestersActive, 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
public static final String ROOT
public static final String JETTY
public static final String MULE_CONTEXT_ATTRIBUTE
protected HashMap<String,ConnectorHolder> holders
public JettyHttpConnector(MuleContext context)
protected void setupJettyLogging()
public String getProtocol()
protected void doInitialise() throws InitialisationException
doInitialise
in class AbstractConnector
InitialisationException
protected void addHandler(org.eclipse.jetty.server.Handler handler)
protected void initialiseFromConfigFile() throws InitialisationException
InitialisationException
protected void doDispose()
doDispose
in class AbstractConnector
protected void doStart() throws MuleException
AbstractConnector
doStart
in class AbstractConnector
MuleException
- if the method failsprotected void doStop() throws MuleException
AbstractConnector
doStop
in class AbstractConnector
MuleException
- if the method failsprotected void doConnect() throws Exception
doConnect
in class AbstractConnector
Exception
protected void doDisconnect() throws Exception
doDisconnect
in class AbstractConnector
Exception
protected MessageReceiver createReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint) throws Exception
AbstractConnector
createReceiver
in class AbstractConnector
flowConstruct
- the service that will receive events from this receiver, the
listenerendpoint
- the endpoint that defies this inbound communicationTransportServiceDescriptor
initialised using the service and endpoint.Exception
- if there is a problem creating the receiver. This exception
really depends on the underlying transport, thus any exception
could be thrownprotected org.eclipse.jetty.server.AbstractNetworkConnector createJettyConnector() throws InitialisationException
InitialisationException
public void unregisterListener(MessageReceiver receiver) throws MuleException
MuleException
public org.eclipse.jetty.server.Server getHttpServer()
public String getConfigFile()
public void setConfigFile(String configFile)
public JettyReceiverServlet getReceiverServlet()
public void setReceiverServlet(JettyReceiverServlet receiverServlet)
public boolean isUseContinuations()
public void setUseContinuations(boolean useContinuations)
public int getAcceptors()
public void setAcceptors(int acceptors)
acceptors
- the number of threadspublic int getSelectors()
ServerConnector.ServerConnector(org.eclipse.jetty.server.Server, int, int)
public void setSelectors(int selectors)
TODO MULE-7689: Allow to configure the number of selector threads through XML.
protected ConnectorHolder createContextHolder(org.eclipse.jetty.server.Connector connector, InboundEndpoint endpoint, MessageReceiver receiver)
protected Servlet createServlet(org.eclipse.jetty.server.AbstractNetworkConnector connector, ImmutableEndpoint endpoint)
protected String getHolderKey(ImmutableEndpoint endpoint)
protected void configureConnector(org.eclipse.jetty.server.AbstractNetworkConnector connector, String host, int port)
protected String getVirtualHostName(org.eclipse.jetty.server.AbstractNetworkConnector connector)
public String getResourceBase()
public void setResourceBase(String resourceBase)
public WebappsConfiguration getWebappsConfiguration()
public void setWebappsConfiguration(WebappsConfiguration webappsConfiguration)
public boolean canHostFullWars()
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.