KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > impl > RegistryImpl


1 // Copyright 2004, 2005 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.impl;
16
17 import java.util.List JavaDoc;
18 import java.util.Locale JavaDoc;
19
20 import org.apache.hivemind.Messages;
21 import org.apache.hivemind.Registry;
22 import org.apache.hivemind.internal.Module;
23 import org.apache.hivemind.internal.RegistryInfrastructure;
24
25 /**
26  * Implementation of {@link org.apache.hivemind.Registry} that delegates to an instance of
27  * {@link org.apache.hivemind.internal.RegistryInfrastructure}.
28  *
29  * @since 1.1
30  */

31 public class RegistryImpl implements Registry
32 {
33     private RegistryInfrastructure _infrastructure;
34
35     public RegistryImpl(RegistryInfrastructure infrastructure)
36     {
37         _infrastructure = infrastructure;
38     }
39
40     public boolean containsConfiguration(String JavaDoc configurationId)
41     {
42         return _infrastructure.containsConfiguration(configurationId, null);
43     }
44
45     public boolean containsService(Class JavaDoc serviceInterface)
46     {
47         return _infrastructure.containsService(serviceInterface, null);
48     }
49
50     public boolean containsService(String JavaDoc serviceId, Class JavaDoc serviceInterface)
51     {
52         return _infrastructure.containsService(serviceId, serviceInterface, null);
53     }
54
55     public Object JavaDoc getConfiguration(Class JavaDoc configurationType)
56     {
57         return _infrastructure.getConfiguration(configurationType, null);
58     }
59     
60     public Object JavaDoc getConfiguration(String JavaDoc configurationId)
61     {
62         return _infrastructure.getConfiguration(configurationId, null);
63     }
64
65     public Object JavaDoc getService(String JavaDoc serviceId, Class JavaDoc serviceInterface)
66     {
67         return _infrastructure.getService(serviceId, serviceInterface, null);
68     }
69
70     public Object JavaDoc getService(Class JavaDoc serviceInterface)
71     {
72         return _infrastructure.getService(serviceInterface, null);
73     }
74
75     public Locale JavaDoc getLocale()
76     {
77         return _infrastructure.getLocale();
78     }
79
80     public void shutdown()
81     {
82         _infrastructure.shutdown();
83     }
84
85     public void cleanupThread()
86     {
87         _infrastructure.cleanupThread();
88     }
89
90     /** @since 1.1 */
91     public void setupThread()
92     {
93         _infrastructure.setupThread();
94     }
95
96     /**
97      * @since 1.1
98      */

99     public List JavaDoc getServiceIds(Class JavaDoc serviceInterface)
100     {
101         return _infrastructure.getServiceIds(serviceInterface);
102     }
103
104     /**
105      * @since 1.1
106      */

107     public Messages getModuleMessages(String JavaDoc moduleId)
108     {
109         final Module module = _infrastructure.getModule(moduleId);
110         return module == null ? null : module.getMessages();
111     }
112
113 }
Popular Tags