Interface PushNotificationListener<T>
- Type Parameters:
T
- The type of the message.
- All Known Implementing Classes:
AbstractPushNotificationListener
,ClientTagSubscriptionManager.ValueUpdateListener
,ScriptMessageReceiver
,ScriptModuleChangeListener
public interface PushNotificationListener<T>
A listener for "push notifications" (out of band events broadcast from the gateway).
-
Method Summary
Modifier and TypeMethodDescriptionThe message type this instance should be registered to.moduleId()
The module id this instance should be registered to.static <U> PushNotificationListener<U>
Creates a new PushNotificationListener that invokes the provided listener on theEDT
.void
receiveNotification
(T notification) A callback to be invoked when a notification is received.
-
Method Details
-
moduleId
String moduleId()The module id this instance should be registered to.- Returns:
- The module id.
-
messageType
String messageType()The message type this instance should be registered to.- Returns:
- The message type.
-
receiveNotification
A callback to be invoked when a notification is received. Will be run on a queue owned by the local scope'sGatewayConnection
instance.- Parameters:
notification
- The notification.
-
of
static <U> PushNotificationListener<U> of(String moduleId, String messageType, Consumer<U> listener) Creates a new PushNotificationListener that invokes the provided listener on theEDT
.- Type Parameters:
U
- The type of the message.- Parameters:
moduleId
- The module id to listen to.messageType
- The message type to listen to.listener
- The listener to invoke when a notification is received.- Returns:
- A new PushNotificationListener that will only accept notifications of the given type.
- See Also:
-