Added ability to order the execution of dictionary adapter behaviors.
[castle.git] / Experiments / Attic / Generator / Castle.ActiveRecord.Generator / ServiceRegistry.cs
blob6c2a702997f26338f45b1bba7b2bc7abb5576924
1 // Copyright 2004-2007 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.ActiveRecord.Generator
17 using System;
19 using Castle.Windsor;
21 using Castle.ActiveRecord.Generator.Components;
22 using Castle.ActiveRecord.Generator.Components.Database;
23 using Castle.ActiveRecord.Generator.Components.CodeGenerator;
26 public class ServiceRegistry : WindsorContainer
28 private static ServiceRegistry instance = new ServiceRegistry();
30 public ServiceRegistry() : base()
32 // TODO: Put these on the configuration file
34 AddComponent("conn.factory", typeof(IConnectionFactory), typeof(ConnectionFactory));
35 AddComponent("db.def.builder", typeof(IDatabaseDefinitionBuilder), typeof(DatabaseDefinitionBuilder));
36 AddComponent("naming.service", typeof(INamingService), typeof(NamingService));
37 AddComponent("typeinfer.service", typeof(ITypeInferenceService), typeof(TypeInferenceService) );
38 AddComponent("arbuilder", typeof(IActiveRecordDescriptorBuilder), typeof(ActiveRecordDescriptorBuilder) );
39 AddComponent("plainfields.service", typeof(IPlainFieldInferenceService), typeof(PlainFieldInferenceService) );
40 AddComponent("relation.service", typeof(IRelationshipInferenceService), typeof(RelationshipInferenceService) );
41 AddComponent("codeproviderfactory", typeof(ICodeProviderFactory), typeof(CodeProviderFactory) );
42 AddComponent("relationbuilder", typeof(IRelationshipBuilder), typeof(RelationshipBuilder) );
43 AddComponent("codedomgen", typeof(ICodeDomGenerator), typeof(CodeDomGenerator) );
44 AddComponent("projectgen", typeof(IProjectGenerator), typeof(ProjectGenerator));
47 public static ServiceRegistry Instance
49 get { return instance; }