org.apache.avalon.composition.model
Interface TypeRepository


public interface TypeRepository

A type manager implemetation provides support for the creation, storage and retrival of component types.

Version:
$Revision: 1.2 $ $Date: 2003/10/04 11:53:04 $
Author:
Avalon Development Team

Method Summary
 DeploymentProfile getProfile(Type type, String key)
          Return a deployment profile for the supplied type and key.
 DeploymentProfile[] getProfiles(Type type)
          Return the set of deployment profiles for the supplied type.
 Type getType(Class clazz)
          Locate a Type instances associated with the supplied implementation classname.
 Type getType(String classname)
          Locate a Type instances associated with the supplied implementation classname.
 Type[] getTypes()
          Return all availble types.
 Type[] getTypes(boolean policy)
          Return all the types available within the repository.
 Type[] getTypes(DependencyDescriptor dependency)
          Locate the set of component types capable of services the supplied dependency.
 Type[] getTypes(StageDescriptor stage)
          Locate the set of component types that provide the supplied extension.
 

Method Detail

getTypes

public Type[] getTypes()
Return all availble types.

Returns:
the array of types

getTypes

public Type[] getTypes(boolean policy)
Return all the types available within the repository.

Parameters:
policy - if TRUE, return all available types, if FALSE return only the locally established types.
Returns:
the array of types

getType

public Type getType(Class clazz)
             throws TypeUnknownException
Locate a Type instances associated with the supplied implementation classname.

Parameters:
clazz - the component type implementation class.
Returns:
the type matching the supplied implementation classname.
Throws:
UnknownTypeException - if a matching type cannot be found
TypeUnknownException

getType

public Type getType(String classname)
             throws TypeUnknownException
Locate a Type instances associated with the supplied implementation classname.

Parameters:
classname - the component type implementation class name.
Returns:
the type matching the supplied implementation classname.
Throws:
UnknownTypeException - if a matching type cannot be found
TypeUnknownException

getTypes

public Type[] getTypes(DependencyDescriptor dependency)
Locate the set of component types capable of services the supplied dependency.

Parameters:
dependency - a service dependency descriptor
Returns:
a set of types capable of servicing the supplied dependency

getTypes

public Type[] getTypes(StageDescriptor stage)
Locate the set of component types that provide the supplied extension.

Parameters:
stage - a stage descriptor
Returns:
a set of types that support the supplied stage

getProfiles

public DeploymentProfile[] getProfiles(Type type)
                                throws TypeUnknownException
Return the set of deployment profiles for the supplied type. An implementation is required to return a array of types > 0 in length or throw a TypeUnknownException.

Parameters:
type - the type
Returns:
a profile array containing at least one deployment profile
Throws:
TypeUnknownException - if the supplied type is unknown

getProfile

public DeploymentProfile getProfile(Type type,
                                    String key)
                             throws TypeUnknownException,
                                    ProfileUnknownException
Return a deployment profile for the supplied type and key.

Parameters:
type - the type
key - the profile name
Returns:
a profile matching the supplied key
Throws:
TypeUnknownException - if the supplied type is unknown
ProfileUnknownException - if the supplied key is unknown


Copyright © Apache Software Foundation. All Rights Reserved.