PojoMethodMapping (Apache Tomcat 10.1.55 API Documentation)
Description: declaration: package: org.apache.tomcat.websocket.pojo, class: PojoMethodMapping

# Class PojoMethodMapping

java.lang.Object
org.apache.tomcat.websocket.pojo.PojoMethodMapping

public class PojoMethodMapping extends Object
For a POJO class annotated with `ServerEndpoint`, an instance of this class creates and caches the method handler, method information and parameter information for the onXXX calls.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PojoMethodMapping(Class<?> clazzPojo, List<Class<? extends Decoder>> decoderClazzes, String wsPath, InstanceManager instanceManager)`
  Create a method mapping for the given POJO

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<MessageHandler>`
  `getMessageHandlers(Object pojo, Map<String,String> pathParameters, Session session, EndpointConfig config)`
  `Method`
  `getOnClose()`
  `Object[]`
  `getOnCloseArgs(Map<String,String> pathParameters, Session session, CloseReason closeReason)`
  `Method`
  `getOnError()`
  `Object[]`
  `getOnErrorArgs(Map<String,String> pathParameters, Session session, Throwable throwable)`
  `Method`
  `getOnOpen()`
  `Object[]`
  `getOnOpenArgs(Map<String,String> pathParameters, Session session, EndpointConfig config)`
  `String`
  `getWsPath()`
  `boolean`
  `hasMessageHandlers()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PojoMethodMapping

    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` - POJO implementation class
      `decoderClazzes` - Set of potential decoder classes
      `wsPath` - Path at which the endpoint will be deployed
      `instanceManager` - Instance manager to use to create Decoder instances
    Throws:
      `DeploymentException` - If the mapping cannot be completed

- ## Method Details

  - ### getWsPath

    public String getWsPath()

  - ### getOnOpen

    public Method getOnOpen()

  - ### getOnOpenArgs

    public Object[] getOnOpenArgs(Map<String,String> pathParameters, Session session, EndpointConfig config) throws DecodeException
    Throws:
      `DecodeException`

  - ### getOnClose

    public Method getOnClose()

  - ### getOnCloseArgs

    public Object[] getOnCloseArgs(Map<String,String> pathParameters, Session session, CloseReason closeReason) throws DecodeException
    Throws:
      `DecodeException`

  - ### getOnError

    public Method getOnError()

  - ### getOnErrorArgs

    public Object[] getOnErrorArgs(Map<String,String> pathParameters, Session session, Throwable throwable) throws DecodeException
    Throws:
      `DecodeException`

  - ### hasMessageHandlers

    public boolean hasMessageHandlers()

  - ### getMessageHandlers

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