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.6 $ $Date: 2004/02/21 23:54:42 $
Author:
Avalon Development Team

Method Summary
 DeploymentProfile getProfile(DependencyDescriptor dependency, boolean search)
          Attempt to locate a packaged deployment profile meeting the supplied dependency description.
 ComponentProfile getProfile(Type type, String key)
          Return a deployment profile for the supplied type and key.
 DeploymentProfile[] getProfiles(DependencyDescriptor dependency, boolean search)
          Return a set of local deployment profile for the supplied dependency.
 ComponentProfile[] 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(DependencyDescriptor dependency, boolean search)
          Locate the set of component types capable of services the supplied dependency.
 Type[] getTypes(ReferenceDescriptor reference)
          Locate the set of component types capable of services the supplied reference.
 Type[] getTypes(ReferenceDescriptor reference, boolean search)
          Locate the set of component types capable of services the supplied reference.
 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(DependencyDescriptor dependency,
                       boolean search)
Locate the set of component types capable of services the supplied dependency.

Parameters:
dependency - a service dependency descriptor
search - if TRUE then search for solution using the parent repository
Returns:
a set of types capable of servicing the supplied dependency

getTypes

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

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

getTypes

public Type[] getTypes(ReferenceDescriptor reference,
                       boolean search)
Locate the set of component types capable of services the supplied reference.

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

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 ComponentProfile[] 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 ComponentProfile 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

getProfile

public DeploymentProfile getProfile(DependencyDescriptor dependency,
                                    boolean search)
Attempt to locate a packaged deployment profile meeting the supplied dependency description.

Parameters:
dependency - the dependency description
search - include profiles from parent repository in selection
Returns:
the deployment profile (possibly null)

getProfiles

public DeploymentProfile[] getProfiles(DependencyDescriptor dependency,
                                       boolean search)
Return a set of local deployment profile for the supplied dependency.

Parameters:
dependency - the dependency descriptor
search - include profiles from parent repository in selection
Returns:
a set of profiles matching the supplied dependency


Copyright © The Apache Software Foundation. All Rights Reserved.