|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface specifies the methods for a connector to allow a listener to receive notifications from a remote MBean in an agent.
To forward a notification from the agent to the connector client, the user can configure the connector to use either push or pull mode.
Field Summary | |
static int |
DISCARD_NEW
This constant controls the cache behavior for notification forwarding. |
static int |
DISCARD_OLD
This constant controls the cache behavior for notification forwarding. |
static int |
NO_CACHE_LIMIT
This constant controls the cache behavior for notification forwarding. |
static int |
PULL_MODE
This constant is used to set the pull mode for notification forwarding. |
static int |
PUSH_MODE
This constant is used to set the push mode for notification forwarding. |
Method Summary | |
void |
clearCache()
Clear the notification cache. |
int |
getCacheSize()
Gets the cache size of notifications waiting to be forwarded. |
int |
getMode()
Gets the notification forwarding mode. |
void |
getNotifications()
Retrieves all notifications in the cache. |
int |
getOverflowCount()
Gets the number of notifications discarded because the cache limit has been reached. |
int |
getOverflowMode()
Returns whether to discard the oldest message ( DISCARD_OLD ) or the
the newest meesage (DISCARD_NEW ), if the cache size excceds. |
int |
getPeriod()
Gets the period for notification forwarding in milliseconds. |
int |
setCacheSize(int size,
boolean discardOverflow)
Sets the cache size of notifications waiting to be forwarded. |
void |
setMode(int mode)
Sets the notification forwarding mode. |
void |
setOverflowCount(int count)
Sets the number of notifications discarded, this number indicates the number of notifications discarded because the cache limit has been reached. |
void |
setOverflowMode(int of)
Specifes whether to discard the oldest message ( DISCARD_OLD ) or the
the newest message (DISCARD_NEW ), if the cache size excceds. |
void |
setPeriod(int period)
Specifies the period for notification forwarding in milliseconds. |
Methods inherited from interface com.sun.jdmk.NotificationRegistration |
addNotificationListener, removeNotificationListener |
Field Detail |
public static final int PUSH_MODE
public static final int PULL_MODE
public static final int DISCARD_OLD
public static final int DISCARD_NEW
public static final int NO_CACHE_LIMIT
Method Detail |
public void setMode(int mode) throws IllegalArgumentException
PUSH_MODE
, it is the agent to push notifications to the client, if set to
PULL_MODE
, it is the client to retrive notifications from the agent.
The default value is PUSH_MODE
.
mode
- set to PUSH_MODE
or PULL_MODE
.
IllegalArgumentException
- Thrown if the mode is not equal to
PUSH_MODE
nor PULL_MODE
.public int getMode()
PUSH_MODE
, it is the agent to push notifications to the client, if set to
PULL_MODE
, it is the client to retrive notifications from the agent.
The default value is PUSH_MODE
.
public void getNotifications()
public void clearCache()
public void setPeriod(int period)
If set to equal to or less than zero and the pull mode is used, no pull will be done. A user should
explicitly call getNotifications
to retrieve all notifications in the cache.
This method has no effect in the push mode in the current implementation.
The default value is 1000 milliseconds.
period
- The period in milliseconds.public int getPeriod()
The default value is 1000 milliseconds.
public int setCacheSize(int size, boolean discardOverflow)
If set to NO_CACHE_LIMIT
, notifications will never be discarded,
but this may lead to OutOfMemory errors under stressed conditions. If set to zero, any
notification will be discarded without being sent.
The default value is NO_CACHE_LIMIT
.
size
- the maximum number of notifications in the cache.discardOverflow
- effective only if current number of cached notifications exceeds the new size:
if true, discard excess notifications; if false, the cache size will not be changed.
public int getCacheSize()
If set to NO_CACHE_LIMIT
, notifications will never be discarded,
but this may lead to OutOfMemory errors under stressed conditions.
The default value is NO_CACHE_LIMIT
.
public void setOverflowCount(int count)
This count will be reset to zero if no more listener exists at the client side, because in this case the notification server will remove all information about this notification client.
count
- The new value to set to overflow count.public int getOverflowCount()
This count will be reset to zero if no more listener exists at the client side, because in this case the notification server will remove all information about this notification client.
public void setOverflowMode(int of) throws IllegalArgumentException
DISCARD_OLD
) or the
the newest message (DISCARD_NEW
), if the cache size excceds.
The default mode is DISCARD_OLD
.
of
- The mode to specify.
IllegalArgumentException
- Thrown if the mode is not DISCARD_NEW
nor DISCARD_OLD
.public int getOverflowMode()
DISCARD_OLD
) or the
the newest meesage (DISCARD_NEW
), if the cache size excceds.
The default mode is DISCARD_OLD
.
|
JMX 1.2_8 2002.10.31_20:03:55_MET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |