org.apache.avalon.fortress
Class MetaInfoEntry

java.lang.Object
  extended byorg.apache.avalon.fortress.MetaInfoEntry

public final class MetaInfoEntry
extends java.lang.Object

Keeps track of the relationship of all the associated meta data for a component type. It records all the roles, short name, component class, and the handler class used to manage it. The short name is included strictly to enable "self-healing" configuration files.

Version:
$Revision: 1.10 $ $Date: 2004/02/28 15:16:24 $
Author:
Avalon Development Team

Field Summary
static java.lang.String FACTORY_HANDLER
           
static java.lang.String PER_THREAD_HANDLER
           
static java.lang.String POOLABLE_HANDLER
           
static java.lang.String THREADSAFE_HANDLER
           
 
Constructor Summary
MetaInfoEntry(java.lang.Class componentClass, java.util.Properties properties, java.util.List deps)
          Create a MetaInfoEntry from the supplied component class, and the supplied meta information.
MetaInfoEntry(RoleEntry roleEntry)
          Create a MetaInfoEntry from the supplied RoleEntry.
 
Method Summary
 void addRole(java.lang.String role)
          Add a service/role for the component entry.
 boolean containsRole(java.lang.String role)
          Tests to see if a component exposes a role.
static java.lang.String createShortName(java.lang.String className)
          Convert a Component implmentation classname into a shorthand name.
 java.lang.Class getComponentClass()
          Get the Class for the component type.
 java.lang.String getConfigurationName()
          Get the configuration name for the component type.
 java.util.List getDependencies()
          Get a reference to the dependencies list.
 java.lang.Class getHandlerClass()
          Get the Class for the component type's ComponentHandler.
 java.util.Iterator getRoles()
          Get an iterator for all the roles.
 void makeReadOnly()
          Make the component entry read only, so no more services can be added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THREADSAFE_HANDLER

public static final java.lang.String THREADSAFE_HANDLER
See Also:
Constant Field Values

POOLABLE_HANDLER

public static final java.lang.String POOLABLE_HANDLER
See Also:
Constant Field Values

FACTORY_HANDLER

public static final java.lang.String FACTORY_HANDLER
See Also:
Constant Field Values

PER_THREAD_HANDLER

public static final java.lang.String PER_THREAD_HANDLER
See Also:
Constant Field Values
Constructor Detail

MetaInfoEntry

public MetaInfoEntry(java.lang.Class componentClass,
                     java.util.Properties properties,
                     java.util.List deps)
              throws java.lang.ClassNotFoundException
Create a MetaInfoEntry from the supplied component class, and the supplied meta information.

Parameters:
componentClass - The Class for the component type
properties - The Properties object for meta info
Throws:
java.lang.ClassNotFoundException - if the component handler class could not be found

MetaInfoEntry

public MetaInfoEntry(RoleEntry roleEntry)
Create a MetaInfoEntry from the supplied RoleEntry.

Parameters:
roleEntry - The RoleEntry to convert
Method Detail

makeReadOnly

public void makeReadOnly()
Make the component entry read only, so no more services can be added.


getComponentClass

public java.lang.Class getComponentClass()
Get the Class for the component type.

Returns:
the Class

getHandlerClass

public java.lang.Class getHandlerClass()
Get the Class for the component type's ComponentHandler.

Returns:
the Class

getConfigurationName

public java.lang.String getConfigurationName()
Get the configuration name for the component type. This is used in "self-healing" configuration files.

Returns:
the config name

addRole

public void addRole(java.lang.String role)
Add a service/role for the component entry.

Parameters:
role - The new role
Throws:
java.lang.SecurityException - if this MetaInfoEntry is read-only

containsRole

public boolean containsRole(java.lang.String role)
Tests to see if a component exposes a role.

Parameters:
role - The role to check
Returns:
true if it does

getRoles

public java.util.Iterator getRoles()
Get an iterator for all the roles.

Returns:
the iterator

getDependencies

public java.util.List getDependencies()
Get a reference to the dependencies list.

Returns:
the dependency list

createShortName

public static final java.lang.String createShortName(java.lang.String className)
Convert a Component implmentation classname into a shorthand name. It assumes all classnames for a particular component is unique.

Parameters:
className - The classname of a component
Returns:
String the short name


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.