org.norther.tammi.core.rt
Interface VariableRegistry

All Superinterfaces:
ObjectFactory
All Known Implementing Classes:
DefaultVariableRegistry

public interface VariableRegistry
extends ObjectFactory

An interface to variable registries and variable factories.

Author:
Ilkka Priha

Method Summary
 void clearAllTypes()
          Clears registered attributes of all variable types.
 Variable createVariable(String type)
          Creates a new variable instance of the specified type.
 Class defineVariableClass(String className)
          Defines a new variable of the named class.
 Class defineVariableClass(String className, Class superClass)
          Defines a new variable of the named class extending the specified super class.
 Class defineVariableClass(String className, String superName)
          Defines a new variable of the named class extending the named super class.
 AttributeExporter getAttributeExporter(String type)
          Gets the registered exporter of the specified variable type.
 AttributeImporter getAttributeImporter(String type)
          Gets the registered importer of the specified variable type.
 Collection getAttributeInfo(String type)
          Gets a registered attribute collection of locked attributes of the specified variable type.
 List getAttributeList(String type)
          Gets a registered attribute list of cloned and unlocked attributes of the specified variable type.
 OrderedMap getAttributeMap(String type)
          Gets a registered attribute map of locked attributes of the specified variable type.
 AttributeValidator getAttributeValidator(String type)
          Gets the registered validator of the specified variable type.
 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.
 String getExporterClassName(String type)
          Gets the exporter class name of the specified variable type.
 String getImporterClassName(String type)
          Gets the importer class name of the specified variable type.
 ObjectName getNamePattern(String type)
          Gets the name pattern of the specified variable type.
 String getValidatorClassName(String type)
          Gets the validator class name of the specified variable type.
 String getVariableClassName(String type)
          Gets the variable class name of the specified variable type.
 boolean isLocalizedVariables()
          Checks whether variables in this registry are localized.
 boolean isTypeRegistered(String type)
          Checks whether the specified variable type is registered.
 void removeAttributeInfo(String type)
          Removes registered attributes of the specified variable type.
 void setAttributeExporter(String type, AttributeExporter exporter)
          Sets the registered exporter of the specified variable type.
 void setAttributeImporter(String type, AttributeImporter importer)
          Sets the registered importer of the specified variable type.
 void setAttributeInfo(String type, Collection attributes)
          Sets registered attributes of the specified variable type.
 void setAttributeInfo(String type, Collection attributes, String validatorClassName)
          Sets registered attributes and a validator class for the specified variable type.
 void setAttributeInfo(String type, String className, Collection attributes)
          Sets registered attributes and a variable class for the specified variable type.
 void setAttributeInfo(String type, String className, Collection attributes, String validatorClassName)
          Sets registered attributes, a variable class and a validator class for the specified variable type.
 void setAttributeInfo(String type, String className, Collection attributes, String validatorClassName, ObjectName pattern)
          Sets registered attributes, a variable class, a validator class and an optional object name pattern for the specified variable type.
 void setAttributeInfo(String type, String className, String importerClassName, String exporterClassName, Collection attributes, String validatorClassName, ObjectName pattern)
          Sets registered attributes, a variable class, an importer class, an exporter class, a validator class and an optional object name pattern for the specified variable type.
 void setAttributeValidator(String type, AttributeValidator validator)
          Sets the registered validator 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 setExporterClassName(String type, String className)
          Sets the exporter class name of the specified variable type.
 void setImporterClassName(String type, String className)
          Sets the importer class name of the specified variable type.
 void setLocalizedVariables(boolean flag)
          Sets whether variables in this registry are localized.
 void setNamePattern(String type, ObjectName pattern)
          Sets the name pattern of the specified variable type.
 void setValidatorClassName(String type, String className)
          Sets the validator class name of the specified variable type.
 void setVariableClassName(String type, String className)
          Sets the variable class name of the specified variable type.
 Set typeSet()
          Returns a read-only set of registered variable types.
 Set typeSet(String prefix)
          Returns a set of registered variable types with the given prefix.
 
Methods inherited from interface org.norther.tammi.core.base.ObjectFactory
getInstance, getInstance, getInstance, getInstance, isLoaderSupported
 

Method Detail

getDefaultBaseClassName

String getDefaultBaseClassName()
Gets the default base class name applied to defined variable classes.

Returns:
the default base class name.

setDefaultBaseClassName

void setDefaultBaseClassName(String className)
Sets the default base class name applied to defined variable classes.

Parameters:
className - the default base class name.

getDefaultVariableClassName

String getDefaultVariableClassName()
Gets the default variable class name applied to virtual variable types.

Returns:
the default variable class name.

setDefaultVariableClassName

void setDefaultVariableClassName(String className)
Sets the default variable class name applied to virtual variable types.

Parameters:
className - the default variable class name.

isLocalizedVariables

boolean isLocalizedVariables()
Checks whether variables in this registry are localized.

Returns:
true if localized, otherwise false.

setLocalizedVariables

void setLocalizedVariables(boolean flag)
Sets whether variables in this registry are localized.

Parameters:
flag - true if localized, otherwise false.

isTypeRegistered

boolean isTypeRegistered(String type)
Checks whether the specified variable type is registered.

Parameters:
type - the variable type.
Returns:
true if the type is registered, otherwise false.

getAttributeList

List getAttributeList(String type)
Gets a registered attribute list of cloned and unlocked attributes of the specified variable type. Both the list and the attributes may be modified and re-registered after modifications.

Parameters:
type - the variable type.
Returns:
a list of MBeanAttributeInfo instances or null.

getAttributeMap

OrderedMap getAttributeMap(String type)
Gets a registered attribute map of locked attributes of the specified variable type.

Parameters:
type - the variable type.
Returns:
a read-only map of MBeanAttributeInfo instances or null.

getAttributeInfo

Collection getAttributeInfo(String type)
Gets a registered attribute collection of locked attributes of the specified variable type.

Parameters:
type - the variable type.
Returns:
a read-only collection of MBeanAttributeInfo instances or null.

setAttributeInfo

void setAttributeInfo(String type,
                      Collection attributes)
Sets registered attributes of the specified variable type.

Parameters:
type - the variable type.
attributes - a collection of MBeanAttributeInfo instances.

getVariableClassName

String getVariableClassName(String type)
Gets the variable class name of the specified variable type.

Parameters:
type - the variable type.
Returns:
the variable class name or null.

setVariableClassName

void setVariableClassName(String type,
                          String className)
Sets the variable class name of the specified variable type.

The variable class has to implement the Variable interface and provide a constructor with three parameters. The first one for the MBean server of type javax.management.MBeanServer, the second one for the object name of the variable registry of type javax.management.ObjectName and the third one for the variable type of type java.lang.String.

If the named variable class is not available, it will be dynamically defined to be a subclass of VariableX.

Parameters:
type - the variable type.
className - the variable class name or null.

getImporterClassName

String getImporterClassName(String type)
Gets the importer class name of the specified variable type.

Parameters:
type - the variable type.
Returns:
the importer class name or null.

setImporterClassName

void setImporterClassName(String type,
                          String className)
Sets the importer class name of the specified variable type.

The importer class has to implement the AttributeImporter interface.

Parameters:
type - the variable type.
className - the importer class name or null.

getAttributeImporter

AttributeImporter getAttributeImporter(String type)
Gets the registered importer of the specified variable type.

Parameters:
type - the variable type.
Returns:
the importer or null.

setAttributeImporter

void setAttributeImporter(String type,
                          AttributeImporter importer)
Sets the registered importer of the specified variable type.

Parameters:
type - the variable type.
importer - the importer or null.

getExporterClassName

String getExporterClassName(String type)
Gets the exporter class name of the specified variable type.

Parameters:
type - the variable type.
Returns:
the exporter class name or null.

setExporterClassName

void setExporterClassName(String type,
                          String className)
Sets the exporter class name of the specified variable type.

The exporter class has to implement the AttributeExporter interface.

Parameters:
type - the variable type.
className - the exporter class name or null.

getAttributeExporter

AttributeExporter getAttributeExporter(String type)
Gets the registered exporter of the specified variable type.

Parameters:
type - the variable type.
Returns:
the exporter or null.

setAttributeExporter

void setAttributeExporter(String type,
                          AttributeExporter exporter)
Sets the registered exporter of the specified variable type.

Parameters:
type - the variable type.
exporter - the exporter or null.

getValidatorClassName

String getValidatorClassName(String type)
Gets the validator class name of the specified variable type.

Parameters:
type - the variable type.
Returns:
the validator class name or null.

setValidatorClassName

void setValidatorClassName(String type,
                           String className)
Sets the validator class name of the specified variable type.

The validator class has to implement the AttributeValidator interface.

Parameters:
type - the variable type.
className - the validator class name or null.

getAttributeValidator

AttributeValidator getAttributeValidator(String type)
Gets the registered validator of the specified variable type.

Parameters:
type - the variable type.
Returns:
the validator or null.

setAttributeValidator

void setAttributeValidator(String type,
                           AttributeValidator validator)
Sets the registered validator of the specified variable type.

Parameters:
type - the variable type.
validator - the validator or null.

getNamePattern

ObjectName getNamePattern(String type)
Gets the name pattern of the specified variable type.

Parameters:
type - the variable type.
Returns:
the name pattern or null.

setNamePattern

void setNamePattern(String type,
                    ObjectName pattern)
Sets the name pattern of the specified variable type.

Parameters:
type - the variable type.
pattern - the name pattern or null.

setAttributeInfo

void setAttributeInfo(String type,
                      String className,
                      Collection attributes)
Sets registered attributes and a variable class for the specified variable type.

Parameters:
type - the variable type.
className - the variable class name.
attributes - a collection of MBeanAttributeInfo instances.
Throws:
ClassCastException - if class name is invalid.

setAttributeInfo

void setAttributeInfo(String type,
                      Collection attributes,
                      String validatorClassName)
Sets registered attributes and a validator class for the specified variable type.

Parameters:
type - the variable type.
attributes - a collection of MBeanAttributeInfo instances.
validatorClassName - the validator class name.
Throws:
ClassCastException - if class name is invalid.

setAttributeInfo

void setAttributeInfo(String type,
                      String className,
                      Collection attributes,
                      String validatorClassName)
Sets registered attributes, a variable class and a validator class for the specified variable type.

Parameters:
type - the variable type.
className - the variable class name.
attributes - a collection of MBeanAttributeInfo instances.
validatorClassName - the validator class name.
Throws:
ClassCastException - if class name is invalid.

setAttributeInfo

void setAttributeInfo(String type,
                      String className,
                      Collection attributes,
                      String validatorClassName,
                      ObjectName pattern)
Sets registered attributes, a variable class, a validator class and an optional object name pattern for the specified variable type.

Parameters:
type - the variable type.
className - the variable class name.
attributes - a collection of MBeanAttributeInfo instances.
validatorClassName - the validator class name.
pattern - an optional object name pattern.
Throws:
ClassCastException - if class name is invalid.

setAttributeInfo

void setAttributeInfo(String type,
                      String className,
                      String importerClassName,
                      String exporterClassName,
                      Collection attributes,
                      String validatorClassName,
                      ObjectName pattern)
Sets registered attributes, a variable class, an importer class, an exporter class, a validator class and an optional object name pattern for the specified variable type.

Parameters:
type - the variable type.
className - the variable class name.
importerClassName - the importer class name.
exporterClassName - the exporter class name.
attributes - a collection of MBeanAttributeInfo instances.
validatorClassName - the validator class name.
pattern - an optional object name pattern.
Throws:
ClassCastException - if class name is invalid.

removeAttributeInfo

void removeAttributeInfo(String type)
Removes registered attributes of the specified variable type.

Parameters:
type - the variable type.

clearAllTypes

void clearAllTypes()
Clears registered attributes of all variable types.


typeSet

Set typeSet()
Returns a read-only set of registered variable types.

Returns:
a type set.

typeSet

Set typeSet(String prefix)
Returns a set of registered variable types with the given prefix. Types starting with the given prefix followed by any dot separated item are included in the set. The prefix remains in the returned types.

Parameters:
prefix - a prefix.
Returns:
a type set.

defineVariableClass

Class defineVariableClass(String className)
                          throws ClassNotFoundException,
                                 ClassFormatError
Defines a new variable of the named class. The defined class extends the default variable implementation.

Parameters:
className - the class name of the variable.
Returns:
the defined class.
Throws:
ClassNotFoundException - for missing classes.
ClassFormatError - if the class hierarchy is invalid.

defineVariableClass

Class defineVariableClass(String className,
                          String superName)
                          throws ClassNotFoundException,
                                 ClassFormatError
Defines a new variable of the named class extending the named super class.

Parameters:
className - the class name of the variable.
superName - the super class name.
Returns:
the defined class.
Throws:
ClassNotFoundException - for missing classes.
ClassFormatError - if the class hierarchy is invalid.

defineVariableClass

Class defineVariableClass(String className,
                          Class superClass)
                          throws ClassFormatError
Defines a new variable of the named class extending the specified super class. The base class must implement the Variable interface and support the default constructor and the registry constructor with two arguments: MBeanReference registry, String type.

Parameters:
className - the class name of the variable.
superClass - the super class.
Returns:
the defined class.
Throws:
ClassFormatError - if the class hierarchy is invalid.

createVariable

Variable createVariable(String type)
                        throws ConstructionException
Creates a new variable instance of the specified type.

Parameters:
type - the type of the variable.
Returns:
the variable instance.
Throws:
ConstructionException - if construction fails.


Copyright © 2004 The Norther Organization. All rights reserved.