KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > internal > AbstractConstructionContext


1 // Copyright 2007 The Apache Software Foundation
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.
14

15 package org.apache.hivemind.internal;
16
17 import org.apache.hivemind.definition.ConstructionContext;
18
19 /**
20  * Default Implementation of {@link ConstructionContext}.
21  *
22  * @author Achim Huegen
23  */

24 public abstract class AbstractConstructionContext implements ConstructionContext
25 {
26     private Module _definingModule;
27
28     public AbstractConstructionContext(Module definingModule)
29     {
30         _definingModule = definingModule;
31     }
32
33     public Object JavaDoc getConfiguration(String JavaDoc configurationId)
34     {
35         return _definingModule.getConfiguration(configurationId);
36     }
37
38     /**
39      * @see org.apache.hivemind.definition.ConstructionContext#getDefiningModule()
40      */

41     public Module getDefiningModule()
42     {
43         return _definingModule;
44     }
45
46     /**
47      * @see org.apache.hivemind.definition.ConstructionContext#getService(java.lang.String, java.lang.Class)
48      */

49     public Object JavaDoc getService(String JavaDoc serviceId, Class JavaDoc serviceInterface)
50     {
51         return _definingModule.getService(serviceId, serviceInterface);
52     }
53
54     /**
55      * @see org.apache.hivemind.definition.ConstructionContext#getService(java.lang.Class)
56      */

57     public Object JavaDoc getService(Class JavaDoc serviceInterface)
58     {
59         return _definingModule.getService(serviceInterface);
60     }
61     
62     /**
63      * @see org.apache.hivemind.definition.ConstructionContext#containsService(java.lang.Class)
64      */

65     public boolean containsService(Class JavaDoc serviceInterface)
66     {
67         return _definingModule.containsService(serviceInterface);
68     }
69
70     /**
71      * @see org.apache.hivemind.definition.ConstructionContext#getRegistry()
72      */

73     public RegistryInfrastructure getRegistry()
74     {
75         return getDefiningModule().getRegistry();
76     }
77
78 }
79
Popular Tags