Top Description Inners Fields Constructors Methods
org.apache.tomcat.websocket.pojo

public Class PojoMethodMapping

extends Object
Class Inheritance
Imports
java.io.InputStream, .Reader, java.lang.annotation.Annotation, java.lang.reflect.Method, .Modifier, java.nio.ByteBuffer, java.util.ArrayList, .Arrays, .HashMap, .HashSet, .List, .Map, .Set, jakarta.websocket.CloseReason, .DecodeException, .Decoder, .DeploymentException, .EndpointConfig, .MessageHandler, .OnClose, .OnError, .OnMessage, .OnOpen, .PongMessage, .Session, jakarta.websocket.server.PathParam, org.apache.tomcat.InstanceManager, org.apache.tomcat.util.res.StringManager, org.apache.tomcat.websocket.DecoderEntry, .Util, .Util.DecoderMatch

For a POJO class annotated with jakarta.websocket.server.ServerEndpoint, an instance of this class creates and caches the method handler, method information and parameter information for the onXXX calls.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static enum

Field Summary

Modifier and TypeField and Description
private final Method
private final PojoPathParam[]
private final Method
private final PojoPathParam[]
private final List<PojoMethodMapping.MessageHandlerInfo>
private final Method
private final PojoPathParam[]
private static final StringManager
private final String

Constructor Summary

AccessConstructor and Description
public
PojoMethodMapping(Class<?>
POJO implementation class
clazzPojo
,
List<Class<? extends Decoder>>
Set of potential decoder classes
decoderClazzes
,
String
Path at which the endpoint will be deployed
wsPath
,
InstanceManager
Instance manager to use to create Decoder instances
instanceManager
)

Create a method mapping for the given POJO

Method Summary

Modifier and TypeMethod and Description
private static Object[]
buildArgs(PojoPathParam[] pathParams, Map<String, String> pathParameters, Session session, EndpointConfig config, Throwable throwable, CloseReason closeReason)

private void
public Set<MessageHandler>
getMessageHandlers(Object pojo, Map<String, String> pathParameters, Session session, EndpointConfig config)

public Method
public Object[]
getOnCloseArgs(Map<String, String> pathParameters, Session session, CloseReason closeReason)

public Method
public Object[]
getOnErrorArgs(Map<String, String> pathParameters, Session session, Throwable throwable)

public Method
public Object[]
getOnOpenArgs(Map<String, String> pathParameters, Session session, EndpointConfig config)

private static PojoPathParam[]
public String
public boolean
private boolean
isMethodOverride(Method method1, Method method2)

private boolean
isOverridenWithoutAnnotation(Method[] methods, Method superclazzMethod, Class<? extends Annotation> annotation)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

onCloseback to summary
private final Method onClose
onCloseParamsback to summary
private final PojoPathParam[] onCloseParams
onErrorback to summary
private final Method onError
onErrorParamsback to summary
private final PojoPathParam[] onErrorParams
onMessageback to summary
private final List<PojoMethodMapping.MessageHandlerInfo> onMessage
onOpenback to summary
private final Method onOpen
onOpenParamsback to summary
private final PojoPathParam[] onOpenParams
smback to summary
private static final StringManager sm
wsPathback to summary
private final String wsPath

Constructor Detail

PojoMethodMappingback to summary
public PojoMethodMapping(Class<?> clazzPojo, List<Class<? extends Decoder>> decoderClazzes, String wsPath, InstanceManager instanceManager) throws DeploymentException

Create a method mapping for the given POJO

Parameters
clazzPojo:Class<?>

POJO implementation class

decoderClazzes:List<Class<? extends Decoder>>

Set of potential decoder classes

wsPath:String

Path at which the endpoint will be deployed

instanceManager:InstanceManager

Instance manager to use to create Decoder instances

Exceptions
DeploymentException:
If the mapping cannot be completed

Method Detail

buildArgsback to summary
private static Object[] buildArgs(PojoPathParam[] pathParams, Map<String, String> pathParameters, Session session, EndpointConfig config, Throwable throwable, CloseReason closeReason) throws DecodeException
checkPublicback to summary
private void checkPublic(Method m) throws DeploymentException
getMessageHandlersback to summary
public Set<MessageHandler> getMessageHandlers(Object pojo, Map<String, String> pathParameters, Session session, EndpointConfig config)
getOnCloseback to summary
public Method getOnClose()
getOnCloseArgsback to summary
public Object[] getOnCloseArgs(Map<String, String> pathParameters, Session session, CloseReason closeReason) throws DecodeException
getOnErrorback to summary
public Method getOnError()
getOnErrorArgsback to summary
public Object[] getOnErrorArgs(Map<String, String> pathParameters, Session session, Throwable throwable) throws DecodeException
getOnOpenback to summary
public Method getOnOpen()
getOnOpenArgsback to summary
public Object[] getOnOpenArgs(Map<String, String> pathParameters, Session session, EndpointConfig config) throws DecodeException
getPathParamsback to summary
private static PojoPathParam[] getPathParams(Method m, PojoMethodMapping.MethodType methodType) throws DeploymentException
getWsPathback to summary
public String getWsPath()
hasMessageHandlersback to summary
public boolean hasMessageHandlers()
isMethodOverrideback to summary
private boolean isMethodOverride(Method method1, Method method2)
isOverridenWithoutAnnotationback to summary
private boolean isOverridenWithoutAnnotation(Method[] methods, Method superclazzMethod, Class<? extends Annotation> annotation)
org.apache.tomcat.websocket.pojo back to summary

private Class PojoMethodMapping.MessageHandlerInfo

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.tomcat.websocket.pojo.PojoMethodMapping.MessageHandlerInfo

Field Summary

Modifier and TypeField and Description
private Util.DecoderMatch
private int
private int
private int
private int
private Map<Integer, PojoPathParam>
private int
private int
private int
private int
private int
private int
private final Method
m

private long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Set<MessageHandler>
getMessageHandlers(Object pojo, Map<String, String> pathParameters, Session session, EndpointConfig config)

private boolean
private boolean
private boolean
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

decoderMatchback to summary
private Util.DecoderMatch decoderMatch
indexBooleanback to summary
private int indexBoolean
indexByteArrayback to summary
private int indexByteArray
indexByteBufferback to summary
private int indexByteBuffer
indexInputStreamback to summary
private int indexInputStream
indexPathParamsback to summary
private Map<Integer, PojoPathParam> indexPathParams
indexPayloadback to summary
private int indexPayload
indexPongback to summary
private int indexPong
indexPrimitiveback to summary
private int indexPrimitive
indexReaderback to summary
private int indexReader
indexSessionback to summary
private int indexSession
indexStringback to summary
private int indexString
mback to summary
private final Method m
maxMessageSizeback to summary
private long maxMessageSize

Constructor Detail

MessageHandlerInfoback to summary
pack-priv MessageHandlerInfo(Method m, List<DecoderEntry> decoderEntries) throws DeploymentException

Method Detail

getMessageHandlersback to summary
public Set<MessageHandler> getMessageHandlers(Object pojo, Map<String, String> pathParameters, Session session, EndpointConfig config)
isBinaryback to summary
private boolean isBinary()
isPongback to summary
private boolean isPong()
isTextback to summary
private boolean isText()
targetsSameWebSocketMessageTypeback to summary
public boolean targetsSameWebSocketMessageType(PojoMethodMapping.MessageHandlerInfo otherHandler)
org.apache.tomcat.websocket.pojo back to summary

private final Enum PojoMethodMapping.MethodType

extends Enum<PojoMethodMapping.MethodType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final PojoMethodMapping.MethodType
public static final PojoMethodMapping.MethodType
public static final PojoMethodMapping.MethodType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static PojoMethodMapping.MethodType
public static PojoMethodMapping.MethodType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ON_CLOSEback to summary
public static final PojoMethodMapping.MethodType ON_CLOSE
ON_ERRORback to summary
public static final PojoMethodMapping.MethodType ON_ERROR
ON_OPENback to summary
public static final PojoMethodMapping.MethodType ON_OPEN

Constructor Detail

MethodTypeback to summary
private MethodType()

Method Detail

valueOfback to summary
public static PojoMethodMapping.MethodType valueOf(String name)
valuesback to summary
public static PojoMethodMapping.MethodType[] values()