org.norther.tammi.core.base
Interface Container<V>

Type Parameters:
V - the registered MBean type.
All Known Subinterfaces:
BranchFilter<F>, Broker, ContainerFilter<V>, ContainerKeyFilter<V>, ContextToolFilter, Converter, Factory, HostFilter<F>, LayoutFilter, LinkFilter<F>, MediaContentFilter<M>, MediaContentKeyFilter<M>, PageFilter, PipeFilter<F>, SecureContainer<V>, SecureContainerFilter<V>, SecureContainerKeyFilter<V>, ServiceFilter<F>
All Known Implementing Classes:
AbstractMediaContentKeyFilter, DefaultBranchFilter, DefaultBroker, DefaultContainer, DefaultContainerFilter, DefaultContainerKeyFilter, DefaultContextToolFilter, DefaultConverter, DefaultFactory, DefaultHostFilter, DefaultLayoutFilter, DefaultLinkFilter, DefaultMediaContentFilter, DefaultMediaContentKeyFilter, DefaultPageFilter, DefaultPipeFilter, DefaultSecureContainer, DefaultSecureContainerFilter, DefaultSecureContainerKeyFilter, DefaultServiceFilter

public interface Container<V>

An interface to MBean registries accepting only strings as registry keys.

Version:
$Id: Container.java,v 1.9 2009/09/28 15:08:42 cvsimp Exp $
Author:
Ilkka Priha

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

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

setQueryPattern

void setQueryPattern(String key,
                     String ifname,
                     ObjectName name)
Sets the interface and object name 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 query pattern.
Throws:
NullPointerException - for null values.

getMBeanInterface

String getMBeanInterface(String 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(String 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(String 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

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

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

getMBean

MBeanReference<V> getMBean(String key)
Gets a reference to the MBean in this registry.

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

getObjectName

ObjectName getObjectName(String 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<ObjectName> getObjectNames(String 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.

getContainerKey

String getContainerKey(String ifname)
Gets the key of an MBean of a specific class in this container.

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

getContainerKey

String getContainerKey(ObjectName name)
Gets the key of a named MBean in this container.

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

getContainerKey

String getContainerKey(String ifname,
                       ObjectName name)
Gets the key of a named MBean of a specific class in this container.

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

registrySize

int registrySize()
Gets the size of the registry.

Returns:
the registry size.

registryKeySet

Set<String> registryKeySet()
Returns a read-only set of registered keys.

Returns:
a key set.

registryKeySet

Set<String> 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<String> registryKeySet(ObjectName name)
Returns a set of registered keys of a named MBean in this registry.

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

registryKeySet

Set<String> 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(String key)
Removes an MBean from this registry.

Parameters:
key - the registry key.

clear

void clear()
Clears all MBeans from this registry.


registryMap

Map<String,ObjectName> 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.