@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.
Modifier and Type | Required Element | Description |
---|---|---|
java.lang.String |
value |
Copyright © 2008–2017 The CometD Project. All rights reserved.