public class DefaultHttpListener extends Object implements HttpListener, Initialisable, MuleContextAware, FlowConstructAware
Modifier and Type | Field and Description |
---|---|
static String |
SERVER_PROBLEM |
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
DefaultHttpListener() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Get rid of this listener.
|
String[] |
getAllowedMethods() |
HttpListenerConfig |
getConfig() |
String |
getPath() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
setAllowedMethods(String allowedMethods) |
void |
setConfig(DefaultHttpListenerConfig config) |
void |
setErrorResponseBuilder(HttpResponseBuilder errorResponseBuilder) |
void |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setListener(MessageProcessor messageProcessor)
Set the MessageProcessor listener on a message source which will be invoked
when a message is received or generated.
|
void |
setMuleContext(MuleContext muleContext) |
void |
setParseRequest(boolean parseRequest) |
void |
setPath(String path) |
void |
setResponseBuilder(HttpResponseBuilder responseBuilder) |
void |
setResponseStreamingMode(HttpStreamingType responseStreamingMode) |
void |
start()
Starts an stopped listener.
|
void |
stop()
Stops this listener.
|
public static final String SERVER_PROBLEM
public void setListener(MessageProcessor messageProcessor)
MessageSource
setListener
in interface MessageSource
public void setPath(String path)
public void setAllowedMethods(String allowedMethods)
public void setConfig(DefaultHttpListenerConfig config)
public void setResponseBuilder(HttpResponseBuilder responseBuilder)
public void setErrorResponseBuilder(HttpResponseBuilder errorResponseBuilder)
public void setResponseStreamingMode(HttpStreamingType responseStreamingMode)
public void setParseRequest(boolean parseRequest)
public HttpListenerConfig getConfig()
getConfig
in interface HttpListener
public void start() throws MuleException
HttpListener
start
in interface Startable
start
in interface HttpListener
MuleException
public void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic void setMuleContext(MuleContext muleContext)
setMuleContext
in interface MuleContextAware
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct
in interface FlowConstructAware
public void stop() throws MuleException
HttpListener
ServiceTemporarilyUnavailableListenerRequestHandler.SERVICE_TEMPORARILY_UNAVAILABLE_STATUS_CODE
.stop
in interface Stoppable
stop
in interface HttpListener
MuleException
- if there's was a problem stopping the listenerpublic void dispose()
HttpListener
org.mule.module.http.internal.listener.NoListenerRequestHandler#RESOURCE_NOT_FOUND_STATUS_CODE
unless
there's another listener which path matches the request criteria.dispose
in interface Disposable
dispose
in interface HttpListener
public String getPath()
getPath
in interface HttpListener
public String[] getAllowedMethods()
getAllowedMethods
in interface HttpListener
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.