View Javadoc

1   /*$Id: InProcessCeaComponentManager.java,v 1.7 2006/03/17 17:56:58 clq2 Exp $
2    * Created on 07-Feb-2005
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
9    *
10  **/
11  package org.astrogrid.jes.jobscheduler.dispatcher.inprocess;
12  
13  import org.astrogrid.applications.component.EmptyCEAComponentManager;
14  import org.astrogrid.applications.description.base.ApplicationDescriptionEnvironment;
15  import org.astrogrid.applications.manager.CeaThreadPool;
16  import org.astrogrid.applications.manager.DefaultMetadataService;
17  import org.astrogrid.applications.manager.ExecutionController;
18  import org.astrogrid.applications.manager.MetadataService;
19  import org.astrogrid.applications.manager.QueryService;
20  import org.astrogrid.applications.manager.ThreadPoolExecutionController;
21  import org.astrogrid.component.descriptor.ComponentDescriptor;
22  import org.astrogrid.config.Config;
23  
24  import org.picocontainer.MutablePicoContainer;
25  
26  import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
27  import junit.framework.Test;
28  
29  /*** Set up a cea server for execution of in-process applications.
30   * Difference between this and the usual vanilla server is that the QueryService in am {@link org.astrogrid.jes.jobscheduler.dispatcher.inprocess.InProcessQueryService}
31   * which will callback notifications directly to the job monitor and results listener interfaces. 
32   * @todo currently configured, but empty. needs to be populated with proxy applicaitons.
33   * @author Noel Winstanley nw@jb.man.ac.uk 07-Feb-2005
34   *
35   */
36  public class InProcessCeaComponentManager extends EmptyCEAComponentManager implements ComponentDescriptor{
37  
38      
39      /*** Construct a new InProcessCeaServer
40       * 
41       */
42      public InProcessCeaComponentManager(MutablePicoContainer parent, Config config) {
43          super();   
44          pico = parent.makeChildContainer();
45         
46          pico.registerComponentImplementation(ApplicationDescriptionEnvironment.class,ApplicationDescriptionEnvironment.class);
47          pico.registerComponentImplementation(ExecutionController.class,ThreadPoolExecutionController.class);
48          pico.registerComponentImplementation(PooledExecutor.class,CeaThreadPool.class);
49          pico.registerComponentImplementation(QueryService.class,InProcessQueryService.class);   
50         EmptyCEAComponentManager.registerCompositeApplicationDescriptionLibrary(pico);
51          EmptyCEAComponentManager.registerContainerApplicationDescriptionLibrary(pico);    
52          // store
53          EmptyCEAComponentManager.registerDefaultPersistence(pico,config);
54          // metadata
55          EmptyCEAComponentManager.registerDefaultVOProvider(pico);
56          // the protocol lib
57          EmptyCEAComponentManager.registerProtocolLibrary(pico);
58          EmptyCEAComponentManager.registerStandardIndirectionProtocols(pico);
59          EmptyCEAComponentManager.registerAstrogridIndirectionProtocols(pico);
60          // @todo now hook in out own implementations..
61          //JavaApplicationCEAComponentManager.registerJavaClassProvider(pico,config);
62          //HttpApplicationCEAComponentManager.registerHttpApplicationProvider(pico,config);
63          // do this by registering the application instances directly.        
64      }
65  
66      /***
67       * @see org.astrogrid.component.descriptor.ComponentDescriptor#getName()
68       */
69      public String getName() {
70          return "In-Process Cea Server";
71      }
72  
73      /***
74       * @see org.astrogrid.component.descriptor.ComponentDescriptor#getDescription()
75       */
76      public String getDescription() {
77          return "Contains Components:\n----------------------------------------------\n" + super.information() + "\n-----------------------------------------------";
78      }
79  
80      /***
81       * @see org.astrogrid.component.descriptor.ComponentDescriptor#getInstallationTest()
82       */
83      public Test getInstallationTest() {
84          return null;
85      }        
86     
87  
88  }
89  
90  
91  /* 
92  $Log: InProcessCeaComponentManager.java,v $
93  Revision 1.7  2006/03/17 17:56:58  clq2
94  gtr_1489_cea correted version
95  
96  Revision 1.5  2006/03/07 21:45:26  clq2
97  gtr_1489_cea
98  
99  Revision 1.4.38.1  2006/01/30 12:05:54  gtr
100 I changed the call to registerDefaultServices()  to the modern form (doesn't take an org.astrogrid.config.Config argument).
101 
102 Revision 1.4  2005/07/05 08:27:01  clq2
103 paul's 559b and 559c for wo/apps and jes
104 
105 Revision 1.3.10.1  2005/06/09 10:03:20  pah
106 removed separate registration of metadata service
107 
108 Revision 1.3  2005/04/25 12:13:54  clq2
109 jes-nww-776-again
110 
111 Revision 1.2.20.1  2005/04/11 13:56:30  nw
112 organized imports
113 
114 Revision 1.2  2005/03/13 07:13:39  clq2
115 merging jes-nww-686 common-nww-686 workflow-nww-996 scripting-nww-995 cea-nww-994
116 
117 Revision 1.1.2.1  2005/03/11 14:04:30  nw
118 in-process cea server
119  
120 */