public class WebsocketPushContext extends Object implements jakarta.faces.push.PushContext
This is a concrete implementation of PushContext interface which is to be injected by
@Push.
Push,
Serialized Form| Constructor and Description |
|---|
WebsocketPushContext(String channel,
WebsocketSessionManager socketSessions,
WebsocketUserManager socketUsers)
Creates a socket push context whereby the mutable map of session and view scope channel identifiers is referenced, so
it's still available when another thread invokes
send(Object) during which the session and view scope is not
necessarily active anymore. |
| Modifier and Type | Method and Description |
|---|---|
Set<Future<Void>> |
send(Object message)
Send given message object to the push socket channel as identified by
@Push. |
<S extends Serializable> |
send(Object message,
Collection<S> users)
Send given message object to the push socket channel as identified by
@Push, targeted to the
given users as identified by <f:websocket user>. |
<S extends Serializable> |
send(Object message,
S user)
Send given message object to the push socket channel as identified by
@Push, targeted to the
given user as identified by <f:websocket user>. |
public WebsocketPushContext(String channel, WebsocketSessionManager socketSessions, WebsocketUserManager socketUsers)
send(Object) during which the session and view scope is not
necessarily active anymore.public Set<Future<Void>> send(Object message)
jakarta.faces.push.PushContext@Push. The message
object will be encoded as JSON and be available as first argument of the JavaScript listener function declared in
<f:websocket onmessage>.send in interface jakarta.faces.push.PushContextmessage - The push message object.null on Future.get() if
the message was successfully delivered and otherwise throw ExecutionException.RemoteEndpoint.Async.sendText(String)public <S extends Serializable> Set<Future<Void>> send(Object message, S user)
jakarta.faces.push.PushContext@Push, targeted to the
given user as identified by <f:websocket user>. The message object will be encoded as JSON and be
available as first argument of the JavaScript listener function declared in
<f:websocket onmessage>.send in interface jakarta.faces.push.PushContextS - The generic type of the user identifier.message - The push message object.user - The user to which the push message object must be delivered to.null on
Future.get() if the message was successfully delivered and otherwise throw ExecutionException.RemoteEndpoint.Async.sendText(String)public <S extends Serializable> Map<S,Set<Future<Void>>> send(Object message, Collection<S> users)
jakarta.faces.push.PushContext@Push, targeted to the
given users as identified by <f:websocket user>. The message object will be encoded as JSON and be
available as first argument of the JavaScript listener function declared in
<f:websocket onmessage>.send in interface jakarta.faces.push.PushContextS - The generic type of the user identifier.message - The push message object.users - The users to which the push message object must be delivered to.null on
Future.get() if the message was successfully delivered and otherwise throw ExecutionException.RemoteEndpoint.Async.sendText(String)Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.