View Javadoc

1   /*
2    * $Id: JavaClassCEAComponentManager.java,v 1.12 2006/03/17 17:50:58 clq2 Exp $
3    * Created on 10-Jun-2004
4    *
5    * Copyright (C) AstroGrid. All rights reserved.
6    *
7    * This software is published under the terms of the AstroGrid 
8    * Software License version 1.2, a copy of which has been included 
9    * with this distribution in the LICENSE.txt file.  
10   *
11   */
12  package org.astrogrid.applications.component;
13  
14  import org.apache.commons.logging.Log;
15  import org.apache.commons.logging.LogFactory;
16  import org.astrogrid.applications.contracts.Configuration;
17  import org.astrogrid.applications.javaclass.JavaClassApplicationDescriptionLibrary;
18  import org.astrogrid.applications.javaclass.BaseJavaClassConfiguration;
19  import org.astrogrid.applications.javaclass.JavaClassConfiguration;
20  import org.astrogrid.applications.javaclass.SampleJavaClassApplications;
21  import org.picocontainer.MutablePicoContainer;
22  
23  /*** 
24   * Simple component manager that defines a  standalone JavaClass CEA server
25   * @author Noel Winstanley nw@jb.man.ac.uk 10-Jun-2004
26   * @see org.astrogrid.applications.javaclass
27   * @todo factor into the javaclass package?
28   */
29  public class JavaClassCEAComponentManager extends EmptyCEAComponentManager {
30    
31    private static final Log logger
32        = LogFactory.getLog(JavaClassCEAComponentManager.class);
33      
34  
35     /*** 
36      * Constructs a new JavaClassCEAComponentManger, 
37      * with all necessary components registered.
38      */
39     public JavaClassCEAComponentManager() {
40       super();
41       registerDefaultServices(pico);
42       EmptyCEAComponentManager.registerDefaultRegistryUploader(pico);
43       registerJavaClassProvider(pico);
44     }
45      
46     /***
47      * Registers components peculiar to the JC-CEC.
48      */
49     public static final void registerJavaClassProvider(MutablePicoContainer pico){
50        
51       // The configuration has two interfaces, one generic and one specific
52       // to the JC-CEC so it has to be registered twice.
53       pico.registerComponentImplementation(Configuration.class, 
54                                            BaseJavaClassConfiguration.class);
55       pico.registerComponentImplementation(JavaClassConfiguration.class, 
56                                            BaseJavaClassConfiguration.class);
57        
58       // This component will instantiate the class implementing the
59       // application and will derive from it, by reflection, the
60       // application description.
61       pico.registerComponentImplementation(JavaClassApplicationDescriptionLibrary.class,
62                                            JavaClassApplicationDescriptionLibrary.class);
63  
64       // The class implementing the application isn't registered with 
65       // Picocontainer. Instead, the Class object is made available to
66       // the JavaclassApplicationDescriptionLibrary by the 
67       // JavaClassConfiguration.assApplications.class.getName());
68     }
69  }
70  
71  
72  /* 
73  $Log: JavaClassCEAComponentManager.java,v $
74  Revision 1.12  2006/03/17 17:50:58  clq2
75  gtr_1489_cea correted version
76  
77  Revision 1.10  2006/03/07 21:45:26  clq2
78  gtr_1489_cea
79  
80  Revision 1.6.20.3  2006/02/01 12:09:54  gtr
81  Refactored and fixed to allow the tests to work with the new configuration.
82  
83  Revision 1.6.20.2  2006/01/31 21:39:07  gtr
84  Refactored. I have altered the configuration code slightly so that the JUnit tests can impose a Configuration instance to configure the tests. I have also fixed up almost all the bad tests for commandline and http.
85  
86  Revision 1.6.20.1  2005/12/18 14:48:24  gtr
87  Refactored to allow the component managers to pass their unit tests and the fingerprint JSP to work. See BZ1492.
88  
89  Revision 1.6  2005/08/10 14:45:37  clq2
90  cea_pah_1317
91  
92  Revision 1.5.86.1  2005/07/21 15:10:22  pah
93  changes to acommodate contol component, and starting to change some of the static methods to dynamic
94  
95  Revision 1.5  2004/11/27 13:20:03  pah
96  result of merge of pah_cea_bz561 branch
97  
98  Revision 1.4.70.1  2004/11/09 09:21:16  pah
99  initial attempt to rationalise authorityID use & self registering
100 
101 Revision 1.4  2004/07/26 12:07:38  nw
102 renamed indirect package to protocol,
103 renamed classes and methods within protocol package
104 javadocs
105 
106 Revision 1.3  2004/07/23 13:21:21  nw
107 Javadocs
108 
109 Revision 1.2  2004/07/01 11:16:22  nw
110 merged in branch
111 nww-itn06-componentization
112 
113 Revision 1.1.2.3  2004/07/01 01:42:46  nw
114 final version, before merge
115 
116 Revision 1.1.2.2  2004/06/17 09:21:23  nw
117 finished all major functionality additions to core
118 
119 Revision 1.1.2.1  2004/06/14 08:56:58  nw
120 factored applications into sub-projects,
121 got packaging of wars to work again
122  
123 */