1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.applications.http;
12
13
14 import org.apache.commons.logging.Log;
15 import org.apache.commons.logging.LogFactory;
16 import org.astrogrid.applications.component.EmptyCEAComponentManager;
17 import org.astrogrid.applications.description.BaseApplicationDescriptionLibrary;
18 import org.astrogrid.applications.http.HttpApplicationDescriptionLibrary;
19 import org.astrogrid.applications.http.registry.RegistryQuerier;
20 import org.astrogrid.applications.http.registry.RegistryQuerierImpl;
21 import org.astrogrid.config.Config;
22 import org.astrogrid.config.SimpleConfig;
23 import org.picocontainer.MutablePicoContainer;
24
25 /***
26 * Component manager that assembles a standalone HttpApplication CEA server.
27 *
28 * @author jdt
29 * @TODO Tidy up superfluous stuff
30 */
31 public class HttpApplicationCEAComponentManager extends EmptyCEAComponentManager {
32 /***
33 * Logger for this class
34 */
35 private static final Log logger = LogFactory
36 .getLog(HttpApplicationCEAComponentManager.class);
37
38
39 /***
40 * Construct a new HttpApplicationCEAComponentManager, with all necessary
41 * components registered
42 * <p />
43 * registers the HttpApplication provider, plus all the standard services
44 * defined in {@link EmptyCEAComponentManager}
45 */
46 public HttpApplicationCEAComponentManager() {
47 super();
48 logger.info("HttpApplicationCEAComponentManager() - registering components");
49
50 final Config config = SimpleConfig.getSingleton();
51
52 EmptyCEAComponentManager.registerDefaultServices(pico);
53
54 EmptyCEAComponentManager.registerDefaultPersistence(pico, config);
55
56 EmptyCEAComponentManager.registerDefaultVOProvider(pico, config);
57
58
59 EmptyCEAComponentManager.registerDefaultRegistryUploader(pico);
60
61
62 EmptyCEAComponentManager.registerProtocolLibrary(pico);
63 EmptyCEAComponentManager.registerStandardIndirectionProtocols(pico);
64 EmptyCEAComponentManager.registerAstrogridIndirectionProtocols(pico);
65
66 registerHttpApplicationProvider(pico, config);
67 logger.info("HttpApplicationCEAComponentManager() - done");
68 }
69
70 /***
71 * just register the components specific to the HttpApplications provider,
72 * but none of the generic components
73 *
74 * @see {@link #COMMUNITY_KEY}
75 */
76 public static final void registerHttpApplicationProvider(MutablePicoContainer pico, final Config config) {
77 if (logger.isDebugEnabled()) {
78 logger.debug("registerHttpApplicationProvider(MutablePicoContainer, Config) - start");
79 }
80
81 pico.registerComponentImplementation(HttpApplicationDescriptionLibrary.class,
82 HttpApplicationDescriptionLibrary.class);
83 pico.registerComponentImplementation(RegistryQuerier.class, RegistryQuerierImpl.class);
84
85 if (logger.isDebugEnabled()) {
86 logger.debug("registerHttpApplicationProvider(MutablePicoContainer, Config) - end");
87 }
88 }
89 }
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105