org.apache.avalon.meta.info
Class Type

java.lang.Object
  extended byorg.apache.avalon.meta.info.Type
All Implemented Interfaces:
Serializable

public class Type
extends Object
implements Serializable

This class contains the meta information about a particular component type. It describes;

UML

Version:
$Revision: 1.2 $ $Date: 2003/10/17 02:03:06 $
Author:
Avalon Development Team
See Also:
Serialized Form

Constructor Summary
Type(InfoDescriptor descriptor, CategoryDescriptor[] loggers, ContextDescriptor context, ServiceDescriptor[] services, DependencyDescriptor[] dependencies, StageDescriptor[] stages, ExtensionDescriptor[] extensions)
          Creation of a new Type instance using a supplied component descriptor, logging, cotext, services, depedencies, stages and extension descriptors.
Type(InfoDescriptor descriptor, CategoryDescriptor[] loggers, ContextDescriptor context, ServiceDescriptor[] services, DependencyDescriptor[] dependencies, StageDescriptor[] stages, ExtensionDescriptor[] extensions, Configuration defaults)
          Creation of a new Type instance using a supplied component descriptor, logging, cotext, services, depedencies, stages and extension descriptors.
 
Method Summary
 boolean equals(Object other)
          Test is the supplied object is equal to this object.
 CategoryDescriptor[] getCategories()
          Return the set of Logger that this Component will use.
 Configuration getConfiguration()
          Returns the default configuration supplied with the type.
 ContextDescriptor getContext()
          Return the ContextDescriptor for component, may be null.
 DependencyDescriptor[] getDependencies()
          Return the set of Dependencies that this component requires to operate.
 DependencyDescriptor getDependency(String key)
          Retrieve a dependency with a particular role.
 ExtensionDescriptor getExtension(StageDescriptor stage)
          Return the extension supporting the supplied stage.
 ExtensionDescriptor getExtension(String key)
          Return the extension supporting the supplied stage.
 ExtensionDescriptor[] getExtensions()
          Return the stages extension handling provided by this extension.
 InfoDescriptor getInfo()
          Return the Component descriptor.
 ServiceDescriptor getService(ReferenceDescriptor reference)
          Retrieve a service with a particular reference.
 ServiceDescriptor getService(String classname)
          Retrieve a service with a particular classname.
 ServiceDescriptor[] getServices()
          Return the set of Services that this component is capable of providing.
 StageDescriptor[] getStages()
          Return the lifecycle stages extensions required by this component type.
 int hashCode()
          Return the hashcode for the object.
 boolean isaCategory(String name)
          Return TRUE if the set of Logger descriptors includes the supplied name.
 String toString()
          Return a string representation of the type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Type

public Type(InfoDescriptor descriptor,
            CategoryDescriptor[] loggers,
            ContextDescriptor context,
            ServiceDescriptor[] services,
            DependencyDescriptor[] dependencies,
            StageDescriptor[] stages,
            ExtensionDescriptor[] extensions)
     throws NullPointerException
Creation of a new Type instance using a supplied component descriptor, logging, cotext, services, depedencies, stages and extension descriptors.

Parameters:
descriptor - a component descriprot that contains information about the component type
loggers - a set of logger descriptors the declare the logging channels required by the type
context - a component context descriptor that declares the context type and context entry key and value classnames
services - a set of service descriptors that detail the service that this component type is capable of supplying
dependencies - a set of depedency descriptors that detail the service that this component type is depedent on
stages - a set of stage descriprors that detail the extension stage interfaces that this component requires a handler for
extensions - a set of lifecycle extension capabilities that this componet can provide to its container during the process of stage suppier resolution
Throws:
NullPointerException - if the descriptor, loggers, context, services, dependencies, stages, or extensions argument is null
Since:
1.1

Type

public Type(InfoDescriptor descriptor,
            CategoryDescriptor[] loggers,
            ContextDescriptor context,
            ServiceDescriptor[] services,
            DependencyDescriptor[] dependencies,
            StageDescriptor[] stages,
            ExtensionDescriptor[] extensions,
            Configuration defaults)
     throws NullPointerException
Creation of a new Type instance using a supplied component descriptor, logging, cotext, services, depedencies, stages and extension descriptors.

Parameters:
descriptor - a component descriprot that contains information about the component type
loggers - a set of logger descriptors the declare the logging channels required by the type
context - a component context descriptor that declares the context type and context entry key and value classnames
services - a set of service descriprors that detail the service that this component type is capable of supplying
dependencies - a set of depedency descriprors that detail the service that this component type is depedent on
stages - a set of stage descriprors that detail the extensiuon stage interfaces that this component requires a handler for
extensions - a set of lifecycle extension capabilities that this componet can provide to its container during the process of stage suppier resolution
Throws:
NullPointerException - if the descriptor, loggers, context, services, dependencies, stages, or extensions argument is null
Method Detail

getInfo

public InfoDescriptor getInfo()
Return the Component descriptor.

Returns:
the Component descriptor.

getCategories

public CategoryDescriptor[] getCategories()
Return the set of Logger that this Component will use.

Returns:
the set of Logger that this Component will use.

isaCategory

public boolean isaCategory(String name)
Return TRUE if the set of Logger descriptors includes the supplied name.

Parameters:
name - the logging subcategory name
Returns:
TRUE if the logging subcategory is declared.

getContext

public ContextDescriptor getContext()
Return the ContextDescriptor for component, may be null. If null then this component does not implement Contextualizable.

Returns:
the ContextDescriptor for component, may be null.

getServices

public ServiceDescriptor[] getServices()
Return the set of Services that this component is capable of providing.

Returns:
the set of Services that this component is capable of providing.

getService

public ServiceDescriptor getService(ReferenceDescriptor reference)
Retrieve a service with a particular reference.

Parameters:
reference - a service reference descriptor
Returns:
the service descriptor or null if it does not exist

getService

public ServiceDescriptor getService(String classname)
Retrieve a service with a particular classname.

Parameters:
classname - the service classname
Returns:
the service descriptor or null if it does not exist

getDependencies

public DependencyDescriptor[] getDependencies()
Return the set of Dependencies that this component requires to operate.

Returns:
the set of Dependencies that this component requires to operate.

getDependency

public DependencyDescriptor getDependency(String key)
Retrieve a dependency with a particular role.

Parameters:
key - the service key
Returns:
the dependency or null if it does not exist

getConfiguration

public Configuration getConfiguration()
Returns the default configuration supplied with the type.

Returns:
the default configuration or null if no packaged defaults

getStages

public StageDescriptor[] getStages()
Return the lifecycle stages extensions required by this component type.

Returns:
an array of stage descriptors.

getExtensions

public ExtensionDescriptor[] getExtensions()
Return the stages extension handling provided by this extension.

Returns:
an array of extension descriptors.

getExtension

public ExtensionDescriptor getExtension(StageDescriptor stage)
Return the extension supporting the supplied stage.

Parameters:
stage - the lifecycle stage that this type requires a handler for
Returns:
a matching extension or null if no matching extension

getExtension

public ExtensionDescriptor getExtension(String key)
Return the extension supporting the supplied stage.

Parameters:
key - the lifecycle stage that this type requires a handler for
Returns:
a matching extension or null if no matching extension

toString

public String toString()
Return a string representation of the type.

Returns:
the stringified type

equals

public boolean equals(Object other)
Test is the supplied object is equal to this object.

Returns:
true if the object are equivalent

hashCode

public int hashCode()
Return the hashcode for the object.

Returns:
the hashcode value


Copyright © Apache Software Foundation. All Rights Reserved.