1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
19 using Castle
.Core
.Configuration
;
20 using Castle
.Core
.Resource
;
23 /// The contract used by the kernel to obtain
24 /// external configuration for the components and
27 public interface IConfigurationStore
: ISubSystem
30 /// Associates a configuration node with a facility key
32 /// <param name="key">item key</param>
33 /// <param name="config">Configuration node</param>
34 void AddFacilityConfiguration(String key
, IConfiguration config
);
37 /// Associates a configuration node with a component key
39 /// <param name="key">item key</param>
40 /// <param name="config">Configuration node</param>
41 void AddComponentConfiguration(String key
, IConfiguration config
);
44 /// Associates a configuration node with a bootstrap component key
46 /// <param name="key">item key</param>
47 /// <param name="config">Configuration node</param>
48 void AddBootstrapComponentConfiguration(String key
, IConfiguration config
);
51 /// Adds the child container configuration.
53 /// <param name="name">The container's name.</param>
54 /// <param name="config">The config.</param>
55 void AddChildContainerConfiguration(String name
, IConfiguration config
);
58 /// Returns the configuration node associated with
59 /// the specified child container key. Should return null
60 /// if no association exists.
62 /// <param name="key">item key</param>
63 /// <returns></returns>
64 IConfiguration
GetChildContainerConfiguration(String key
);
67 /// Returns the configuration node associated with
68 /// the specified facility key. Should return null
69 /// if no association exists.
71 /// <param name="key">item key</param>
72 /// <returns></returns>
73 IConfiguration
GetFacilityConfiguration(String key
);
76 /// Returns the configuration node associated with
77 /// the specified component key. Should return null
78 /// if no association exists.
80 /// <param name="key">item key</param>
81 /// <returns></returns>
82 IConfiguration
GetComponentConfiguration(String key
);
85 /// Returns the configuration node associated with
86 /// the specified component key. Should return null
87 /// if no association exists.
89 /// <param name="key">item key</param>
90 /// <returns></returns>
91 IConfiguration
GetBootstrapComponentConfiguration(String key
);
94 /// Returns all configuration nodes for facilities
96 /// <returns></returns>
97 IConfiguration
[] GetFacilities();
100 /// Returns all configuration nodes for components
102 /// <returns></returns>
103 IConfiguration
[] GetComponents();
106 /// Returns all configuration nodes for bootstrap components
108 /// <returns></returns>
109 IConfiguration
[] GetBootstrapComponents();
112 /// Gets the child containers configuration nodes.
114 /// <returns></returns>
115 IConfiguration
[] GetConfigurationForChildContainers();
120 /// <param name="resourceUri"></param>
121 /// <param name="resource"></param>
122 /// <returns></returns>
123 IResource
GetResource(String resourceUri
, IResource resource
);