org.glite.ce.commonj.axis.handlers
Class ConfigCache

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.glite.ce.commonj.axis.handlers.ConfigCache
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.util.Map, javax.management.NotificationFilter, javax.management.NotificationListener, java.io.Serializable

public class ConfigCache
extends java.util.Hashtable
implements javax.management.NotificationListener, javax.management.NotificationFilter

This class is a table of MBeans handling gJAF plugin. Every MBean inserted into or removed from this table is automatically registered into or unregistered from a given MBean server. It is able to read notifications issued by a JMX agent in order to keep updated the list of MBeans.

See Also:
Serialized Form

Constructor Summary
ConfigCache(javax.management.MBeanServer mbsrv)
          The constructor for this class.
 
Method Summary
 void clear()
          Method used to remove all items of the table.
 void handleNotification(javax.management.Notification notification, java.lang.Object handback)
          This method is called by a JMX agent in order to notify a generic event.
 boolean isNotificationEnabled(javax.management.Notification notification)
          Method used to filter notifications.
 java.util.Enumeration keys()
          This method returns an enumeration of plugin names
 java.lang.Object put(java.lang.Object k, java.lang.Object v)
          Method used to insert an item into the table.
 java.lang.Object remove(java.lang.Object k)
          This method removes an MBean from the table.
 java.lang.String[] toArray()
          This method returns an array of plugin names contained into this table
 
Methods inherited from class java.util.Hashtable
clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, rehash, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfigCache

public ConfigCache(javax.management.MBeanServer mbsrv)
The constructor for this class.

Parameters:
mbsrv - is the MBean server used for MBean registration/removal
Method Detail

clear

public void clear()
Method used to remove all items of the table. Each MBean is automatically removed from the MBean server

Specified by:
clear in interface java.util.Map

keys

public java.util.Enumeration keys()
This method returns an enumeration of plugin names

Returns:
an enumeration of plugin names

put

public java.lang.Object put(java.lang.Object k,
                            java.lang.Object v)
Method used to insert an item into the table. The MBean is automatically registered into the MBean server

Specified by:
put in interface java.util.Map
Parameters:
k - is the name of the plugin
v - is the MBean to insert into the table
Returns:
the previously inserted value for the given name, or null if such a value doesn't exist

remove

public java.lang.Object remove(java.lang.Object k)
This method removes an MBean from the table. The MBean is automatically unregistered from the MBean server

Specified by:
remove in interface java.util.Map
Parameters:
k - is the name of the plugin
Returns:
the previously inserted MBean

toArray

public java.lang.String[] toArray()
This method returns an array of plugin names contained into this table

Returns:
an array of plugin names contained into this table

handleNotification

public void handleNotification(javax.management.Notification notification,
                               java.lang.Object handback)
This method is called by a JMX agent in order to notify a generic event. The only notification handled by this method is JMX.mbean.unregistered issued by the engine whenever a MBean is unregistered. In this case, if the MBean unregistered is contained into this table, the item is removed from the cache.

Specified by:
handleNotification in interface javax.management.NotificationListener
Parameters:
notification - contains information about the event notified
handback - unused callback object

isNotificationEnabled

public boolean isNotificationEnabled(javax.management.Notification notification)
Method used to filter notifications.

Specified by:
isNotificationEnabled in interface javax.management.NotificationFilter
Parameters:
notification - contains information about the event notified
Returns:
true iff the MBean involved has a domain name equals to CEAuthZ, i.e. the domain for the authorization framework