|Modifier and Type||Method and Description|
Send one Notification asynchronously.
Subscribe to the notification received on the
notificationReceived, publish, subscribe
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected void startUp() throws Exception
protected void shutDown() throws Exception
public <N> com.google.common.util.concurrent.ListenableFuture<N> publish(NotificationFeedId feed, N notification, Type notificationType) throws NotificationException
notificationTypeis used to serialize the notification passed to the Notification system.
N- Type of the notification to send
NotificationFeedIdwhere to publish the notification
notification- notification object to send
notificationType- type to use to serialize the notification in the Notification system
ListenableFuturedescribing the state of the async send operation
NotificationFeedException- in case of any error regarding the
NotificationException- in case of any error when publishing the notification
public <N> org.apache.twill.common.Cancellable subscribe(NotificationFeedId feed, NotificationHandler<N> handler, Executor executor) throws NotificationFeedNotFoundException, NotificationFeedException
feed, and handle the notifications with the
handler. Before this call is made, the
feedhas to be created using the
NotificationFeedManager. Multiple subscriptions to a same feed with different handlers are possible.
N- Type of the notifications
NotificationFeedIdto subscribe to
NotificationHandlerthat will handle the notifications coming from the feed
Executorto use to perform the polling/pushing of notifications from the Notification system, and to call the
Cancellablefor cancelling Notification consumption
NotificationFeedNotFoundException- if the feed does not exist, according to the
NotificationFeedException- in case of any other error concerning the feed
Copyright © 2018 Cask Data, Inc.. All rights reserved.