net.dpml.metro.info
Class InfoDescriptor

java.lang.Object
  extended bynet.dpml.metro.info.Descriptor
      extended bynet.dpml.metro.info.InfoDescriptor
All Implemented Interfaces:
Serializable

public final class InfoDescriptor
extends Descriptor

This class is used to provide explicit information to assembler and administrator about the Component. It includes information such as;

The InfoDescriptor also includes an arbitrary set of attributes about component. Usually these are container specific attributes that can store arbitrary information. The attributes should be stored with keys based on package name of container.

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

Constructor Summary
InfoDescriptor(String name, String classname)
          Creation of a new info descriptor using a supplied name, key, version and attribute set.
InfoDescriptor(String name, String classname, Version version, LifestylePolicy lifestyle, CollectionPolicy collection, ThreadSafePolicy threadsafe, Properties attributes)
          Creation of a new info descriptor using a supplied name, key, version and attribute set.
 
Method Summary
 boolean equals(Object other)
          Test is the supplied object is equal to this object.
 String getClassname()
          Return the implementation class name for the component type.
 CollectionPolicy getCollectionPolicy()
          Return the component collection policy.
 LifestylePolicy getLifestylePolicy()
          Return the component lifestyle policy.
 String getName()
          Return the symbolic name of component.
 ThreadSafePolicy getThreadSafePolicy()
          Ruturn the thread-safe policy value.
 Version getVersion()
          Return the version of component.
 int hashCode()
          Return the hashcode for the object.
 boolean isHard()
          Test is the component type implements a hard collection policy.
 boolean isSoft()
          Test is the component type implements a soft collection policy.
 boolean isThreadSafe()
          Ruturn the thread-safe status.
 boolean isWeak()
          Test is the component type implements a weak collection policy.
 String toString()
          Return a string representation of the info descriptor.
 
Methods inherited from class net.dpml.metro.info.Descriptor
getAttribute, getAttribute, getAttributeNames, getProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InfoDescriptor

public InfoDescriptor(String name,
                      String classname)
               throws IllegalArgumentException,
                      NullPointerException
Creation of a new info descriptor using a supplied name, key, version and attribute set.

Parameters:
name - the default component name
classname - the implemetation classname
Throws:
IllegalArgumentException - if the classname is invalid
NullPointerException - if the classname is null

InfoDescriptor

public InfoDescriptor(String name,
                      String classname,
                      Version version,
                      LifestylePolicy lifestyle,
                      CollectionPolicy collection,
                      ThreadSafePolicy threadsafe,
                      Properties attributes)
               throws IllegalArgumentException,
                      NullPointerException
Creation of a new info descriptor using a supplied name, key, version and attribute set.

Parameters:
name - the default component name
classname - the implemetation classname
version - the implementation version
lifestyle - the component lifestyle (singleton, thread, etc.)
collection - the garbage collection policy for the component
threadsafe - if TRUE the type is declaring itself as threadsafe
attributes - a set of attributes associated with the component type
Throws:
IllegalArgumentException - if the implementation classname is invalid
NullPointerException - if the classname argument is null.
Method Detail

getName

public String getName()
Return the symbolic name of component.

Returns:
the symbolic name of component.

getCollectionPolicy

public CollectionPolicy getCollectionPolicy()
Return the component collection policy.

Returns:
the policy

isWeak

public boolean isWeak()
Test is the component type implements a weak collection policy.

Returns:
TRUE if the policy is weak

isSoft

public boolean isSoft()
Test is the component type implements a soft collection policy.

Returns:
TRUE if the policy is soft

isHard

public boolean isHard()
Test is the component type implements a hard collection policy.

Returns:
TRUE if the policy is hard

getClassname

public String getClassname()
Return the implementation class name for the component type.

Returns:
the implementation class name

getVersion

public Version getVersion()
Return the version of component.

Returns:
the version of component.

getLifestylePolicy

public LifestylePolicy getLifestylePolicy()
Return the component lifestyle policy.

Returns:
the lifestyle policy

isThreadSafe

public boolean isThreadSafe()
Ruturn the thread-safe status.

Returns:
the thread-safe status

getThreadSafePolicy

public ThreadSafePolicy getThreadSafePolicy()
Ruturn the thread-safe policy value.

Returns:
the thread-safe policy value

toString

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

Returns:
the stringified type

equals

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

Overrides:
equals in class Descriptor
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 Descriptor
Returns:
the hashcode value