/* * 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 Mode = Apache.Avalon.Composition.Data.Mode; using DependencyDescriptor = Apache.Avalon.Meta.DependencyDescriptor; using ServiceDescriptor = Apache.Avalon.Meta.ServiceDescriptor; using StageDescriptor = Apache.Avalon.Meta.StageDescriptor; using Apache.Avalon.Framework; /// Model desribing a deployment scenario. /// /// /// Stephen McConnell /// /// $Revision: 1.1 $ $Date: 2004/02/28 22:15:43 $ /// public struct IDeploymentModel_Fields { public readonly static System.String SEPARATOR = "/"; public readonly static System.String DEPLOYMENT_TIMEOUT_KEY = "urn:composition:deployment.timeout"; } public interface IDeploymentModel : ICommissionable, IResolver { /// Return the name of the model. /// the name /// System.String Name { get; } /// Return the model partition path. /// the path /// System.String Path { get; } /// Return the model fully qualified name. /// the fully qualified name /// System.String QualifiedName { get; } /// Return the mode of model establishment. /// the mode /// Mode Mode { get; } /// Return the assigned logging channel. /// the logging channel /// ILogger Logger { get; } //----------------------------------------------------------- // service production //----------------------------------------------------------- /// Return the set of services produced by the model. /// the services /// ServiceDescriptor[] Services { get; } /// Return TRUE is this model is capable of supporting a supplied /// depedendency. /// /// true if this model can fulfill the dependency /// bool IsaCandidate(DependencyDescriptor dependency); /// Return TRUE is this model is capable of supporting a supplied /// stage dependency. /// /// true if this model can fulfill the dependency /// bool IsaCandidate(StageDescriptor stage); //----------------------------------------------------------- // composite assembly //----------------------------------------------------------- /// Returns the assembled state of the model. /// true if this model is assembled /// bool IsAssembled { get; } /// Assemble the model. /// a list of deployment models that make up the assembly chain /// /// Exception if an error occurs during model assembly /// void Assemble(System.Collections.IList subjects); /// Return the set of models consuming this model. /// the consumers /// IDeploymentModel[] ConsumerGraph { get; } /// Return the set of models supplying this model. /// the providers /// IDeploymentModel[] ProviderGraph { get; } /// Disassemble the model. void Disassemble(); /// Return the set of models assigned as providers. /// the providers consumed by the model /// /// IllegalStateException if invoked prior to /// the completion of the assembly phase /// IDeploymentModel[] Providers { get; } /// Return the default deployment timeout value declared in the /// kernel configuration. The implementation looks for a value /// assigned under the property key "urn:composition:deployment.timeout" /// and defaults to 1000 msec if undefined. /// /// /// the default deployment timeout value /// long DeploymentTimeout { get; } } }