public interface NotificationFactory
限定符和类型 | 方法和说明 |
---|---|
void |
enableSend(boolean enable)
启用/停用通知发送,启用时send才能发送出notification,否则所有的通知都不能发送。
|
java.lang.String |
getClusterId()
取得当前所在集群的标识。
|
java.lang.String |
getClusterIndex()
取得当前节点在集群中的索引。
|
java.lang.String |
getLocalAddress()
取得当前节点的信息。
|
boolean |
isEnabled()
是否启用集群。
|
boolean |
isSendEnabled()
取得通知发送是否启用。
|
void |
register(NotificationListener listener)
注册通知监听。
|
void |
register(NotificationType type,
NotificationListener listener)
注册通知监听。
|
void |
send(Notification notification)
发送通知。
|
void |
send(Notification notification,
boolean force)
发送通知。
|
void |
send(NotificationType type,
java.lang.Object content)
发送通知。
|
void |
send(NotificationType type,
java.lang.Object content,
boolean force)
发送通知。
|
void |
stop() |
void enableSend(boolean enable)
enable
- 为true时启用,否则停用。boolean isSendEnabled()
void send(Notification notification)
notification
- 通知void send(Notification notification, boolean force)
notification
- 通知force
- 强制发送,为true时即使是在监听器响应中调用的通知也将发出。void send(NotificationType type, java.lang.Object content)
type
- 通知类型。content
- 通知传递的对象。void send(NotificationType type, java.lang.Object content, boolean force)
type
- 通知类型。content
- 通知传递的对象。force
- 强制发送,为true时即使是在监听器响应中调用的通知也将发出。void register(NotificationType type, NotificationListener listener)
type
- 通知类型。listener
- 通知监听器。void register(NotificationListener listener)
listener
- 通知监听器。boolean isEnabled()
true
,否则返回false
。java.lang.String getClusterId()
java.lang.String getClusterIndex()
java.lang.String getLocalAddress()
void stop()