01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.modules;
19:
20: import de.finix.contelligent.client.base.AbstractRegistry;
21:
22: /**
23: * Singleton that allows modules to register a mapping from a symbolic to an
24: * implementation name.
25: */
26: public class ModuleRegistry extends AbstractRegistry {
27:
28: private static ModuleRegistry moduleRegistry = null;
29:
30: private final static String DEFAULT_MODULE_IMPL = "de.finix.contelligent.client.modules.session.SessionModule";
31:
32: private ModuleRegistry() {
33: super ();
34: // add values that should be retrieved from server in future
35: register("NewPreferences",
36: "de.finix.contelligent.client.modules.preferences.NewPreferencesModule");
37: register("Preferences",
38: "de.finix.contelligent.client.modules.preferences.PreferencesModule");
39: register("Session", DEFAULT_MODULE_IMPL);
40: register("Type",
41: "de.finix.contelligent.client.modules.types.TypeModule");
42: register("Monitor",
43: "de.finix.contelligent.client.modules.monitor.MonitorModule");
44: register("Console",
45: "de.finix.contelligent.client.modules.message.MessageModule");
46: register("UserAdmin",
47: "de.finix.contelligent.client.modules.user.UserModule");
48: register("Log",
49: "de.finix.contelligent.client.modules.log.LogModule");
50: register("Privileges",
51: "de.finix.contelligent.client.modules.user.PrivilegeModule");
52: register("Server Management",
53: "de.finix.contelligent.client.modules.jmx.JMXModule");
54: }
55:
56: public static ModuleRegistry getInstance() {
57: if (moduleRegistry == null) {
58: moduleRegistry = new ModuleRegistry();
59: }
60: return moduleRegistry;
61: }
62:
63: public String getDefaultImpl() {
64: return DEFAULT_MODULE_IMPL;
65: }
66: }
|