|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.MBeanBroker
public class MBeanBroker
An MBean broker resolving MBean references and supporting access to their properties and methods. Internally, it utilizes services provided by the default broker.
It may be used in situations where direct access to the above services is not available, like in template contexts and scripting environments. It can also resolve parameter signatures automatically based on their class types, which makes script access to MBeans more convenient.
Field Summary | |
---|---|
static String |
MBEAN_BROKER
The global MBean broker bean. |
Constructor Summary | |
---|---|
MBeanBroker()
Constructs a new broker. |
|
MBeanBroker(MBeanServer server)
Constructs a new broker for a specific server. |
Method Summary | |
---|---|
ObjectName |
adapt(String className)
Adapts and registers an MBean with the default name. |
ObjectName |
adapt(String className,
ObjectName name)
Adapts and registers an MBean with an object name . |
ObjectName |
adapt(String className,
ObjectName name,
String ifname)
Adapts and registers an MBean with an object name and interface. |
ObjectName |
adapt(String className,
ObjectName name,
String ifname,
Object params)
Adapts and registers an MBean with an object name, interface and parameters. |
ObjectName |
adapt(String className,
ObjectName name,
String ifname,
ObjectName loader,
Object params,
Object sign)
Adapts and registers an MBean with an object name, interface, class loader, parameters and signature. |
ObjectName |
adapt(String className,
ObjectName name,
String ifname,
Object params,
Object sign)
Adapts and registers an MBean with an object name, interface, parameters and signature. |
ObjectName |
adapt(String className,
String ifname)
Adapts and registers an MBean with the default name and interface. |
ObjectName |
adapt(String className,
String name,
String ifname)
Adapts and registers an MBean with a string name and interface. |
ObjectName |
adapt(String className,
String name,
String ifname,
Object params)
Adapts and registers an MBean with a string name, interface and parameters. |
ObjectName |
adapt(String className,
String name,
String ifname,
Object params,
Object sign)
Adapts and registers an MBean with a string name, interface, parameters and signature. |
ObjectName |
adapt(String className,
String name,
String ifname,
String loader,
Object params,
Object sign)
Adapts and registers an MBean with a string name, interface, class loader, parameters and signature. |
boolean |
containsAlias(String alias)
Checks an alias of the specified MBean. |
boolean |
containsFactory(String className)
Checks the factory MBean for the specified class name. |
ObjectName |
create(String className)
Creates and registers an MBean with the default name. |
ObjectName |
create(String className,
ObjectName name)
Creates and registers an MBean with an object name. |
ObjectName |
create(String className,
ObjectName name,
Object params)
Creates and registers an MBean with an object name and parameters. |
ObjectName |
create(String className,
ObjectName name,
ObjectName loader,
Object params,
Object sign)
Creates and registers an MBean with an object name, class loader, parameters and signature. |
ObjectName |
create(String className,
ObjectName name,
Object params,
Object sign)
Creates and registers an MBean with an object name, parameters and signature. |
ObjectName |
create(String className,
String name)
Creates and registers an MBean with a string name. |
ObjectName |
create(String className,
String name,
Object params)
Creates and registers an MBean with a string name and parameters. |
ObjectName |
create(String className,
String name,
Object params,
Object sign)
Creates and registers an MBean with a string name, parameters and signature. |
ObjectName |
create(String className,
String name,
String loader,
Object params,
Object sign)
Creates and registers an MBean with a string name, class loader, parameters and signature. |
Object |
find(ObjectName name)
Finds the referent of the specified MBean. |
Object |
find(ObjectName name,
String className)
Finds a direct reference to the specified MBean implementing a specific class. |
Object |
find(String spec)
Finds the referent of the specified MBean. |
Object |
find(String name,
String className)
Finds the referent of the MBean with the specified name string implementing a specific class. |
ObjectName |
findName(ObjectName name)
Finds an object name of the specified MBean. |
ObjectName |
findName(ObjectName name,
String className)
Finds an object name of the specified MBean implementing a specific class. |
ObjectName |
findName(String spec)
Finds the object name of the specified MBean. |
ObjectName |
findName(String name,
String className)
Finds the object name of the MBean with the specified name string implementing a specific class. |
Set<ObjectName> |
findNames(boolean all)
Finds a set of object names registered to the domains of this application. |
Set<ObjectName> |
findNames(boolean all,
String className)
Finds a set of object names implementing a specific class registered to the domains of this application. |
Set<ObjectName> |
findNames(ObjectName name)
Finds a set of object name of the specified MBeans. |
Set<ObjectName> |
findNames(ObjectName name,
String className)
Finds a set of object name of the specified MBeans implementing a specific class. |
Set<ObjectName> |
findNames(String spec)
Finds a set of object names of the specified MBeans. |
Set<ObjectName> |
findNames(String name,
String className)
Finds a set of object name of MBeans with the specified name string implementing a specific class. |
Object |
get(ObjectName name,
String key)
Gets an attribute value of the specified MBean. |
Object |
get(ObjectName name,
String key,
Object tag)
Gets a taggeg attribute value of the specified MBean. |
Object |
get(String spec,
String key)
Gets an attribute value of the specified MBean. |
Object |
get(String spec,
String key,
String tag)
Gets a tagged attribute value of the specified MBean. |
ObjectName |
getAlias(String alias)
Gets an alias of the specified MBean. |
String[] |
getAllDomains()
Gets all domains. |
protected Broker |
getBroker()
Gets the broker. |
String |
getClassName(ObjectName name)
Gets the class name of the specified MBean. |
String |
getClassName(String spec)
Gets the class name of the specified MBean. |
String |
getDefaultDomain()
Gets the default domain. |
protected Domain |
getDomain()
Gets the domain. |
String |
getDomainName()
Gets the domain name. |
String[] |
getDomainNames()
Gets the domain names. |
protected Factory |
getFactory()
Gets the factory. |
ObjectName |
getFactory(String className)
Gets the factory MBean for the specified class name. |
String |
getImplementationVersion()
Gets the implementation version. |
MBeanInfo |
getInfo(ObjectName name)
Gets MBean info about the specified MBean. |
MBeanInfo |
getInfo(String spec)
Gets MBean info about the specified MBean. |
protected Loader |
getLoader()
Gets the loader. |
Log |
getLog()
Gets a log. |
MBeanServer |
getMBeanServer()
Gets a reference to the MBean server. |
Package |
getPackage(String name)
Gets the named package. |
Package[] |
getPackages()
Gets all known packages. |
String |
getSpecificationVersion()
Gets the specification version. |
String |
getSystemProperty(String name)
Gets a system property. |
Object |
instantiate(String className)
Intantiates an object. |
Object |
instantiate(String className,
Object params)
Intantiates an object with parameters. |
Object |
instantiate(String className,
Object params,
Object sign)
Intantiates an object with parameters and a signature. |
Object |
invoke(ObjectName name,
String method)
Invokes a method of the specified MBean. |
Object |
invoke(ObjectName name,
String method,
Object params)
Invokes a method of the specified MBean with parameters. |
Object |
invoke(ObjectName name,
String method,
Object params,
Object sign)
Invokes a method of the specified MBean with parameters and a signature. |
Object |
invoke(String spec,
String method)
Invokes a method of the specified MBean. |
Object |
invoke(String spec,
String method,
Object params)
Invokes a method of the specified MBean with parameters. |
Object |
invoke(String spec,
String method,
Object params,
Object sign)
Invokes a method of the specified MBean with parameters and a signature. |
boolean |
isDefined(String className)
Checks whether a class is defined. |
boolean |
isInstanceOf(ObjectName name,
String className)
Checks whether the named MBean implements a specific class. |
boolean |
isInstanceOf(String name,
String className)
Checks whether an MBean with a string name implements a specific class. |
boolean |
isRegistered(ObjectName name)
Checks whether the named MBean is registered. |
boolean |
isRegistered(String name)
Checks whether an MBean with a string name is registered. |
Class<?> |
load(String className)
Loads a class. |
ObjectName |
register(Object object)
Registers an unnamed MBean. |
ObjectName |
register(Object object,
ObjectName name)
Registers the named MBean. |
ObjectName |
register(Object object,
ObjectName name,
String ifname)
Registers the named MBean exposing the specified class or interface. |
ObjectName |
register(Object object,
String name)
Registers an MBean with a string name. |
void |
set(ObjectName name,
String key,
Object value)
Sets an attribute value of the specified MBean. |
void |
set(ObjectName name,
String key,
Object tag,
Object value)
Sets a tagged attribute value of the specified MBean. |
void |
set(ObjectName name,
String key,
Object tag,
Object value,
String type)
Sets a tagged and typed attribute value of the specified MBean. |
void |
set(String spec,
String key,
Object value)
Sets an attribute value of the specified MBean. |
void |
set(String spec,
String key,
Object tag,
Object value)
Sets a tagged attribute value of the specified MBean. |
void |
set(String spec,
String key,
Object tag,
Object value,
String type)
Sets a tagged and typed attribute value of the specified MBean. |
void |
setAlias(String alias,
ObjectName name)
Sets an alias of the specified MBean. |
void |
setAlias(String alias,
String spec)
Sets an alias for the specified MBean. |
void |
setFactory(String className,
ObjectName name)
Sets the factory MBean for the specified class name. |
void |
setFactory(String className,
String spec)
Sets the factory MBean for the specified class name. |
protected void |
setMBeanServer(MBeanServer server)
Sets a reference to the MBean server. |
void |
setSystemProperty(String name,
String value)
Sets a system property. |
void |
sleep(long msecs)
Sleeps the specified time. |
ObjectName |
toObjectName(String name)
Converts a string to an object name. |
String |
toPackageName(String uri)
Converts an URI path to a package name. |
void |
unregister(ObjectName name)
Unregisters the named MBean. |
void |
unregister(String name)
Unregisters an MBean with a string name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MBEAN_BROKER
Constructor Detail |
---|
public MBeanBroker()
public MBeanBroker(MBeanServer server)
server
- the MBean server.Method Detail |
---|
public Set<ObjectName> findNames(boolean all)
all
- true for all names, false for default names.
public Set<ObjectName> findNames(boolean all, String className)
all
- true for all names, false for default names.className
- the class name.
public Object find(String spec)
spec
- the MBean specification.
public ObjectName findName(String spec)
spec
- the MBean specification.
public Set<ObjectName> findNames(String spec)
spec
- the MBean specification.
public Object find(String name, String className)
name
- the name string or pattern.className
- the class name.
public ObjectName findName(String name, String className)
name
- the name string or pattern.className
- the class name.
public Set<ObjectName> findNames(String name, String className)
name
- the name string or pattern.className
- the class name.
public Object find(ObjectName name)
name
- the MBean name.
public ObjectName findName(ObjectName name)
name
- the MBean name.
public Set<ObjectName> findNames(ObjectName name)
name
- the MBean name.
public Object find(ObjectName name, String className)
name
- the MBean name.className
- the class name.
public ObjectName findName(ObjectName name, String className)
name
- the MBean name.className
- the class name.
public Set<ObjectName> findNames(ObjectName name, String className)
name
- the MBean name.className
- the class name.
public String getClassName(String spec) throws LogException
spec
- the MBean specification.
LogException
- on errors.public MBeanInfo getInfo(String spec) throws LogException
spec
- the MBean specification.
LogException
- on errors.public void setAlias(String alias, String spec)
alias
- the alias key.spec
- the MBean specification.public void setFactory(String className, String spec)
className
- the class name.spec
- the MBean specification.public Object get(String spec, String key) throws LogException
spec
- the MBean specification.key
- the attribute key.
LogException
- on errors.public void set(String spec, String key, Object value) throws LogException
spec
- the MBean specification.key
- the attribute key.value
- the attribute value.
LogException
- on errors.public Object get(String spec, String key, String tag) throws LogException
spec
- the MBean specification.key
- the attribute key.tag
- the attribute tag.
LogException
- on errors.public void set(String spec, String key, Object tag, Object value) throws LogException
spec
- the MBean specification.key
- the attribute key.tag
- the attribute tag.value
- the attribute value.
LogException
- on errors.public void set(String spec, String key, Object tag, Object value, String type) throws LogException
spec
- the MBean specification.key
- the attribute key.tag
- the attribute tag.value
- the attribute value.type
- the attribute type.
LogException
- on errors.public Object invoke(String spec, String method) throws LogException
spec
- the MBean specification.method
- the method name.
LogException
- on errors.public Object invoke(String spec, String method, Object params) throws LogException
spec
- the MBean specification.method
- the method name.params
- the parameters to the method.
LogException
- on errors.public Object invoke(String spec, String method, Object params, Object sign) throws LogException
null
or also a list.
spec
- the MBean specification.method
- the method name.params
- the parameters to the method.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName create(String className) throws LogException
className
- the class name of the MBean.
LogException
- on errors.public ObjectName create(String className, String name) throws LogException
className
- the class name of the MBean.name
- the string name of the MBean.
LogException
- on errors.public ObjectName create(String className, String name, Object params) throws LogException
className
- the class name of the MBean.name
- the string name of the MBean.params
- the parameter to the constructor.
LogException
- on errors.public ObjectName create(String className, String name, Object params, Object sign) throws LogException
null
or also a list.
className
- the class name of the MBean.name
- the string name of the MBean.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName create(String className, String name, String loader, Object params, Object sign) throws LogException
null
or also a list.
className
- the class name of the MBean.name
- the string name of the MBean.loader
- the string name of the loader.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName adapt(String className) throws LogException
className
- the class name of the MBean.
LogException
- on errors.public ObjectName adapt(String className, String ifname) throws LogException
className
- the class name of the MBean.ifname
- the interface of the MBean.
LogException
- on errors.public ObjectName adapt(String className, String name, String ifname) throws LogException
className
- the class name of the MBean.name
- the string name of the MBean.ifname
- the interface of the MBean.
LogException
- on errors.public ObjectName adapt(String className, String name, String ifname, Object params) throws LogException
className
- the class name of the MBean.name
- the string name of the MBean.ifname
- the interface of the MBean.params
- the parameter to the constructor.
LogException
- on errors.public ObjectName adapt(String className, String name, String ifname, Object params, Object sign) throws LogException
null
or also a list.
className
- the class name of the MBean.name
- the string name of the MBean.ifname
- the interface of the MBean.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName adapt(String className, String name, String ifname, String loader, Object params, Object sign) throws LogException
null
or also a
list.
className
- the class name of the MBean.name
- the string name of the MBean.ifname
- the interface of the MBean.loader
- the string name of the loader.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName register(Object object, String name) throws LogException
object
- the object to register.name
- the string name of the MBean.
LogException
- on errors.public void unregister(String name) throws LogException
name
- the string name of the MBean.
LogException
- on errors.public boolean isRegistered(String name)
name
- the string name of the MBean.
public boolean isInstanceOf(String name, String className) throws LogException
name
- the string name of the MBean.className
- the name of the class.
LogException
- on errors.public String getClassName(ObjectName name) throws LogException
name
- the object name of the MBean.
LogException
- on errors.public MBeanInfo getInfo(ObjectName name) throws LogException
name
- the object name of the MBean.
LogException
- on errors.public boolean containsAlias(String alias)
alias
- the alias key.
public ObjectName getAlias(String alias)
alias
- the alias key.
public void setAlias(String alias, ObjectName name)
alias
- the alias key.name
- the object name of the MBean.public boolean containsFactory(String className)
className
- the class name.
public ObjectName getFactory(String className)
className
- the class name.
public void setFactory(String className, ObjectName name)
className
- the class name.name
- the object name of the factory MBean.public Object get(ObjectName name, String key) throws LogException
name
- the object name of the MBean.key
- the attribute key.
LogException
- on errors.public void set(ObjectName name, String key, Object value) throws LogException
name
- the MBean name.key
- the attribute key.value
- the attribute value.
LogException
- on errors.public Object get(ObjectName name, String key, Object tag) throws LogException
name
- the object name of the MBean.key
- the attribute key.tag
- the attribute tag.
LogException
- on errors.public void set(ObjectName name, String key, Object tag, Object value) throws LogException
name
- the MBean name.key
- the attribute key.tag
- the attribute tag.value
- the attribute value.
LogException
- on errors.public void set(ObjectName name, String key, Object tag, Object value, String type) throws LogException
name
- the MBean name.key
- the attribute key.tag
- the attribute tag.type
- the attribute type.value
- the attribute value.
LogException
- on errors.public Object invoke(ObjectName name, String method) throws LogException
name
- the MBean name.method
- the method name.
LogException
- on errors.public Object invoke(ObjectName name, String method, Object params) throws LogException
name
- the MBean name.method
- the method name.params
- the parameters to the method.
LogException
- on errors.public Object invoke(ObjectName name, String method, Object params, Object sign) throws LogException
null
or also a list.
name
- the MBean name.method
- the method name.params
- the parameters to the method.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName create(String className, ObjectName name) throws LogException
className
- the class name of the MBean.name
- the object name of the MBean.
LogException
- on errors.public ObjectName create(String className, ObjectName name, Object params) throws LogException
className
- the class name of the MBean.name
- the object name of the MBean.params
- the parameter to the constructor.
LogException
- on errors.public ObjectName create(String className, ObjectName name, Object params, Object sign) throws LogException
null
or also a list.
className
- the class name of the MBean.name
- the object name of the MBean.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName create(String className, ObjectName name, ObjectName loader, Object params, Object sign) throws LogException
null
or also a list.
className
- the class name of the MBean.name
- the object name of the MBean.loader
- the object name of the loader.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName adapt(String className, ObjectName name) throws LogException
className
- the class name of the MBean.name
- the object name of the MBean.
LogException
- on errors.public ObjectName adapt(String className, ObjectName name, String ifname) throws LogException
className
- the class name of the MBean.name
- the object name of the MBean.ifname
- the interface of the MBean.
LogException
- on errors.public ObjectName adapt(String className, ObjectName name, String ifname, Object params) throws LogException
className
- the class name of the MBean.name
- the object name of the MBean.ifname
- the interface of the MBean.params
- the parameter to the constructor.
LogException
- on errors.public ObjectName adapt(String className, ObjectName name, String ifname, Object params, Object sign) throws LogException
null
or also a list.
className
- the class name of the MBean.name
- the object name of the MBean.ifname
- the interface of the MBean.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName adapt(String className, ObjectName name, String ifname, ObjectName loader, Object params, Object sign) throws LogException
null
or also a
list.
className
- the class name of the MBean.name
- the object name of the MBean.ifname
- the interface of the MBean.loader
- the object name of the loader.params
- the parameter to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public Object instantiate(String className) throws LogException
className
- the class name of the object.
LogException
- on errors.public Object instantiate(String className, Object params) throws LogException
className
- the class name of the object.params
- the parameters to the constructor.
LogException
- on errors.public Object instantiate(String className, Object params, Object sign) throws LogException
className
- the class name of the object.params
- the parameters to the constructor.sign
- the signature of the parameters.
LogException
- on errors.public ObjectName register(Object object) throws LogException
object
- the object to register.
LogException
- on errors.public ObjectName register(Object object, ObjectName name) throws LogException
object
- the object to register.name
- the object name or name pattern of the MBean.
LogException
- on errors.public ObjectName register(Object object, ObjectName name, String ifname) throws LogException
object
- the object to register.name
- the object name or name pattern of the MBean.ifname
- the class name.
LogException
- on errors.public void unregister(ObjectName name) throws LogException
name
- the object name of the MBean.
LogException
- on errors.public boolean isRegistered(ObjectName name)
name
- the object name of the MBean.
public boolean isInstanceOf(ObjectName name, String className) throws LogException
name
- the object name of the MBean.className
- the name of the class.
LogException
- on errors.public String getDomainName()
public String[] getDomainNames()
public String getDefaultDomain()
public String[] getAllDomains() throws LogException
LogException
- on errors.public ObjectName toObjectName(String name) throws LogException
name
- the string.
LogException
- on errors.public String toPackageName(String uri)
uri
- the URI path to convert.
public Package getPackage(String name)
name
- the name of the package.
public Package[] getPackages()
public String getSpecificationVersion()
public String getImplementationVersion()
public String getSystemProperty(String name)
name
- the property name.
public void setSystemProperty(String name, String value)
name
- the property name.value
- the property value.public Class<?> load(String className) throws ClassNotFoundException
className
- the class name.
ClassNotFoundException
- if not found.public boolean isDefined(String className)
className
- the class name.
public Log getLog()
public void sleep(long msecs)
msecs
- the time in msecs.public MBeanServer getMBeanServer()
protected void setMBeanServer(MBeanServer server)
server
- the server.protected Loader getLoader()
protected Domain getDomain()
protected Broker getBroker()
protected Factory getFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |