org.apache.avalon.composition.model.impl
Class DefaultModelRepository

java.lang.Object
  extended byorg.apache.avalon.composition.model.impl.DefaultModelRepository
All Implemented Interfaces:
ModelRepository

public class DefaultModelRepository
extends Object
implements ModelRepository

The model repository interface declares operations through which clients may resolve registered model instances relative to a stage or service dependencies.

Version:
$Revision: 1.6 $ $Date: 2004/02/24 22:18:22 $
Author:
Avalon Development Team

Constructor Summary
DefaultModelRepository(ModelRepository parent, Logger logger)
           
 
Method Summary
 void addModel(DeploymentModel model)
          Add an model to the repository.
 void addModel(String name, DeploymentModel model)
          Add an model to the repository.
 DeploymentModel[] getCandidateProviders(DependencyDescriptor dependency)
          Locate all models meeting the supplied dependency criteria.
 DeploymentModel[] getCandidateProviders(ReferenceDescriptor reference)
          Locate all models meeting the supplied service reference criteria.
 DeploymentModel[] getCandidateProviders(StageDescriptor stage)
          Locate all models meeting the supplied criteria.
 DeploymentModel getModel(DependencyDescriptor dependency)
          Locate an model meeting the supplied criteria.
 DeploymentModel getModel(ReferenceDescriptor reference)
          Locate an model meeting the supplied criteria.
 DeploymentModel getModel(StageDescriptor stage)
          Locate a model meeting the supplied criteria.
 DeploymentModel getModel(String name)
          Locate a local model matching the supplied name.
 DeploymentModel[] getModels()
          Return a sequence of all of the local models.
 void removeModel(DeploymentModel model)
          Remove an model from the repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModelRepository

public DefaultModelRepository(ModelRepository parent,
                              Logger logger)
Method Detail

getModel

public DeploymentModel getModel(DependencyDescriptor dependency)
Locate an model meeting the supplied criteria.

Specified by:
getModel in interface ModelRepository
Parameters:
dependency - a component service dependency
Returns:
the model or null if no matching model is resolved

getModel

public DeploymentModel getModel(ReferenceDescriptor reference)
Locate an model meeting the supplied criteria.

Specified by:
getModel in interface ModelRepository
Parameters:
reference - a component service reference
Returns:
the model or null if no matching model is resolved

getCandidateProviders

public DeploymentModel[] getCandidateProviders(StageDescriptor stage)
Locate all models meeting the supplied criteria.

Specified by:
getCandidateProviders in interface ModelRepository
Parameters:
stage - a component stage dependency
Returns:
the candidate models

getCandidateProviders

public DeploymentModel[] getCandidateProviders(DependencyDescriptor dependency)
Locate all models meeting the supplied dependency criteria.

Specified by:
getCandidateProviders in interface ModelRepository
Parameters:
dependency - a component service dependency
Returns:
the candidate models

getCandidateProviders

public DeploymentModel[] getCandidateProviders(ReferenceDescriptor reference)
Locate all models meeting the supplied service reference criteria.

Specified by:
getCandidateProviders in interface ModelRepository
Parameters:
reference - a service reference
Returns:
the candidate models

getModel

public DeploymentModel getModel(StageDescriptor stage)
Locate a model meeting the supplied criteria.

Specified by:
getModel in interface ModelRepository
Parameters:
stage - a component stage dependency
Returns:
the model

addModel

public void addModel(DeploymentModel model)
Add an model to the repository.

Specified by:
addModel in interface ModelRepository
Parameters:
model - the model to add

addModel

public void addModel(String name,
                     DeploymentModel model)
Add an model to the repository.

Specified by:
addModel in interface ModelRepository
Parameters:
name - the name to register the model under
model - the model to add

removeModel

public void removeModel(DeploymentModel model)
Remove an model from the repository.

Specified by:
removeModel in interface ModelRepository
Parameters:
model - the model to remove

getModels

public DeploymentModel[] getModels()
Return a sequence of all of the local models.

Specified by:
getModels in interface ModelRepository
Returns:
the model sequence

getModel

public DeploymentModel getModel(String name)
Locate a local model matching the supplied name.

Specified by:
getModel in interface ModelRepository
Parameters:
name - the model name
Returns:
the model or null if the model name is unknown


Copyright © The Apache Software Foundation. All Rights Reserved.