com.sun.jdmk.comm
Interface ClientNotificationHandler

All Superinterfaces:
NotificationRegistration
All Known Subinterfaces:
RemoteMBeanServer
All Known Implementing Classes:
GenericHttpConnectorClient, HttpConnectorClient, HttpsConnectorClient, RmiConnectorClient

Deprecated. The JMX Remote API should be used in preference to the legacy Java DMK connectors. This interface may be removed in a future version of Java DMK. See JdmkLegacyConnector.

public interface ClientNotificationHandler
extends NotificationRegistration

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
          Deprecated. This constant controls the cache behavior for notification forwarding.
static int DISCARD_OLD
          Deprecated. This constant controls the cache behavior for notification forwarding.
static int NO_CACHE_LIMIT
          Deprecated. This constant controls the cache behavior for notification forwarding.
static int PULL_MODE
          Deprecated. This constant is used to set the pull mode for notification forwarding.
static int PUSH_MODE
          Deprecated. This constant is used to set the push mode for notification forwarding.
 
Method Summary
 void clearCache()
          Deprecated. Clear the notification cache.
 int getCacheSize()
          Deprecated. Gets the cache size of notifications waiting to be forwarded.
 int getMode()
          Deprecated. Gets the notification forwarding mode.
 void getNotifications()
          Deprecated. Retrieves all notifications in the cache.
 int getOverflowCount()
          Deprecated. Gets the number of notifications discarded because the cache limit has been reached.
 int getOverflowMode()
          Deprecated. Returns whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.
 int getPeriod()
          Deprecated. Gets the period for notification forwarding in milliseconds.
 int setCacheSize(int size, boolean discardOverflow)
          Deprecated. Sets the cache size of notifications waiting to be forwarded.
 void setMode(int mode)
          Deprecated. Sets the notification forwarding mode.
 void setOverflowCount(int count)
          Deprecated. 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)
          Deprecated. Specifies whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.
 void setPeriod(int period)
          Deprecated. Specifies the period for notification forwarding in milliseconds.
 
Methods inherited from interface com.sun.jdmk.NotificationRegistration
addNotificationListener, removeNotificationListener
 

Field Detail

PUSH_MODE

static final int PUSH_MODE
Deprecated. 
This constant is used to set the push mode for notification forwarding.

See Also:
Constant Field Values

PULL_MODE

static final int PULL_MODE
Deprecated. 
This constant is used to set the pull mode for notification forwarding.

See Also:
Constant Field Values

DISCARD_OLD

static final int DISCARD_OLD
Deprecated. 
This constant controls the cache behavior for notification forwarding. If the cache mode is set to this value and when the notification cache size is exceeded, the older messages will be discarded. This is default value for the cache behavior for notification forwarding.

See Also:
Constant Field Values

DISCARD_NEW

static final int DISCARD_NEW
Deprecated. 
This constant controls the cache behavior for notification forwarding. If the cache mode is set to this value and when the notification cache size is exceeded, the newer messages will be discarded.

See Also:
Constant Field Values

NO_CACHE_LIMIT

static final int NO_CACHE_LIMIT
Deprecated. 
This constant controls the cache behavior for notification forwarding. If the cache size is set to this value, there is no limitation of the notification cache size and notifications will never be discarded. This is default value for notification forwarding.

See Also:
Constant Field Values
Method Detail

setMode

void setMode(int mode)
             throws IllegalArgumentException
Deprecated. 
Sets the notification forwarding mode. If set to PUSH_MODE, it is the agent to push notifications to the client, if set to PULL_MODE, it is the client to retrieve notifications from the agent.

The default value is PUSH_MODE.

Parameters:
mode - set to PUSH_MODE or PULL_MODE.
Throws:
IllegalArgumentException - Thrown if the mode is not equal to PUSH_MODE nor PULL_MODE.

getMode

int getMode()
Deprecated. 
Gets the notification forwarding mode. If set to PUSH_MODE, it is the agent to push notifications to the client, if set to PULL_MODE, it is the client to retrieve notifications from the agent.

The default value is PUSH_MODE.


getNotifications

void getNotifications()
Deprecated. 
Retrieves all notifications in the cache.


clearCache

void clearCache()
Deprecated. 
Clear the notification cache. All notifications stored in the cache then will be discarded without being sent.


setPeriod

void setPeriod(int period)
Deprecated. 
Specifies the period for notification forwarding in milliseconds.

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.

Parameters:
period - The period in milliseconds.

getPeriod

int getPeriod()
Deprecated. 
Gets the period for notification forwarding in milliseconds.

The default value is 1000 milliseconds.


setCacheSize

int setCacheSize(int size,
                 boolean discardOverflow)
Deprecated. 
Sets the cache size of notifications waiting to be forwarded.

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.

Parameters:
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.
Returns:
The cache size currently set.

getCacheSize

int getCacheSize()
Deprecated. 
Gets the cache size of notifications waiting to be forwarded.

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.


setOverflowCount

void setOverflowCount(int count)
Deprecated. 
Sets the number of notifications discarded, this number indicates the number of notifications discarded because the cache limit has been reached.

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.

Parameters:
count - The new value to set to overflow count.

getOverflowCount

int getOverflowCount()
Deprecated. 
Gets the number of notifications discarded because the cache limit has been reached. This value can be reset by calling the method setOverFlowCount.

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.


setOverflowMode

void setOverflowMode(int of)
                     throws IllegalArgumentException
Deprecated. 
Specifies whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.

The default mode is DISCARD_OLD.

Parameters:
of - The mode to specify.
Throws:
IllegalArgumentException - Thrown if the mode is not DISCARD_NEW nor DISCARD_OLD.

getOverflowMode

int getOverflowMode()
Deprecated. 
Returns whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.

The default mode is DISCARD_OLD.


Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.