Class MessageProtocolDispatcher
java.lang.Object
com.inductiveautomation.perspective.gateway.session.MessageProtocolDispatcher
- Direct Known Subclasses:
- PageModel.Handlers
Handles some boilerplate for classes that can handle receiving messages from a websocket channel. Basically
 just a fancy wrapper around a map of protocol handling messages.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionMessageProtocolDispatcher(com.inductiveautomation.ignition.common.gson.Gson gson, LoggerEx log) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanprotected voidonFatalError(MessageChannel channel, String message) protected voidonFatalError(MessageChannel channel, String message, Throwable t) voidreceive(MessageChannel channel, String protocol, Reader payload) <T> voidregister(String protocol, BiConsumer<MessageChannel, T> handler, Class<T> clazz) voidtrySend(MessageChannel channel, String protocol, com.inductiveautomation.ignition.common.gson.JsonObject payload) Handy wrapper around MessageChannel.send that logs a warning upon failure.voidtrySend(MessageChannel channel, String protocol, Object payload) Handy wrapper around MessageChannel.send that logs a warning upon failure.voidtrySendInternal(MessageChannel channel, String protocol, String payload) 
- 
Field Details- 
handlers
 
- 
- 
Constructor Details- 
MessageProtocolDispatcherpublic MessageProtocolDispatcher(com.inductiveautomation.ignition.common.gson.Gson gson, LoggerEx log) 
 
- 
- 
Method Details- 
receive
- 
register
- 
handles
- 
onFatalError
- 
onFatalError
- 
trySendpublic void trySend(MessageChannel channel, String protocol, com.inductiveautomation.ignition.common.gson.JsonObject payload) Handy wrapper around MessageChannel.send that logs a warning upon failure.
- 
trySendHandy wrapper around MessageChannel.send that logs a warning upon failure.- Parameters:
- payload- An object that will be gson-serialized automatically.
 
- 
trySendInternal
 
-