// 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.Container.Services { using System; using Apache.Avalon.Framework; /// /// Describes a Component Factory, usually binded to /// a kind of . /// /// /// /// A implementation of IComponentFactory should use a /// /// to manage instantiations of Component Factories instances. /// This could be accomplished by using /// /// attribute. /// public interface IComponentFactory : IDisposable { /// /// Should return a component instance using the specific /// strategy (pool, thread or simply instantiating a new object). /// /// The type (concrete) of the component /// The component instance object Create(Type componentType); /// /// Returns true if the specified instanced was created by /// this component factory implementation. /// /// The component instance /// true if this factory owns the specified component bool IsOwner(object componentInstance); /// /// Releases the component instance. /// /// /// The factory shall only release instances created by itself. /// /// The component instance void Release(object componentInstance); } }