net.dpml.metro.info
Class Type

java.lang.Object
  extended bynet.dpml.lang.AbstractDirective
      extended bynet.dpml.metro.info.Type
All Implemented Interfaces:
Serializable

public class Type
extends AbstractDirective
implements Serializable

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

Version:
1.0.0
Author:
Digital Product Meta Library
See Also:
Serialized Form

Constructor Summary
Type(InfoDescriptor info, CategoryDescriptor[] loggers, ContextDescriptor context, ServiceDescriptor[] services, State graph)
          Creation of a new Type instance using a supplied component descriptor, logging, context, services, and part references.
 
Method Summary
static Type createType(Class subject)
          Utility operation to construct a default type given a supplied class.
 boolean equals(Object other)
          Test is the supplied object is equal to this object.
 CategoryDescriptor[] getCategoryDescriptors()
          Return the set of Logger that this Component will use.
 ContextDescriptor getContextDescriptor()
          Return the ContextDescriptor for component.
 InfoDescriptor getInfo()
          Return the info descriptor.
 ServiceDescriptor getServiceDescriptor(ServiceDescriptor reference)
          Retrieve a service descriptor matching the supplied reference.
 ServiceDescriptor getServiceDescriptor(String classname)
          Retrieve a service descriptor matching the supplied classname.
 ServiceDescriptor[] getServiceDescriptors()
          Get the set of service descriptors defining the set of services that the component type exports.
 State getStateGraph()
          Return the state graph for the component type.
 int hashCode()
          Return the hashcode for the object.
 boolean isaCategory(String name)
          Return TRUE if the logging categories includes a category with a matching name.
 String toString()
          Return a string representation of the type.
 
Methods inherited from class net.dpml.lang.AbstractDirective
equals, hashArray, hashValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Type

public Type(InfoDescriptor info,
            CategoryDescriptor[] loggers,
            ContextDescriptor context,
            ServiceDescriptor[] services,
            State graph)
     throws NullPointerException
Creation of a new Type instance using a supplied component descriptor, logging, context, services, and part references.

Parameters:
info - 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
graph - the state graph
Throws:
NullPointerException - if the info, loggers, state, or context is null
Method Detail

getStateGraph

public State getStateGraph()
Return the state graph for the component type.

Returns:
the state graph

getInfo

public InfoDescriptor getInfo()
Return the info descriptor.

Returns:
the component info descriptor.

getCategoryDescriptors

public CategoryDescriptor[] getCategoryDescriptors()
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 logging categories includes a category with a matching name.

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

getContextDescriptor

public ContextDescriptor getContextDescriptor()
Return the ContextDescriptor for component.

Returns:
the ContextDescriptor for component.

getServiceDescriptors

public ServiceDescriptor[] getServiceDescriptors()
Get the set of service descriptors defining the set of services that the component type exports.

Returns:
the array of service descriptors

getServiceDescriptor

public ServiceDescriptor getServiceDescriptor(ServiceDescriptor reference)
Retrieve a service descriptor matching the supplied reference.

Parameters:
reference - a service descriptor to match against
Returns:
a matching service descriptor or null if no match found

getServiceDescriptor

public ServiceDescriptor getServiceDescriptor(String classname)
Retrieve a service descriptor matching the supplied classname.

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

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.

Overrides:
equals in class AbstractDirective
Parameters:
other - the other object
Returns:
true if the object are equivalent

hashCode

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

Overrides:
hashCode in class AbstractDirective
Returns:
the hashcode value

createType

public static Type createType(Class subject)
                       throws IntrospectionException
Utility operation to construct a default type given a supplied class.

Parameters:
subject - the component implementation class
Returns:
the type descriptor for the class
Throws:
IntrospectionException - if an introspection error occurs