org.norther.tammi.core.base
Class DefaultDomain

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.base.DefaultDomain
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Domain, Manageable, MBeanDelegate

public class DefaultDomain
extends Adaptee
implements Domain

A default implementation of Domain.

Version:
$Id: DefaultDomain.java,v 1.30 2009/10/29 21:39:57 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
protected static String MODEL_CONST_DESCRIPTION
          The model constructor description.
protected static String OBJECT_REFERENCE
          The object reference resource type.
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.core.base.Domain
ANY_DOMAIN, HPUX, LNX32, LNX64, MACOS, OS_ARCH_PROPERTY, OS_NAME_PROPERTY, OS_TYPE_PROPERTY, SUNOS, UNKNOWN, WIN32, WIN64
 
Constructor Summary
DefaultDomain()
          Constructs a new domain.
 
Method Summary
 ModelMBean adapt(Object object, String ifName)
          Adapts the specified object exposing the specified class or interface by applying the default model MBean and the domain MBean loader.
 ModelMBean adapt(Object object, String ifName, ObjectName loader)
          Adapts the specified object exposing the specified class or interface by applying the default model MBean and the named MBean loader.
 ModelMBean adapt(Object object, String ifName, ObjectName loader, MBeanServer server)
          Adapts the specified object exposing the specified class or interface by applying the named MBean loader in the given MBean server.
 ModelMBean adapt(Object object, String ifName, String modelName)
          Adapts the specified object exposing the specified class or interface by applying the specified model MBean and the domain MBean loader.
 ModelMBean adapt(Object object, String ifName, String modelName, ObjectName loader)
          Adapts the specified object exposing the specified class or interface by applying the specified model MBean and the named MBean loader.
 ModelMBean adapt(Object object, String ifName, String modelName, ObjectName loader, MBeanServer server)
          Adapts the specified object exposing the specified class or interface by applying the specified model MBean, the named MBean loader in the given MBean server.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName)
          Adapts a named MBean exposing the specified class or interface by applying the default model MBean and the domain MBean loader.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName, Object[] params, String[] signature)
          Adapts a named MBean exposing the specified class or interface with parameters by applying the default model MBean and the domain MBean loader.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName, ObjectName loader)
          Adapts a named MBean exposing the specified class or interface by applying the default model MBean and the named MBean loader.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName, ObjectName loader, Object[] params, String[] signature)
          Adapts a named MBean exposing the specified class or interface with parameters by applying the default model MBean and the named MBean loader.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName, String modelName)
          Adapts a named MBean exposing the specified class or interface by applying the specified model MBean and the domain MBean loader.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName, String modelName, Object[] params, String[] signature)
          Adapts a named MBean exposing the specified class or interface with parameters by applying the specified model MBean and the domain MBean loader.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName, String modelName, ObjectName loader)
          Adapts a named MBean exposing the specified class or interface by applying the specified model MBean and the named MBean loader.
 ObjectInstance adaptMBean(String className, ObjectName name, String ifName, String modelName, ObjectName loader, Object[] params, String[] signature)
          Adapts a named MBean exposing the specified class or interface with parameters by applying the specified model MBean and the named MBean loader.
 ObjectInstance createMBean(String className, ObjectName name)
          Creates a named MBean by applying the domain MBean loader.
 ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature)
          Creates a named MBean with parameters by applying the domain MBean loader.
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loader)
          Creates a named MBean by applying the named MBean loader.
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loader, Object[] params, String[] signature)
          Creates a named MBean with parameters by applying the named MBean loader.
 Broker getBroker()
          Gets the referent of the broker MBean.
 MBeanReference<Broker> getBrokerMBean()
          Gets a reference to the broker of this domain.
 ObjectName getBrokerName()
          Gets the broker of this domain.
 String getDefaultDomain()
          Gets the name with the default context of this domain.
 ObjectName getDefaultQuery()
          Gets a query to the default context of this domain.
 Domain getDomain()
          Gets the referent of the domain MBean.
 MBeanReference<Domain> getDomainMBean()
          Gets a reference to the domain MBean of this domain.
 String getDomainName()
          Gets the name without the context of this domain.
 String[] getDomainNames()
          Gets the domain names without the contexts of this domain.
 Factory getFactory()
          Gets the referent of the factory MBean.
 MBeanReference<Factory> getFactoryMBean()
          Gets a reference to the factory of this domain.
 ObjectName getFactoryName()
          Gets the the factory of this domain.
 Loader getLoader()
          Gets the referent of the loader MBean.
 MBeanReference<Loader> getLoaderMBean()
          Gets a reference to the loader MBean of this domain.
 ObjectName getLoaderName()
          Gets the loader of this domain.
 MBeanInfo getMBeanInfo(ObjectName name)
          Gets the MBean info the named MBean.
 String getModelMBeanClassName()
          Gets the model MBean class name.
 ObjectInstance getObjectInstance(ObjectName name)
          Gets the object instance the named MBean.
 ObjectName getObjectName(String name)
          Gets a string as an object name.
 ObjectName getObjectName(String domain, Hashtable<String,String> table)
          Gets a hashtable as an object name using the specified domain.
 ObjectName getObjectName(String domain, String key, String value)
          Gets a key property as an object name using the given domain.
 String getOSArch()
          Gets the OS architecture.
 String getOSName()
          Gets the OS name.
 String getOSType()
          Gets the OS type.
 String getProperty(String key)
          Gets the specified system property.
 String getProperty(String key, String def)
          Gets the specified system property with a default.
protected  void introspect(RequiredModelMBean model, Object adaptee, Class<?> clazz)
          Instrospects the public methods of the managed class.
 boolean isInstanceOf(ObjectName name, String className)
          Checks the class of the named MBean.
 boolean isRegistered(ObjectName name)
          Checks registration of the named MBean.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
 void premanaged(MBeanDelegate adapter)
          This method is called when the implementing adaptee is trying to be managed either during pre-registration of the corresponding adapter MBean or just before it is explicitly added to the adapter MBean during run-time.
 Properties properties()
          Gets the current map of system properties.
 Set<ObjectName> queryDefaultNames()
          Queries for a set of object names of MBeans in the default context of this domain.
 Set<ObjectName> queryDefaultNames(QueryExp exp)
          Queries for a set of object names of MBeans in the default context of this domain with a query expression.
 Set<ObjectName> queryDefaultNames(String className)
          Queries for a set of object names of MBeans in the default context of this domain of the specified class.
 Set<ObjectName> queryObjectNames()
          Queries for a set of object names of MBeans in any of the contexts of this domain.
 Set<ObjectName> queryObjectNames(QueryExp exp)
          Queries for a set of object names of MBeans in any of the contexts of this domain with a query expression.
 Set<ObjectName> queryObjectNames(String className)
          Queries for a set of object names of MBeans in any of the contexts of this domain of the specified class.
 ObjectInstance registerMBean(Object object, ObjectName name)
          Registers the named MBean.
 ObjectInstance registerMBean(Object object, ObjectName name, String ifName)
          Registers the named MBean exposing the specified class or interface by applying the default model MBean.
 ObjectInstance registerMBean(Object object, ObjectName name, String ifName, String modelName)
          Registers the named MBean exposing the specified class or interface by applying the specified model MBean.
 void setBrokerName(ObjectName broker)
          Sets the broker of this domain.
 void setFactoryName(ObjectName logger)
          Sets the factory of this domain.
 void setLoaderName(ObjectName loader)
          Sets the loader of this domain.
 void setModelMBeanClassName(String className)
          Sets the model MBean class name.
 void setProperty(String key, String value)
          Sets the specified system property.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 void unregisterMBean(ObjectName name)
          Unregisters the named MBean.
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getCanonicalName, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_REFERENCE

protected static final String OBJECT_REFERENCE
The object reference resource type.

See Also:
Constant Field Values

MODEL_CONST_DESCRIPTION

protected static final String MODEL_CONST_DESCRIPTION
The model constructor description.

See Also:
Constant Field Values
Constructor Detail

DefaultDomain

public DefaultDomain()
Constructs a new domain.

Method Detail

premanaged

public void premanaged(MBeanDelegate adapter)
                throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is trying to be managed either during pre-registration of the corresponding adapter MBean or just before it is explicitly added to the adapter MBean during run-time.

Specified by:
premanaged in interface Manageable
Overrides:
premanaged in class Adaptee
Parameters:
adapter - the managing adapter.
Throws:
Exception - if the adaptee refused to be managed.

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable
Overrides:
postmanaged in class Adaptee

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Overrides:
unmanaged in class Adaptee
Throws:
Exception - if the adaptee refused to be unmanaged.

getOSType

public String getOSType()
Description copied from interface: Domain
Gets the OS type.

Specified by:
getOSType in interface Domain
Returns:
the OS type.

getOSName

public String getOSName()
Description copied from interface: Domain
Gets the OS name.

Specified by:
getOSName in interface Domain
Returns:
the OS name.

getOSArch

public String getOSArch()
Description copied from interface: Domain
Gets the OS architecture.

Specified by:
getOSArch in interface Domain
Returns:
the OS architecture.

getDefaultDomain

public String getDefaultDomain()
Description copied from interface: Domain
Gets the name with the default context of this domain.

Specified by:
getDefaultDomain in interface Domain
Returns:
the default context.

getDomainName

public String getDomainName()
Description copied from interface: Domain
Gets the name without the context of this domain.

Specified by:
getDomainName in interface Domain
Returns:
the domain name.

getDomainNames

public String[] getDomainNames()
Description copied from interface: Domain
Gets the domain names without the contexts of this domain.

Specified by:
getDomainNames in interface Domain
Returns:
an array of domain names.

getDefaultQuery

public ObjectName getDefaultQuery()
Description copied from interface: Domain
Gets a query to the default context of this domain.

Specified by:
getDefaultQuery in interface Domain
Returns:
the default query.

queryDefaultNames

public Set<ObjectName> queryDefaultNames()
Description copied from interface: Domain
Queries for a set of object names of MBeans in the default context of this domain.

Specified by:
queryDefaultNames in interface Domain
Returns:
a set of found object names or an empty set.

queryDefaultNames

public Set<ObjectName> queryDefaultNames(QueryExp exp)
Description copied from interface: Domain
Queries for a set of object names of MBeans in the default context of this domain with a query expression.

Specified by:
queryDefaultNames in interface Domain
Parameters:
exp - an optional query expression.
Returns:
a set of found object names or an empty set.

queryDefaultNames

public Set<ObjectName> queryDefaultNames(String className)
Description copied from interface: Domain
Queries for a set of object names of MBeans in the default context of this domain of the specified class.

Specified by:
queryDefaultNames in interface Domain
Parameters:
className - a class or interface, null for any.
Returns:
a set of found object names or an empty set.

queryObjectNames

public Set<ObjectName> queryObjectNames()
Description copied from interface: Domain
Queries for a set of object names of MBeans in any of the contexts of this domain.

Specified by:
queryObjectNames in interface Domain
Returns:
a set of found object names or an empty set.

queryObjectNames

public Set<ObjectName> queryObjectNames(QueryExp exp)
Description copied from interface: Domain
Queries for a set of object names of MBeans in any of the contexts of this domain with a query expression.

Specified by:
queryObjectNames in interface Domain
Parameters:
exp - an optional query expression.
Returns:
a set of found object names or an empty set.

queryObjectNames

public Set<ObjectName> queryObjectNames(String className)
Description copied from interface: Domain
Queries for a set of object names of MBeans in any of the contexts of this domain of the specified class.

Specified by:
queryObjectNames in interface Domain
Parameters:
className - a class or interface, null for any.
Returns:
a set of found object names or an empty set.

getProperty

public String getProperty(String key)
Description copied from interface: Domain
Gets the specified system property.

Specified by:
getProperty in interface Domain
Parameters:
key - the key of the system property.
Returns:
the value of the system property or null.

getProperty

public String getProperty(String key,
                          String def)
Description copied from interface: Domain
Gets the specified system property with a default.

Specified by:
getProperty in interface Domain
Parameters:
key - the key of the system property.
def - the default value.
Returns:
the value of the system property or the default.

setProperty

public void setProperty(String key,
                        String value)
Description copied from interface: Domain
Sets the specified system property.

Specified by:
setProperty in interface Domain
Parameters:
key - the key of the system property.
value - the value of the system property.

properties

public Properties properties()
Description copied from interface: Domain
Gets the current map of system properties.

Specified by:
properties in interface Domain
Returns:
the map of system properties.

getModelMBeanClassName

public String getModelMBeanClassName()
Description copied from interface: Domain
Gets the model MBean class name.

Specified by:
getModelMBeanClassName in interface Domain
Returns:
the model MBean class name.

setModelMBeanClassName

public void setModelMBeanClassName(String className)
Description copied from interface: Domain
Sets the model MBean class name.

Specified by:
setModelMBeanClassName in interface Domain
Parameters:
className - the model MBean class name.

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName name)
                       throws RegistrationException
Description copied from interface: Domain
Gets the MBean info the named MBean.

Specified by:
getMBeanInfo in interface Domain
Parameters:
name - the object name of the MBean.
Returns:
the MBean info.
Throws:
RegistrationException - if not registered.

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName name)
                                 throws RegistrationException
Description copied from interface: Domain
Gets the object instance the named MBean.

Specified by:
getObjectInstance in interface Domain
Parameters:
name - the object name of the MBean.
Returns:
the MBean info.
Throws:
RegistrationException - if not registered.

isInstanceOf

public boolean isInstanceOf(ObjectName name,
                            String className)
                     throws RegistrationException
Description copied from interface: Domain
Checks the class of the named MBean.

Specified by:
isInstanceOf in interface Domain
Parameters:
name - the object name of the MBean.
className - the class name to check.
Returns:
true if registered, false otherwise.
Throws:
RegistrationException - if not registered.

adapt

public ModelMBean adapt(Object object,
                        String ifName)
                 throws ConstructionException,
                        AdaptationException
Description copied from interface: Domain
Adapts the specified object exposing the specified class or interface by applying the default model MBean and the domain MBean loader.

Specified by:
adapt in interface Domain
Parameters:
object - the object instance to adapt.
ifName - the exposed interface of the MBean.
Returns:
the model MBean adapter for the object.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.

adapt

public ModelMBean adapt(Object object,
                        String ifName,
                        String modelName)
                 throws ConstructionException,
                        AdaptationException
Description copied from interface: Domain
Adapts the specified object exposing the specified class or interface by applying the specified model MBean and the domain MBean loader.

Specified by:
adapt in interface Domain
Parameters:
object - the object instance to adapt.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
Returns:
the model MBean adapter for the object.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.

adapt

public ModelMBean adapt(Object object,
                        String ifName,
                        ObjectName loader)
                 throws ConstructionException,
                        AdaptationException
Description copied from interface: Domain
Adapts the specified object exposing the specified class or interface by applying the default model MBean and the named MBean loader.

Specified by:
adapt in interface Domain
Parameters:
object - the object instance to adapt.
ifName - the exposed interface of the MBean.
loader - the object name of the loader.
Returns:
the model MBean adapter for the object.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.

adapt

public ModelMBean adapt(Object object,
                        String ifName,
                        String modelName,
                        ObjectName loader)
                 throws ConstructionException,
                        AdaptationException
Description copied from interface: Domain
Adapts the specified object exposing the specified class or interface by applying the specified model MBean and the named MBean loader.

Specified by:
adapt in interface Domain
Parameters:
object - the object instance to adapt.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
loader - the object name of the loader.
Returns:
the model MBean adapter for the object.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.

adapt

public ModelMBean adapt(Object object,
                        String ifName,
                        ObjectName loader,
                        MBeanServer server)
                 throws ConstructionException,
                        AdaptationException
Description copied from interface: Domain
Adapts the specified object exposing the specified class or interface by applying the named MBean loader in the given MBean server.

This method can be applied to adapt objects even when the domain is not yet registered; especially the domain itself may be adapted.

Specified by:
adapt in interface Domain
Parameters:
object - the object instance to adapt.
ifName - the exposed interface of the MBean.
loader - the object name of the loader.
server - the MBean server to apply.
Returns:
the model MBean adapter for the object.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.

adapt

public ModelMBean adapt(Object object,
                        String ifName,
                        String modelName,
                        ObjectName loader,
                        MBeanServer server)
                 throws ConstructionException,
                        AdaptationException
Description copied from interface: Domain
Adapts the specified object exposing the specified class or interface by applying the specified model MBean, the named MBean loader in the given MBean server.

This method can be applied to adapt objects even when the domain is not yet registered; especially the domain itself may be adapted.

Specified by:
adapt in interface Domain
Parameters:
object - the object instance to adapt.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
loader - the object name of the loader.
server - the MBean server to apply.
Returns:
the model MBean adapter for the object.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name)
                           throws ConstructionException,
                                  RegistrationException
Description copied from interface: Domain
Creates a named MBean by applying the domain MBean loader.

Specified by:
createMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
RegistrationException - if registration fails.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  Object[] params,
                                  String[] signature)
                           throws ConstructionException,
                                  RegistrationException
Description copied from interface: Domain
Creates a named MBean with parameters by applying the domain MBean loader.

Specified by:
createMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
params - an array of parameters.
signature - the signature.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
RegistrationException - if registration fails.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loader)
                           throws ConstructionException,
                                  RegistrationException
Description copied from interface: Domain
Creates a named MBean by applying the named MBean loader.

Specified by:
createMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
loader - the object name of the loader.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
RegistrationException - if registration fails.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loader,
                                  Object[] params,
                                  String[] signature)
                           throws ConstructionException,
                                  RegistrationException
Description copied from interface: Domain
Creates a named MBean with parameters by applying the named MBean loader.

Specified by:
createMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
loader - the object name of the loader.
params - an array of parameters.
signature - the signature.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface by applying the default model MBean and the domain MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName,
                                 String modelName)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface by applying the specified model MBean and the domain MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName,
                                 Object[] params,
                                 String[] signature)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface with parameters by applying the default model MBean and the domain MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
params - an array of parameters.
signature - the signature.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName,
                                 String modelName,
                                 Object[] params,
                                 String[] signature)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface with parameters by applying the specified model MBean and the domain MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
params - an array of parameters.
signature - the signature.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName,
                                 ObjectName loader)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface by applying the default model MBean and the named MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
loader - the object name of the loader.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName,
                                 String modelName,
                                 ObjectName loader)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface by applying the specified model MBean and the named MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
loader - the object name of the loader.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName,
                                 ObjectName loader,
                                 Object[] params,
                                 String[] signature)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface with parameters by applying the default model MBean and the named MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
loader - the object name of the loader.
params - an array of parameters.
signature - the signature.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

adaptMBean

public ObjectInstance adaptMBean(String className,
                                 ObjectName name,
                                 String ifName,
                                 String modelName,
                                 ObjectName loader,
                                 Object[] params,
                                 String[] signature)
                          throws ConstructionException,
                                 AdaptationException,
                                 RegistrationException
Description copied from interface: Domain
Adapts a named MBean exposing the specified class or interface with parameters by applying the specified model MBean and the named MBean loader.

Specified by:
adaptMBean in interface Domain
Parameters:
className - the class name of the MBean.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
loader - the object name of the loader.
params - an array of parameters.
signature - the signature.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

registerMBean

public ObjectInstance registerMBean(Object object,
                                    ObjectName name)
                             throws RegistrationException
Description copied from interface: Domain
Registers the named MBean.

Specified by:
registerMBean in interface Domain
Parameters:
object - the MBean object.
name - the object name of the MBean.
Returns:
the object instance of the MBean.
Throws:
RegistrationException - if registration fails.

registerMBean

public ObjectInstance registerMBean(Object object,
                                    ObjectName name,
                                    String ifName)
                             throws ConstructionException,
                                    AdaptationException,
                                    RegistrationException
Description copied from interface: Domain
Registers the named MBean exposing the specified class or interface by applying the default model MBean.

Specified by:
registerMBean in interface Domain
Parameters:
object - the MBean object.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

registerMBean

public ObjectInstance registerMBean(Object object,
                                    ObjectName name,
                                    String ifName,
                                    String modelName)
                             throws ConstructionException,
                                    AdaptationException,
                                    RegistrationException
Description copied from interface: Domain
Registers the named MBean exposing the specified class or interface by applying the specified model MBean.

Specified by:
registerMBean in interface Domain
Parameters:
object - the MBean object.
name - the object name of the MBean.
ifName - the exposed interface of the MBean.
modelName - the model MBean adapter to apply.
Returns:
the object instance of the MBean.
Throws:
ConstructionException - if construction fails.
AdaptationException - if adaptation fails.
RegistrationException - if registration fails.

unregisterMBean

public void unregisterMBean(ObjectName name)
                     throws RegistrationException
Description copied from interface: Domain
Unregisters the named MBean.

Specified by:
unregisterMBean in interface Domain
Parameters:
name - the object name of the MBean.
Throws:
RegistrationException - if unregistration fails.

isRegistered

public boolean isRegistered(ObjectName name)
Description copied from interface: Domain
Checks registration of the named MBean.

Specified by:
isRegistered in interface Domain
Parameters:
name - the object name of the MBean.
Returns:
true if registered, false otherwise.

getObjectName

public ObjectName getObjectName(String name)
                         throws MalformedObjectNameException
Description copied from interface: Domain
Gets a string as an object name. A colon in the domain name is replaced with the default context and a colon followed by more with the domain name.

Specified by:
getObjectName in interface Domain
Parameters:
name - the string to convert.
Returns:
the corresponding object name.
Throws:
MalformedObjectNameException - for invalid strings.

getObjectName

public ObjectName getObjectName(String domain,
                                Hashtable<String,String> table)
                         throws MalformedObjectNameException
Description copied from interface: Domain
Gets a hashtable as an object name using the specified domain. A colon in the domain name is replaced with the default context and a colon followed by more with the domain name.

Specified by:
getObjectName in interface Domain
Parameters:
domain - the domain to use.
table - the key table.
Returns:
the corresponding object name.
Throws:
MalformedObjectNameException - for invalid strings.

getObjectName

public ObjectName getObjectName(String domain,
                                String key,
                                String value)
                         throws MalformedObjectNameException
Description copied from interface: Domain
Gets a key property as an object name using the given domain. A colon in the domain name is replaced with the default context and a colon followed by more with the domain name.

Specified by:
getObjectName in interface Domain
Parameters:
domain - the domain to use.
key - the key.
value - the value.
Returns:
the corresponding object name.
Throws:
MalformedObjectNameException - for invalid strings.

getLoaderName

public ObjectName getLoaderName()
Description copied from interface: Domain
Gets the loader of this domain.

Specified by:
getLoaderName in interface Domain
Returns:
the object name of the loader or a query.

setLoaderName

public void setLoaderName(ObjectName loader)
Description copied from interface: Domain
Sets the loader of this domain. If it is not set, the default one will be used.

Specified by:
setLoaderName in interface Domain
Parameters:
loader - the object name of the loader or a query.

getDomainMBean

public MBeanReference<Domain> getDomainMBean()
Description copied from interface: Domain
Gets a reference to the domain MBean of this domain.

Specified by:
getDomainMBean in interface Domain
Returns:
a reference to the domain MBean or null if not available.

getLoaderMBean

public MBeanReference<Loader> getLoaderMBean()
Description copied from interface: Domain
Gets a reference to the loader MBean of this domain.

Specified by:
getLoaderMBean in interface Domain
Returns:
a reference to the loader MBean or null if not available.

getBrokerName

public ObjectName getBrokerName()
Description copied from interface: Domain
Gets the broker of this domain.

Specified by:
getBrokerName in interface Domain
Returns:
the object name of the broker or a query.

setBrokerName

public void setBrokerName(ObjectName broker)
Description copied from interface: Domain
Sets the broker of this domain. If it is not set, the default one will be used.

Specified by:
setBrokerName in interface Domain
Parameters:
broker - the object name of the broker or a query.

getBrokerMBean

public MBeanReference<Broker> getBrokerMBean()
Description copied from interface: Domain
Gets a reference to the broker of this domain.

Specified by:
getBrokerMBean in interface Domain
Returns:
a reference to the broker or null if not available.

getFactoryName

public ObjectName getFactoryName()
Description copied from interface: Domain
Gets the the factory of this domain.

Specified by:
getFactoryName in interface Domain
Returns:
the object name of the factory or a query.

setFactoryName

public void setFactoryName(ObjectName logger)
Description copied from interface: Domain
Sets the factory of this domain. If it is not set, the default one will be used.

Specified by:
setFactoryName in interface Domain
Parameters:
logger - the object name of the factory or a query.

getFactoryMBean

public MBeanReference<Factory> getFactoryMBean()
Description copied from interface: Domain
Gets a reference to the factory of this domain.

Specified by:
getFactoryMBean in interface Domain
Returns:
a reference to the factory or null if not available.

getDomain

public Domain getDomain()
Description copied from interface: MBeanDelegate
Gets the referent of the domain MBean.

Specified by:
getDomain in interface MBeanDelegate
Overrides:
getDomain in class Adaptee
Returns:
the domain MBean referent.

getLoader

public Loader getLoader()
Description copied from interface: MBeanDelegate
Gets the referent of the loader MBean.

Specified by:
getLoader in interface MBeanDelegate
Overrides:
getLoader in class Adaptee
Returns:
the loader MBean referent.

getBroker

public Broker getBroker()
Description copied from interface: MBeanDelegate
Gets the referent of the broker MBean.

Specified by:
getBroker in interface MBeanDelegate
Overrides:
getBroker in class Adaptee
Returns:
the broker MBean referent.

getFactory

public Factory getFactory()
Description copied from interface: MBeanDelegate
Gets the referent of the factory MBean.

Specified by:
getFactory in interface MBeanDelegate
Overrides:
getFactory in class Adaptee
Returns:
the factory MBean referent.

introspect

protected void introspect(RequiredModelMBean model,
                          Object adaptee,
                          Class<?> clazz)
                   throws AdaptationException
Instrospects the public methods of the managed class.

Parameters:
model - the model MBean.
adaptee - the adaptee.
clazz - the class to introspect.
Throws:
AdaptationException - if introspection fails.


Copyright © 2004 The Norther Organization. All rights reserved.