public interface AppStateMonitor
NodeState provides information about the current state of a member
of the replication group. The application can obtain NodeState via
ReplicationGroupAdmin.getNodeState(com.sleepycat.je.rep.ReplicationNode, int) or
DbPing.getNodeState(). A NodeState contains mostly
JE-centric information, such as whether the node is a master or
replica. However, it may be important to add in some application specific
information to enable the best use of the status.
For example, an application may want to direct operations to specific nodes
based on whether the node is available. The fields in
tell the application whether the node is up and available in a JE HA sense,
but the application may also need information about an application level
resource, which would affect the load balancing decision. The AppStateMonitor
is a way for the application to inject this kind of application specific
information into the replicated node status.
The AppStateMonitor is registered with the replicated environment using
There is at most one AppStateMonitor associated with the actual environment
Environment handle) at any given time. JE
getAppState() when it is assembling status
information for a given node.
getAppState() returns a byte array whose length
should be larger than 0. An IllegalStateException will be thrown if the
returned byte array is 0 size. Users are responsible for serializing and
deserializing the desired information into this byte array.
|Modifier and Type||Method and Description|
Return a byte array which holds information about the application's state.
Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.