Top Description Methods
org.glassfish.tyrus.core

public @Interface MaxSessions

extends Annotation
Annotations
@Retention:RUNTIME
@Target:TYPE
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

This annotation may be used to annotate server endpoints as a optional annotation to jakarta.websocket.server.ServerEndpoint. When number of maximal open sessions is exceeded every new attempt to open session is closed with jakarta.websocket.CloseReason.CloseCodes#TRY_AGAIN_LATER. If value less then 1 is specified, no limit will be applied. Annotation example:

@MaxSessions(100)
@ServerEndpoint("/limited-resources")
public class LimitedEndpoint {
}

Maximal number of open sessions can be also specified programmatically using org.glassfish.tyrus.core.TyrusServerEndpointConfig.Builder#maxSessions(int).

Author
Ondrej Kosatka

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

maximal number of open sessions.
value
()

Maximal number of open sessions.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public int value()

Maximal number of open sessions.

Returns:int

maximal number of open sessions.