Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / InversionOfControl / Castle.MicroKernel / Resolvers / ISubDependencyResolver.cs
blobee474007abfefc1e43664b6222149499b64db627
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MicroKernel
17 using Castle.Core;
19 /// <summary>
20 /// Implementors should use a strategy to obtain
21 /// valid references to properties and/or services
22 /// requested in the dependency model.
23 /// </summary>
24 public interface ISubDependencyResolver
26 /// <summary>
27 /// Should return an instance of a service or property values as
28 /// specified by the dependency model instance.
29 /// It is also the responsability of <see cref="IDependencyResolver"/>
30 /// to throw an exception in the case a non-optional dependency
31 /// could not be resolved.
32 /// </summary>
33 /// <param name="context">Creation context, which is a resolver itself</param>
34 /// <param name="parentResolver">Parent resolver</param>
35 /// <param name="model">Model of the component that is requesting the dependency</param>
36 /// <param name="dependency">The dependency model</param>
37 /// <returns>The dependency resolved value or null</returns>
38 object Resolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency);
40 /// <summary>
41 /// Returns true if the resolver is able to satisfy this dependency.
42 /// </summary>
43 /// <param name="context">Creation context, which is a resolver itself</param>
44 /// <param name="parentResolver">Parent resolver</param>
45 /// <param name="model">Model of the component that is requesting the dependency</param>
46 /// <param name="dependency">The dependency model</param>
47 /// <returns><c>true</c> if the dependency can be satisfied</returns>
48 bool CanResolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency);