public final class ServletWebActors extends Object
Static methods to attach web actors with HTTP and WebSocket sessions
Modifier and Type | Method and Description |
---|---|
static <T> ActorRef<T> |
attachWebActor(HttpSession session,
ActorRef<T> actor)
Attaches the given web actor to the given
HttpSession . |
static <T> ActorRef<T> |
attachWebActor(ServletContext sc,
Collection<String> webSocketURIs,
ActorRef<T> actor)
Attaches the given web actor to web socket sessions that will be opened at the given URIs (or URI patterns).
|
static <T> ActorRef<T> |
attachWebActor(ServletContext sc,
String webSocketURI,
ActorRef<T> actor)
Attaches the given web actor to web socket sessions that will be opened at the given URI (or URI pattern).
|
static <T> ActorRef<T> |
attachWebActor(Session session,
EndpointConfig config,
ActorRef<T> actor)
Attaches the given web actor to the given WebSocket session
|
static <T> ActorRef<T> |
attachWebActor(Session session,
HttpSession httpSession,
ActorRef<T> actor)
Attaches the given web actor to the given WebSocket session
|
static ActorRef<? super HttpRequest> |
getWebActor(HttpSession session)
Returns the web actor attached to the given
HttpSession . |
static boolean |
isWebActorAttached(HttpSession session)
Checks whether a web actor is attached to an
HttpSession . |
public static <T> ActorRef<T> attachWebActor(HttpSession session, ActorRef<T> actor)
Attaches the given web actor to the given HttpSession
.
session
- the sessionactor
- the web actoractor
public static boolean isWebActorAttached(HttpSession session)
Checks whether a web actor is attached to an HttpSession
.
public static ActorRef<? super HttpRequest> getWebActor(HttpSession session)
Returns the web actor attached to the given HttpSession
.
session
- the sessionnull
if none.public static <T> ActorRef<T> attachWebActor(Session session, HttpSession httpSession, ActorRef<T> actor)
Attaches the given web actor to the given WebSocket session
session
- the WebSocket Session
httpSession
- the WebSocket’s associated HTTP sessionactor
- the web actoractor
public static <T> ActorRef<T> attachWebActor(Session session, EndpointConfig config, ActorRef<T> actor)
Attaches the given web actor to the given WebSocket session
session
- the WebSocket Session
config
- the WebSocket endpoint’s configurationactor
- the web actoractor
public static <T> ActorRef<T> attachWebActor(ServletContext sc, String webSocketURI, ActorRef<T> actor)
Attaches the given web actor to web socket sessions that will be opened at the given URI (or URI pattern). This method installs a new WebSocket Endpoint
.
sc
- the ServletContext
webSocketURI
- the WebSocket’s URI (or URI pattern)actor
- the web actoractor
public static <T> ActorRef<T> attachWebActor(ServletContext sc, Collection<String> webSocketURIs, ActorRef<T> actor)
Attaches the given web actor to web socket sessions that will be opened at the given URIs (or URI patterns). This method installs new WebSocket Endpoint
s.
sc
- the ServletContext
webSocketURIs
- the WebSockets’ URI (or URI pattern)actor
- the web actoractor