|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.Adaptee org.norther.tammi.core.base.DefaultRegistry<K,V>
K
- the registry key type.V
- the registered MBean type.public class DefaultRegistry<K,V>
A default implementation of Registry.
Field Summary |
---|
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Constructor Summary | |
---|---|
|
DefaultRegistry()
Constructs a new registry MBean. |
|
DefaultRegistry(String ifname)
Constructs a new registry MBean with a named interface. |
protected |
DefaultRegistry(String ifname,
int capacity)
Constructs a new registry MBean with a named interface and initial capacity. |
Method Summary | |
---|---|
protected int |
addRegistryKeys(String ifname,
ObjectName name,
int limit,
Collection<K> result)
Adds specified registry keys into a collection. |
void |
clear()
Clears all MBeans from this registry. |
boolean |
containsKey(Object key)
Checks whether the specified key is registered in this registry. |
V |
get(Object key)
Gets the referent of the MBean in this registry. |
MBeanReference<V> |
getMBean(Object key)
Gets a reference to the MBean in this registry. |
protected MBeanHandle<V> |
getMBeanHandle(Object key)
Gets a reference to a mapped MBean. |
protected ConcurrentMap<K,MBeanHandle<V>> |
getMBeanHandles()
Gets a map of MBean references. |
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<ObjectName> |
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. |
K |
getRegistryKey(ObjectName name)
Gets the key of a named MBean in this registry. |
K |
getRegistryKey(String ifname)
Gets the key of an MBean of a specific class in this registry. |
K |
getRegistryKey(String ifname,
ObjectName name)
Gets the key of a named MBean of a specific class in this registry. |
Set<K> |
registryKeySet()
Returns a read-only set of all registered keys. |
Set<K> |
registryKeySet(ObjectName name)
Returns a set of registered keys a named MBean in this registry. |
Set<K> |
registryKeySet(String ifname)
Returns a set of registered keys of MBeans of a specific class in this registry. |
Set<K> |
registryKeySet(String ifname,
ObjectName name)
Returns a set of registered keys of a named MBean of a specific class in this registry. |
Map<K,ObjectName> |
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(K key,
String ifname)
Sets the interface of a registry MBean. |
void |
setQueryPattern(K key,
ObjectName name)
Sets the query pattern of a registry MBean. |
void |
setQueryPattern(K key,
String ifname,
ObjectName name)
Sets the interface and query pattern of a registry MBean. |
Methods inherited from class org.norther.tammi.core.base.Adaptee |
---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultRegistry()
public DefaultRegistry(String ifname)
ifname
- the name of the interface.protected DefaultRegistry(String ifname, int capacity)
ifname
- the name of the interface.capacity
- the initial capacity.Method Detail |
---|
public String getMBeanInterface()
Registry
getMBeanInterface
in interface Registry<K,V>
public ObjectName getQueryPattern(Object key)
Registry
getQueryPattern
in interface Registry<K,V>
key
- the registry key.
public void setQueryPattern(K key, ObjectName name)
Registry
setQueryPattern
in interface Registry<K,V>
key
- the registry key.name
- the object name or a query pattern.public void setQueryPattern(K key, String ifname, ObjectName name)
Registry
setQueryPattern
in interface Registry<K,V>
key
- the registry key.ifname
- the class or interface name.name
- the object name or a query pattern.public String getMBeanInterface(Object key)
Registry
getMBeanInterface
in interface Registry<K,V>
key
- the registry key.
public void setMBeanInterface(K key, String ifname)
Registry
setMBeanInterface
in interface Registry<K,V>
key
- the registry key.ifname
- the class or interface name.public boolean containsKey(Object key)
Registry
containsKey
in interface Registry<K,V>
key
- the key to check.
public V get(Object key)
Registry
get
in interface Registry<K,V>
key
- the registry key.
public MBeanReference<V> getMBean(Object key)
Registry
getMBean
in interface Registry<K,V>
key
- the registry key.
public ObjectName getObjectName(Object key)
Registry
getObjectName
in interface Registry<K,V>
key
- the registry key.
public Set<ObjectName> getObjectNames(Object key)
Registry
getObjectNames
in interface Registry<K,V>
key
- the registry key.
public K getRegistryKey(String ifname)
Registry
getRegistryKey
in interface Registry<K,V>
ifname
- the class or interface name.
public K getRegistryKey(ObjectName name)
Registry
getRegistryKey
in interface Registry<K,V>
name
- the object name or query pattern.
public K getRegistryKey(String ifname, ObjectName name)
Registry
getRegistryKey
in interface Registry<K,V>
ifname
- the class or interface name.name
- the object name or query pattern.
public int registrySize()
Registry
registrySize
in interface Registry<K,V>
public Set<K> registryKeySet(String ifname)
Registry
registryKeySet
in interface Registry<K,V>
ifname
- the class or interface name.
public Set<K> registryKeySet(ObjectName name)
Registry
registryKeySet
in interface Registry<K,V>
name
- the object name or query pattern.
public Set<K> registryKeySet(String ifname, ObjectName name)
Registry
registryKeySet
in interface Registry<K,V>
ifname
- the class or interface name.name
- the object name or query pattern.
public Set<K> registryKeySet()
Registry
registryKeySet
in interface Registry<K,V>
public void remove(Object key)
Registry
remove
in interface Registry<K,V>
key
- the registry key.public void clear()
Registry
clear
in interface Registry<K,V>
public Map<K,ObjectName> registryMap()
Registry
registryMap
in interface Registry<K,V>
protected int addRegistryKeys(String ifname, ObjectName name, int limit, Collection<K> result)
ifname
- the specified interface.name
- the specified object name.limit
- the limit for keys (-1 = no limit).result
- the result collection.
protected MBeanHandle<V> getMBeanHandle(Object key)
Note that the reference is meant for internal use only.
key
- the key to the MBean.
protected ConcurrentMap<K,MBeanHandle<V>> getMBeanHandles()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |