|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader java.security.SecureClassLoader java.net.URLClassLoader org.norther.tammi.acorn.net.URLClassLoader org.norther.tammi.core.base.AbstractLoader<ReferableVariableRegistryMBean> org.norther.tammi.core.rt.ReferableVariableRegistry
public class ReferableVariableRegistry
A default implementation of ReferableVariableRegistryMBean.
Field Summary |
---|
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean |
---|
ID, MBEAN, NS, TYPE |
Constructor Summary | |
---|---|
ReferableVariableRegistry()
Constructs a new loader. |
|
ReferableVariableRegistry(ClassLoader parent)
Constructs a new loader with a parent. |
Method Summary | |
---|---|
void |
clearAllTypes()
Clears registered attributes of all variable types. |
Introspector |
createIntrospector()
Creates a variable introspector for this registry. |
Variable |
createVariable(String type)
Creates a new variable instance of the specified type. |
Class<?> |
defineVariableClass(String className,
Class<?>... ifaces)
Defines a new variable of the named class. |
Class<?> |
defineVariableClass(String className,
Class<?> superClass,
Class<?>... ifaces)
Defines a new variable of the named class extending the specified super class. |
Collection<? extends VariableAttributeInfo> |
getAttributeInfo(String type)
Gets the registered attributes of the specified variable type. |
VariableAttributeInfo |
getAttributeInfo(String type,
String name)
Gets the registered named attribute of the specified variable type. |
List<VariableAttributeInfo> |
getAttributeList(String type)
Gets the registered attribute list of cloned and modifiable attributes of the specified variable type. |
VariableAttributeInfo |
getAttributeNode(VariableAttributeInfo info,
String... pattern)
Gets a non-recursive attribute info node. |
List<VariableAttributeInfo> |
getAttributeTree(VariableAttributeInfo info,
String... pattern)
Gets a tree of recursive attribute infos, the original one at the index 0 and the non-recursive one at the last index. |
String |
getDefaultBaseClassName()
Gets the default base class name applied to defined variable classes. |
String |
getDefaultVariableClassName()
Gets the default variable class name applied to virtual variable types. |
Variable |
getInstance(String className)
Gets an instance of a named class. |
Variable |
getInstance(String className,
Object[] params,
String[] signature)
Gets an instance of a named class. |
Variable |
getInstance(String className,
ObjectName loader)
Gets an instance of a named class using a specified class loader. |
Variable |
getInstance(String className,
ObjectName loader,
Object[] params,
String[] signature)
Gets an instance of a named class using a specified class loader. |
protected MBeanServer |
getMBeanServer()
Gets the MBean server. |
VariableInfo |
getVariableInfo(String type)
Gets the registered variable info of the specified variable type. |
boolean |
isLoaderSupported(String className)
Checks if specified class loaders are supported for a named class. |
boolean |
isLocalizedVariables()
Checks whether variables in this registry are localized. |
boolean |
isTypeRegistered(String type)
Checks whether the specified variable type is registered. |
void |
postDeregister()
|
void |
postRegister(Boolean done)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
|
void |
removeAttributeInfo(String type)
Removes registered attributes of the specified variable type. |
void |
setAttributeInfo(String className)
Sets the registered attributes of the named variable class. |
void |
setAttributeInfo(String type,
Collection<? extends VariableAttributeInfo> attributes)
Sets the registered attributes of the specified variable type. |
void |
setAttributeInfo(String type,
Collection<? extends VariableAttributeInfo> attributes,
Descriptor descriptor)
Sets the registered attributes and descriptor of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
Collection<? extends VariableAttributeInfo> attributes)
Sets the registered attributes and class name of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
Collection<? extends VariableAttributeInfo> attributes,
Descriptor descriptor)
Sets the registered attributes, class name and descriptor of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
String description,
Collection<? extends VariableAttributeInfo> attributes)
Sets the registered attributes, class name and description of the specified variable type. |
void |
setAttributeInfo(String type,
String className,
String description,
Collection<? extends VariableAttributeInfo> attributes,
Descriptor descriptor)
Sets the registered attributes, class name, description and descriptor of the specified variable type. |
void |
setDefaultBaseClassName(String className)
Sets the default base class name applied to defined variable classes. |
void |
setDefaultVariableClassName(String className)
Sets the default variable class name applied to virtual variable types. |
void |
setLocalizedVariables(boolean flag)
Sets whether variables in this registry are localized. |
void |
setVariableInfo(String type,
VariableInfo info)
Sets the registered variable info of the specified variable type. |
Set<String> |
typeSet()
Returns a read-only set of registered variable types. |
Set<String> |
typeSet(String prefix)
Returns a set of registered variable types with the given prefix. |
Methods inherited from class org.norther.tammi.core.base.AbstractLoader |
---|
addNotificationListener, addURL, getMBean, getMBeanDelegate, getNamePattern, getNotificationInfo, getQueryPattern, isClassDefined, removeNotificationListener, setNamePattern, setQueryPattern |
Methods inherited from class org.norther.tammi.acorn.net.URLClassLoader |
---|
defineClass, defineSubclass, defineSubclass |
Methods inherited from class java.net.URLClassLoader |
---|
definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.norther.tammi.core.base.Loader |
---|
addURL, defineClass, defineSubclass, defineSubclass, getResource, getResourceAsStream, getResources, getURLs, isClassDefined, loadClass |
Methods inherited from interface org.norther.tammi.core.base.ReferableMBean |
---|
getMBean |
Constructor Detail |
---|
public ReferableVariableRegistry()
public ReferableVariableRegistry(ClassLoader parent)
parent
- the parent class loader.Method Detail |
---|
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
in interface MBeanRegistration
preRegister
in class AbstractLoader<ReferableVariableRegistryMBean>
Exception
public void postRegister(Boolean done)
postRegister
in interface MBeanRegistration
postRegister
in class AbstractLoader<ReferableVariableRegistryMBean>
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
preDeregister
in class AbstractLoader<ReferableVariableRegistryMBean>
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
postDeregister
in class AbstractLoader<ReferableVariableRegistryMBean>
public String getDefaultBaseClassName()
VariableRegistry
getDefaultBaseClassName
in interface VariableRegistry
public void setDefaultBaseClassName(String className)
VariableRegistry
setDefaultBaseClassName
in interface VariableRegistry
className
- the default base class name.public String getDefaultVariableClassName()
VariableRegistry
getDefaultVariableClassName
in interface VariableRegistry
public void setDefaultVariableClassName(String className)
VariableRegistry
setDefaultVariableClassName
in interface VariableRegistry
className
- the default variable class name.public boolean isLocalizedVariables()
VariableRegistry
isLocalizedVariables
in interface VariableRegistry
public void setLocalizedVariables(boolean flag)
VariableRegistry
setLocalizedVariables
in interface VariableRegistry
flag
- true if localized, otherwise false.public boolean isTypeRegistered(String type)
VariableRegistry
isTypeRegistered
in interface VariableRegistry
type
- the variable type.
public List<VariableAttributeInfo> getAttributeList(String type)
VariableRegistry
getAttributeList
in interface VariableRegistry
type
- the variable type.
public VariableInfo getVariableInfo(String type)
VariableRegistry
getVariableInfo
in interface VariableRegistry
type
- the variable type.
public void setVariableInfo(String type, VariableInfo info)
VariableRegistry
setVariableInfo
in interface VariableRegistry
type
- the variable type.info
- the variable info or null.public VariableAttributeInfo getAttributeInfo(String type, String name)
VariableRegistry
getAttributeInfo
in interface VariableRegistry
type
- the variable type.name
- the attribute name.
public Collection<? extends VariableAttributeInfo> getAttributeInfo(String type)
VariableRegistry
getAttributeInfo
in interface VariableRegistry
type
- the variable type.
public void setAttributeInfo(String type, Collection<? extends VariableAttributeInfo> attributes)
VariableRegistry
setAttributeInfo
in interface VariableRegistry
type
- the variable type.attributes
- a collection of VariableAttributeInfo instances.public void setAttributeInfo(String type, String className, Collection<? extends VariableAttributeInfo> attributes)
VariableRegistry
The variable class has to implement the Variable
interface
If the named variable class is not available, it will be dynamically defined to be a subclass of the default base class.
setAttributeInfo
in interface VariableRegistry
type
- the variable type.className
- the class name.attributes
- a collection of VariableAttributeInfo instances.public void setAttributeInfo(String type, String className, String description, Collection<? extends VariableAttributeInfo> attributes)
VariableRegistry
setAttributeInfo
in interface VariableRegistry
type
- the variable type.className
- the class name.description
- the description.attributes
- a collection of VariableAttributeInfo instances.public void setAttributeInfo(String type, Collection<? extends VariableAttributeInfo> attributes, Descriptor descriptor)
VariableRegistry
setAttributeInfo
in interface VariableRegistry
type
- the variable type.attributes
- a collection of VariableAttributeInfo instances.descriptor
- the variable descriptor.public void setAttributeInfo(String type, String className, Collection<? extends VariableAttributeInfo> attributes, Descriptor descriptor)
VariableRegistry
setAttributeInfo
in interface VariableRegistry
type
- the variable type.className
- the class name.attributes
- a collection of VariableAttributeInfo instances.descriptor
- the variable descriptor.public void setAttributeInfo(String type, String className, String description, Collection<? extends VariableAttributeInfo> attributes, Descriptor descriptor)
VariableRegistry
setAttributeInfo
in interface VariableRegistry
type
- the variable type.className
- the class name.description
- the description.attributes
- a collection of VariableAttributeInfo instances.descriptor
- the variable descriptor.public void setAttributeInfo(String className)
VariableRegistry
setAttributeInfo
in interface VariableRegistry
className
- the class name.public void removeAttributeInfo(String type)
VariableRegistry
removeAttributeInfo
in interface VariableRegistry
type
- the variable type.public void clearAllTypes()
VariableRegistry
clearAllTypes
in interface VariableRegistry
public Set<String> typeSet()
VariableRegistry
typeSet
in interface VariableRegistry
public Set<String> typeSet(String prefix)
VariableRegistry
typeSet
in interface VariableRegistry
prefix
- a prefix.
public Class<?> defineVariableClass(String className, Class<?>... ifaces) throws ClassNotFoundException, ClassFormatError
VariableRegistry
defineVariableClass
in interface VariableRegistry
className
- the class name of the variable.ifaces
- optional interfaces.
ClassNotFoundException
- for missing classes.
ClassFormatError
- if the class hierarchy is invalid.public Class<?> defineVariableClass(String className, Class<?> superClass, Class<?>... ifaces) throws ClassFormatError
VariableRegistry
defineVariableClass
in interface VariableRegistry
className
- the class name of the variable.superClass
- the super class.ifaces
- optional interfaces.
ClassFormatError
- if the class hierarchy is invalid.public Variable createVariable(String type) throws ConstructionException
VariableRegistry
createVariable
in interface VariableRegistry
type
- the type of the variable.
ConstructionException
- if construction fails.public Introspector createIntrospector()
VariableRegistry
createIntrospector
in interface VariableRegistry
public VariableAttributeInfo getAttributeNode(VariableAttributeInfo info, String... pattern)
VariableRegistry
getAttributeNode
in interface VariableRegistry
info
- the recursive attribute info.pattern
- an optional pattern.
public List<VariableAttributeInfo> getAttributeTree(VariableAttributeInfo info, String... pattern)
VariableRegistry
getAttributeTree
in interface VariableRegistry
info
- the recursive attribute info.pattern
- an optional pattern.
public Variable getInstance(String className) throws ConstructionException
ObjectFactory
getInstance
in interface ObjectFactory<Variable>
className
- the name of the class.
ConstructionException
- if construction fails.public Variable getInstance(String className, ObjectName loader) throws ConstructionException
ObjectFactory
Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance
in interface ObjectFactory<Variable>
className
- the name of the class.loader
- the class loader.
ConstructionException
- if construction fails.public Variable getInstance(String className, Object[] params, String[] signature) throws ConstructionException
ObjectFactory
getInstance
in interface ObjectFactory<Variable>
className
- the name of the class.params
- an array containing the parameters of the constructor.signature
- an array containing the signature of the constructor.
ConstructionException
- if construction fails.public Variable getInstance(String className, ObjectName loader, Object[] params, String[] signature) throws ConstructionException
ObjectFactory
Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance
in interface ObjectFactory<Variable>
className
- the name of the class.loader
- the class loader.params
- an array containing the parameters of the constructor.signature
- an array containing the signature of the constructor.
ConstructionException
- if construction fails.public boolean isLoaderSupported(String className)
ObjectFactory
isLoaderSupported
in interface ObjectFactory<Variable>
className
- the name of the class.
protected MBeanServer getMBeanServer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |