org.apache.avalon.meta.info
Class InfoDescriptor

java.lang.Object
  extended byorg.apache.avalon.meta.info.Descriptor
      extended byorg.apache.avalon.meta.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:
$Revision: 1.8 $ $Date: 2003/12/14 14:11:00 $
Author:
Avalon Development Team
See Also:
Serialized Form

Field Summary
static int CONSERVATIVE
           
static String CONSERVATIVE_KEY
           
static int DEMOCRAT
           
static String DEMOCRAT_KEY
           
static int HARD
           
static String HARD_KEY
           
static int LIBERAL
           
static String LIBERAL_KEY
           
static String POOLED
           
static String SINGLETON
           
static int SOFT
           
static String SOFT_KEY
           
static String THREAD
           
static String TRANSIENT
           
static int UNDEFINED
           
static int WEAK
           
static String WEAK_KEY
           
 
Constructor Summary
InfoDescriptor(String name, String classname, Version version, String lifestyle, String collection, String schema, 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.
 int getCollectionPolicy()
          Return the component termination policy as a String.
static int getCollectionPolicy(String policy)
           
static String getCollectionPolicyKey(int policy)
           
 String getConfigurationSchema()
          Return the configuration schema.
 String getLifestyle()
          Return the component lifestyle.
 String getName()
          Return the symbolic name of component.
 Version getVersion()
          Return the version of component.
 int hashCode()
          Return the hashcode for the object.
 boolean isConservative()
          Test is the component type implements a coservative collection policy.
 boolean isDemocrat()
          Test is the component type implements a democrat collection policy.
 boolean isLiberal()
          Test is the component type implements a liberal collection policy.
 String toString()
          Return a string representation of the info descriptor.
 
Methods inherited from class org.apache.avalon.meta.info.Descriptor
getAttribute, getAttribute, getAttributeNames, getProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRANSIENT

public static final String TRANSIENT
See Also:
Constant Field Values

SINGLETON

public static final String SINGLETON
See Also:
Constant Field Values

THREAD

public static final String THREAD
See Also:
Constant Field Values

POOLED

public static final String POOLED
See Also:
Constant Field Values

LIBERAL_KEY

public static final String LIBERAL_KEY
See Also:
Constant Field Values

DEMOCRAT_KEY

public static final String DEMOCRAT_KEY
See Also:
Constant Field Values

CONSERVATIVE_KEY

public static final String CONSERVATIVE_KEY
See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
See Also:
Constant Field Values

LIBERAL

public static final int LIBERAL
See Also:
Constant Field Values

DEMOCRAT

public static final int DEMOCRAT
See Also:
Constant Field Values

CONSERVATIVE

public static final int CONSERVATIVE
See Also:
Constant Field Values

WEAK_KEY

public static final String WEAK_KEY
See Also:
Constant Field Values

SOFT_KEY

public static final String SOFT_KEY
See Also:
Constant Field Values

HARD_KEY

public static final String HARD_KEY
See Also:
Constant Field Values

WEAK

public static final int WEAK
See Also:
Constant Field Values

SOFT

public static final int SOFT
See Also:
Constant Field Values

HARD

public static final int HARD
See Also:
Constant Field Values
Constructor Detail

InfoDescriptor

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

Parameters:
name - the component name
classname - the implemetation classname
version - the implementation version
attributes - a set of attributes associated with the component type
Throws:
IllegalArgumentException - if the implementation key is not a classname
Since:
1.2
Method Detail

getName

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

Returns:
the symbolic name of component.

getCollectionPolicy

public int getCollectionPolicy()
Return the component termination policy as a String.

Returns:
the policy

isLiberal

public boolean isLiberal()
Test is the component type implements a liberal collection policy.

Returns:
the policy

isDemocrat

public boolean isDemocrat()
Test is the component type implements a democrat collection policy.

Returns:
the policy

isConservative

public boolean isConservative()
Test is the component type implements a coservative collection policy.

Returns:
the policy

getConfigurationSchema

public String getConfigurationSchema()
Return the configuration schema.

Returns:
the schema declaration (possibly null)

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.

getLifestyle

public String getLifestyle()
Return the component lifestyle.

Returns:
the lifestyle

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 object to compare this object with
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

getCollectionPolicyKey

public static String getCollectionPolicyKey(int policy)

getCollectionPolicy

public static int getCollectionPolicy(String policy)


Copyright © Apache Software Foundation. All Rights Reserved.