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, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public UndertowConsumer(UndertowEndpoint endpoint, org.apache.camel.Processor processor)
public UndertowEndpoint getEndpoint()
getEndpoint
in interface org.apache.camel.EndpointAware
getEndpoint
in class org.apache.camel.impl.DefaultConsumer
protected void doStart() throws Exception
doStart
in class org.apache.camel.impl.DefaultConsumer
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.impl.DefaultConsumer
Exception
public void handleRequest(io.undertow.server.HttpServerExchange httpExchange) throws Exception
handleRequest
in interface io.undertow.server.HttpHandler
Exception
public 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 WebSocketChannel
public 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