Package org.apache.tomcat.websocket.pojo
Class PojoMessageHandlerWholeBase<T>
- java.lang.Object
-
- org.apache.tomcat.websocket.pojo.PojoMessageHandlerBase<T>
-
- org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeBase<T>
-
- Type Parameters:
T
- The type of message to handle
- All Implemented Interfaces:
MessageHandler
,MessageHandler.Whole<T>
,WrappedMessageHandler
- Direct Known Subclasses:
PojoMessageHandlerWholeBinary
,PojoMessageHandlerWholePong
,PojoMessageHandlerWholeText
public abstract class PojoMessageHandlerWholeBase<T> extends PojoMessageHandlerBase<T> implements MessageHandler.Whole<T>
Common implementation code for the POJO whole message handlers. All the real work is done in this class and in the superclass.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jakarta.websocket.MessageHandler
MessageHandler.Partial<T>, MessageHandler.Whole<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Decoder>
decoders
-
Fields inherited from class org.apache.tomcat.websocket.pojo.PojoMessageHandlerBase
convert, indexPayload, indexSession, maxMessageSize, method, params, pojo, session
-
-
Constructor Summary
Constructors Constructor Description PojoMessageHandlerWholeBase(java.lang.Object pojo, java.lang.reflect.Method method, Session session, java.lang.Object[] params, int indexPayload, boolean convert, int indexSession, long maxMessageSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
convert(T message)
protected Decoder
createDecoderInstance(java.lang.Class<? extends Decoder> clazz)
protected abstract java.lang.Object
decode(T message)
protected void
onClose()
void
onMessage(T message)
Called when a whole message is available to be processed.-
Methods inherited from class org.apache.tomcat.websocket.pojo.PojoMessageHandlerBase
getMaxMessageSize, getWrappedHandler, handlePojoMethodException, processResult
-
-
-
-
Field Detail
-
decoders
protected final java.util.List<Decoder> decoders
-
-
Constructor Detail
-
PojoMessageHandlerWholeBase
public PojoMessageHandlerWholeBase(java.lang.Object pojo, java.lang.reflect.Method method, Session session, java.lang.Object[] params, int indexPayload, boolean convert, int indexSession, long maxMessageSize)
-
-
Method Detail
-
createDecoderInstance
protected Decoder createDecoderInstance(java.lang.Class<? extends Decoder> clazz) throws java.lang.ReflectiveOperationException, javax.naming.NamingException
- Throws:
java.lang.ReflectiveOperationException
javax.naming.NamingException
-
onMessage
public final void onMessage(T message)
Description copied from interface:jakarta.websocket.MessageHandler.Whole
Called when a whole message is available to be processed.- Specified by:
onMessage
in interfaceMessageHandler.Whole<T>
- Parameters:
message
- The message
-
onClose
protected void onClose()
-
convert
protected java.lang.Object convert(T message)
-
decode
protected abstract java.lang.Object decode(T message) throws DecodeException
- Throws:
DecodeException
-
-