com.jrockit.mc.rjmx.subscription
Interface ISubscriptionService


public interface ISubscriptionService

The service from which to create and destroy subscriptions

Author:
Marcus Hirt, Mattias Jo\xEBlson

Method Summary
 void addAttributeValueListener(AttributeDescriptor attributeDescriptor, IAttributeValueListener listener)
          Adds the attribute value listener to the subscription (possible creating it) on given descriptor.
 IAttributeSubscription getAttributeSubscription(AttributeDescriptor attributeDescriptor)
          Returns the subscription associated with the attribute, if such a subscription exists, or null if no such subscription exists.
 AttributeValueEvent getLastAttributeValueEvent(AttributeDescriptor attributeDescriptor)
          Returns the last value event for the given attribute through its subscription.
 boolean isAttributeUnavailable(AttributeDescriptor attributeDescriptor)
          Returns true if a subscription on the attribute has been attempted, but failed, false if either the attribute has not failed or never been subscribed to.
 void removeAttributeValueListener(AttributeDescriptor attributeDescriptor, IAttributeValueListener listener)
          Removes the listener from the subscription of given attribute, possible destroying the subscription if this was the last listener.
 void removeAttributeValueListener(IAttributeValueListener listener)
          Removes the listener from all its subscriptions, possible destroying some or all of the subscriptions if this was the last listener.
 void substituteAttributeValueListener(IAttributeValueListener oldListener, IAttributeValueListener newListener)
          Substitutes two listeners.
 

Method Detail

addAttributeValueListener

void addAttributeValueListener(AttributeDescriptor attributeDescriptor,
                               IAttributeValueListener listener)
Adds the attribute value listener to the subscription (possible creating it) on given descriptor.

Parameters:
attributeDescriptor - the attribute on which to listen to value changes.
listener - the attribute value listener to add.

substituteAttributeValueListener

void substituteAttributeValueListener(IAttributeValueListener oldListener,
                                      IAttributeValueListener newListener)
Substitutes two listeners. The new listener will subscribe to all subscriptions that the old listener had and the old listener will unsubscribe from them.

Parameters:
oldListener - the old listener to unsubscribe.
newListener - the new listener to subscribe instead.

removeAttributeValueListener

void removeAttributeValueListener(IAttributeValueListener listener)
Removes the listener from all its subscriptions, possible destroying some or all of the subscriptions if this was the last listener.

Parameters:
listener - the attribute value listener to remove.

removeAttributeValueListener

void removeAttributeValueListener(AttributeDescriptor attributeDescriptor,
                                  IAttributeValueListener listener)
Removes the listener from the subscription of given attribute, possible destroying the subscription if this was the last listener.

Parameters:
attributeDescriptor - the attribute on which to stop listen to value changes.
listener - the attribute value listener to remove.

getAttributeSubscription

IAttributeSubscription getAttributeSubscription(AttributeDescriptor attributeDescriptor)
Returns the subscription associated with the attribute, if such a subscription exists, or null if no such subscription exists.

Parameters:
attributeDescriptor - the descriptor of the attribute to retrieve.
Returns:
the subscription, if one already exists, or null if no subscription for the attribute could be found.

getLastAttributeValueEvent

AttributeValueEvent getLastAttributeValueEvent(AttributeDescriptor attributeDescriptor)
Returns the last value event for the given attribute through its subscription.

Parameters:
attributeDescriptor - the attribute for which to get the last value event.
Returns:
the last attribute value event logged through the subscription with given descriptor, returns null if subscription or no value event exists.

isAttributeUnavailable

boolean isAttributeUnavailable(AttributeDescriptor attributeDescriptor)
Returns true if a subscription on the attribute has been attempted, but failed, false if either the attribute has not failed or never been subscribed to.

Parameters:
attributeDescriptor - the attribute to check.
Returns:
true if a subscription on the attribute has been attempted, but failed, false if either the attribute has not failed or never been subscribed to.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.