Annotation Type Param


@Target(PARAMETER) @Retention(RUNTIME) @Documented public @interface Param

For methods annotated with Listener or Subscription whose value is a channel template such as /game/{gameId}, this annotation binds parameters of those methods with the value obtained matching the actual channel with the channel template.

For example:

 @Service
 public class GameService
 {
     @Listener("/game/{gameId}")
     public void handleGame(ServerSession remote, ServerMessage.Mutable message, @Param("gameId") String gameId)
     {
         // Use the 'gameId' parameter here.
     }
 }
 

The variable name defined in the Listener or Subscription annotation must be the same defined by the Param annotation.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      the variable name that identifies the parameter annotated with this annotation