/*
* Copyright 2003-2004 The Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace Apache.Avalon.Composition.Model
{
using System;
using DependencyDescriptor = Apache.Avalon.Meta.DependencyDescriptor;
using StageDescriptor = Apache.Avalon.Meta.StageDescriptor;
/// The model repository interface declares operations through which
/// clients may resolve new or existing model instances relative to
/// a stage or service dependency.
///
///
/// Stephen McConnell
///
/// $Revision: 1.1 $ $Date: 2004/02/28 22:15:43 $
///
public interface IModelRepository
{
/// Locate an model meeting the supplied criteria.
///
///
/// the model
///
IDeploymentModel[] Models
{
get;
}
/// Locate an model matching the supplied name.
///
///
/// the model name
///
/// the model or null if the model name is unknown
///
IDeploymentModel GetModel(System.String name);
/// Locate a model meeting the supplied criteria.
///
///
/// a component service dependency
///
/// the model
///
IDeploymentModel GetModel(DependencyDescriptor dependency);
/// Locate all models meeting the supplied dependency criteria.
///
///
/// a component service dependency
///
/// the candidate models
///
IDeploymentModel[] GetCandidateProviders(DependencyDescriptor dependency);
/// Locate all models meeting the supplied criteria.
///
///
/// a component stage dependency
///
/// the candidate models
///
IDeploymentModel[] GetCandidateProviders(StageDescriptor stage);
/// Locate a model meeting the supplied criteria.
///
///
/// a component stage dependency
///
/// the model
///
IDeploymentModel GetModel(StageDescriptor stage);
/// Add an model to the repository.
///
///
/// the model to add
///
void AddModel(IDeploymentModel model);
/// Add an model to the repository.
///
///
/// the name to register the model under
///
/// the model to add
///
void AddModel(System.String name, IDeploymentModel model);
/// Remove an model from the repository.
///
///
/// the model to remove
///
void RemoveModel(IDeploymentModel model);
}
}