org.norther.tammi.core.base
Interface Registry

All Known Implementing Classes:
DefaultRegistry

public interface Registry

An interface to registries.

Author:
Ilkka Priha

Method Summary
 void clear()
          Clears all MBeans from this registry.
 boolean containsKey(Object key)
          Checks whether the specified key is registered in this registry.
 Object get(Object key)
          Gets the referent of the MBean in this registry.
 MBeanReference getMBean(Object key)
          Gets a reference to the MBean in this registry.
 String getMBeanInterface()
          Gets the interface of MBeans in this registry.
 String getMBeanInterface(Object key)
          Gets the interface of a registry MBean.
 ObjectName getObjectName(Object key)
          Gets the object name of the MBean in this registry, which is also registered in the MBean server.
 Set getObjectNames(Object key)
          Gets a set of object names registered in the MBean server with names matching the query pattern of the MBean in this registry.
 ObjectName getQueryPattern(Object key)
          Gets the query pattern, with which the MBean is registered in this registry.
 Object getRegistryKey(ObjectName name)
          Gets the key of a named MBean in this registry.
 Object getRegistryKey(String ifname)
          Gets the key of an MBean of a specific class in this registry.
 Object getRegistryKey(String ifname, ObjectName name)
          Gets the key of a named MBean of a specific class in this registry.
 Set registryKeySet()
          Returns a read-only set of all registered keys.
 Set registryKeySet(ObjectName name)
          Returns a set of registered keys a named MBean in this registry.
 Set registryKeySet(String ifname)
          Returns a set of registered keys of MBeans of a specific class in this registry.
 Set registryKeySet(String ifname, ObjectName name)
          Returns a set of registered keys of a named MBean of a specific class in this registry.
 Map registryMap()
          Returns a map view to this registry.
 int registrySize()
          Gets the size of the registry.
 void remove(Object key)
          Removes an MBean from this registry.
 void setMBeanInterface(Object key, String ifname)
          Sets the interface of a registry MBean.
 void setQueryPattern(Object key, ObjectName name)
          Sets the query pattern of a registry MBean.
 void setQueryPattern(Object key, String ifname, ObjectName name)
          Sets the interface and query pattern of a registry MBean.
 

Method Detail

getMBeanInterface

String getMBeanInterface()
Gets the interface of MBeans in this registry.

Returns:
the MBean interface or null for any.

getQueryPattern

ObjectName getQueryPattern(Object key)
Gets the query pattern, with which the MBean is registered in this registry. The MBean registration is not checked from the MBean server.

Parameters:
key - the registry key.
Returns:
the pattern or null if not registered.

setQueryPattern

void setQueryPattern(Object key,
                     ObjectName name)
Sets the query pattern of a registry MBean.

Parameters:
key - the registry key.
name - the object name or a query pattern.
Throws:
NullPointerException - for null values.

setQueryPattern

void setQueryPattern(Object key,
                     String ifname,
                     ObjectName name)
Sets the interface and query pattern of a registry MBean. If the registry is already configured for a specific interface, the interface name must correspond to it.

Parameters:
key - the registry key.
ifname - the class or interface name.
name - the object name or a query pattern.
Throws:
NullPointerException - for null values.
IllegalArgumentException - if not accepted.

getMBeanInterface

String getMBeanInterface(Object key)
Gets the interface of a registry MBean.

Parameters:
key - the registry key.
Returns:
the class or interface name or null if not registered.

setMBeanInterface

void setMBeanInterface(Object key,
                       String ifname)
Sets the interface of a registry MBean. If the registry is already configured for a specific interface, the interface name must correspond to it.

Parameters:
key - the registry key.
ifname - the class or interface name.
Throws:
NullPointerException - for null values.
IllegalArgumentException - if not accepted.

containsKey

boolean containsKey(Object key)
Checks whether the specified key is registered in this registry.

Parameters:
key - the key to check.
Returns:
true if the key is registered, otherwise false.

get

Object get(Object key)
Gets the referent of the MBean in this registry.

Parameters:
key - the registry key.
Returns:
the referent or null.

getMBean

MBeanReference getMBean(Object key)
Gets a reference to the MBean in this registry.

Parameters:
key - the registry key.
Returns:
the reference or null.

getObjectName

ObjectName getObjectName(Object key)
Gets the object name of the MBean in this registry, which is also registered in the MBean server.

Parameters:
key - the registry key.
Returns:
the name or null if not in registered.

getObjectNames

Set getObjectNames(Object key)
Gets a set of object names registered in the MBean server with names matching the query pattern of the MBean in this registry.

Parameters:
key - the registry key.
Returns:
a set of object names or an empty set.

getRegistryKey

Object getRegistryKey(String ifname)
Gets the key of an MBean of a specific class in this registry.

Parameters:
ifname - the class or interface name.
Returns:
the registry key or null.

getRegistryKey

Object getRegistryKey(ObjectName name)
Gets the key of a named MBean in this registry.

Parameters:
name - the object name or query pattern.
Returns:
the registry key or null.

getRegistryKey

Object getRegistryKey(String ifname,
                      ObjectName name)
Gets the key of a named MBean of a specific class in this registry.

Parameters:
ifname - the class or interface name.
name - the object name or query pattern.
Returns:
the registry key or null.

registrySize

int registrySize()
Gets the size of the registry.

Returns:
the registry size.

registryKeySet

Set registryKeySet()
Returns a read-only set of all registered keys.

Returns:
a key set.

registryKeySet

Set registryKeySet(String ifname)
Returns a set of registered keys of MBeans of a specific class in this registry.

Parameters:
ifname - the class or interface name.
Returns:
the registry key set.

registryKeySet

Set registryKeySet(ObjectName name)
Returns a set of registered keys a named MBean in this registry.

Parameters:
name - the object name or query pattern.
Returns:
the registry key set.

registryKeySet

Set registryKeySet(String ifname,
                   ObjectName name)
Returns a set of registered keys of a named MBean of a specific class in this registry.

Parameters:
ifname - the class or interface name.
name - the object name or query pattern.
Returns:
the registry key set.

remove

void remove(Object key)
Removes an MBean from this registry.

Parameters:
key - the registry key.

clear

void clear()
Clears all MBeans from this registry.


registryMap

Map registryMap()
Returns a map view to this registry. The map is a clone of the transient state of the registry.

Returns:
a map of registered object names.


Copyright © 2004 The Norther Organization. All rights reserved.