Package org.cometd.annotation
Annotation Type Param
-
@Target(PARAMETER) @Retention(RUNTIME) @Documented public @interface Param
For methods annotated with
Listener
orSubscription
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
orSubscription
annotation must be the same defined by theParam
annotation.
-
-
Element Detail
-
value
String value
- Returns:
- the variable name that identifies the parameter annotated with this annotation
-
-