public class UndertowConsumer
extends org.apache.camel.impl.DefaultConsumer
implements io.undertow.server.HttpHandler, org.apache.camel.Suspendable
| Constructor and Description |
|---|
UndertowConsumer(UndertowEndpoint endpoint,
org.apache.camel.Processor processor) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart() |
protected void |
doStop() |
UndertowEndpoint |
getEndpoint() |
void |
handleRequest(io.undertow.server.HttpServerExchange httpExchange) |
void |
sendEventNotification(String connectionKey,
io.undertow.websockets.spi.WebSocketHttpExchange transportExchange,
io.undertow.websockets.core.WebSocketChannel channel,
UndertowConstants.EventType eventType)
Send a notification related a WebSocket peer.
|
void |
sendMessage(String connectionKey,
io.undertow.websockets.core.WebSocketChannel channel,
Object message)
Create an
Exchange from the associated UndertowEndpoint and set the in Message's
body to the given message and UndertowConstants.CONNECTION_KEY header to the given
connectionKey. |
createUoW, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, handleException, handleException, setExceptionHandler, setRoute, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic UndertowConsumer(UndertowEndpoint endpoint, org.apache.camel.Processor processor)
public UndertowEndpoint getEndpoint()
getEndpoint in interface org.apache.camel.EndpointAwaregetEndpoint in class org.apache.camel.impl.DefaultConsumerprotected void doStart()
throws Exception
doStart in class org.apache.camel.impl.DefaultConsumerExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.impl.DefaultConsumerExceptionpublic void handleRequest(io.undertow.server.HttpServerExchange httpExchange)
throws Exception
handleRequest in interface io.undertow.server.HttpHandlerExceptionpublic void sendMessage(String connectionKey, io.undertow.websockets.core.WebSocketChannel channel, Object message)
Exchange from the associated UndertowEndpoint and set the in Message's
body to the given message and UndertowConstants.CONNECTION_KEY header to the given
connectionKey.connectionKey - an identifier of WebSocketChannel through which the message was receivedchannel - the WebSocketChannel through which the message was receivedmessage - the message received via the WebSocketChannelpublic void sendEventNotification(String connectionKey, io.undertow.websockets.spi.WebSocketHttpExchange transportExchange, io.undertow.websockets.core.WebSocketChannel channel, UndertowConstants.EventType eventType)
connectionKey - of WebSocket peertransportExchange - the exchange for the websocket transport, only available for ON_OPEN eventschannel - the WebSocketChannel through which the message was receivedeventType - the type of the eventApache Camel