KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > management > deployment > DeploymentTaskFactory


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2006 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: DeploymentTaskFactory.java 154 6 oct. 06 ofabre $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.management.deployment;
23
24 import org.objectweb.petals.jbi.management.deployment.deploy.AllConnectionRegistrationTask;
25 import org.objectweb.petals.jbi.management.deployment.deploy.AllSUDeploymentTask;
26 import org.objectweb.petals.jbi.management.deployment.deploy.CopyArchiveToInstalledDirTask;
27 import org.objectweb.petals.jbi.management.deployment.deploy.CreateAndRegisterSULifeCycleTask;
28 import org.objectweb.petals.jbi.management.deployment.deploy.DescriptorAndURIRetrievalTask;
29 import org.objectweb.petals.jbi.management.deployment.deploy.SAAndSUExtractionTask;
30 import org.objectweb.petals.jbi.management.deployment.deploy.SAAndSUInstallRootRetrievalTask;
31 import org.objectweb.petals.jbi.management.deployment.deploy.SADeploymentSuccessTask;
32 import org.objectweb.petals.jbi.management.deployment.deploy.SALifeCycleRegistrationTask;
33 import org.objectweb.petals.jbi.management.deployment.deploy.SAPackageCheckingTask;
34 import org.objectweb.petals.jbi.management.deployment.deploy.SAStateHolderCreationTask;
35 import org.objectweb.petals.jbi.management.deployment.deploy.SUToComponentDeploymentTask;
36 import org.objectweb.petals.jbi.management.deployment.deploy.XMLDeploymentResultCreationTask;
37 import org.objectweb.petals.jbi.management.deployment.undeploy.AllConnectionsRemovalTask;
38 import org.objectweb.petals.jbi.management.deployment.undeploy.AllSUUndeploymentTask;
39 import org.objectweb.petals.jbi.management.deployment.undeploy.DeleteArchiveFromInstalledDirTask;
40 import org.objectweb.petals.jbi.management.deployment.undeploy.SACacheRemovalTask;
41 import org.objectweb.petals.jbi.management.deployment.undeploy.SAFolderRemovalTask;
42 import org.objectweb.petals.jbi.management.deployment.undeploy.SALifeCycleRetrievalTask;
43 import org.objectweb.petals.jbi.management.deployment.undeploy.SALifeCycleUnregistrationTask;
44 import org.objectweb.petals.jbi.management.deployment.undeploy.SAStateHolderRemovalTask;
45 import org.objectweb.petals.jbi.management.deployment.undeploy.XMLUndeploymentResultCreationTask;
46 import org.objectweb.petals.jbi.management.service.EndpointService;
47 import org.objectweb.petals.jbi.management.service.LifeCycleManagerService;
48 import org.objectweb.petals.jbi.management.service.PackageHandler;
49 import org.objectweb.petals.jbi.management.systemstate.SystemState;
50 import org.objectweb.petals.repository.RepositoryService;
51 import org.objectweb.petals.util.LoggingUtil;
52
53 /**
54  * This Factory creates Deployment Tasks.
55  *
56  * @author ofabre - EBM Websourcing
57  *
58  */

59 public class DeploymentTaskFactory {
60
61     /**
62      * Package Handler
63      */

64     protected PackageHandler packageHandler;
65
66     protected EndpointService endpointService;
67
68     protected DeploymentServiceImpl deploymentService;
69
70     /**
71      * JBI Container :: Recovery Service
72      */

73     protected SystemState recoverySrv;
74
75     /**
76      * Platform Component :: Repository Service
77      */

78     protected RepositoryService repositorySrv;
79
80     /**
81      * logger wrapper
82      */

83     protected LoggingUtil log;
84
85     /**
86      * JBI Container :: JMX Agent Admin
87      */

88     protected LifeCycleManagerService managerService;
89
90     protected DescriptorAndURIRetrievalTask descriptorAndURIRetrievalTask;
91
92     protected XMLDeploymentResultCreationTask resultCreationTask;
93
94     protected SAPackageCheckingTask packageCheckingTask;
95
96     protected SAAndSUExtractionTask extractionTask;
97
98     protected AllSUDeploymentTask allSUDeploymentTask;
99
100     protected SALifeCycleRegistrationTask saLifeCycleRegistrationTask;
101
102     protected AllConnectionRegistrationTask allConnectionRegistrationTask;
103
104     protected SAStateHolderCreationTask stateHolderCreationTask;
105
106     protected CopyArchiveToInstalledDirTask copyArchiveToInstalledDirTask;
107
108     protected SADeploymentSuccessTask deploymentSuccessTask;
109
110     protected SUToComponentDeploymentTask suToComponentDeploymentTask;
111
112     protected CreateAndRegisterSULifeCycleTask createAndRegisterSULifeCycleTask;
113
114     protected SAAndSUInstallRootRetrievalTask saAndSUInstallRootRetrievalTask;
115
116     protected AllConnectionsRemovalTask allConnectionsRemovalTask;
117
118     protected AllSUUndeploymentTask allSUUndeploymentTask;
119
120     protected SACacheRemovalTask saCacheRemovalTask;
121
122     protected SAFolderRemovalTask saFolderRemovalTask;
123     
124     protected DeleteArchiveFromInstalledDirTask deleteArchiveFromInstalledDirTask;
125
126     protected SALifeCycleRetrievalTask saLifeCycleRetrievalTask;
127
128     protected SALifeCycleUnregistrationTask saLifeCycleUnregistrationTask;
129
130     protected SAStateHolderRemovalTask saStateHolderRemovalTask;
131
132     protected XMLUndeploymentResultCreationTask xmlUndeploymentResultCreationTask;
133
134     public DeploymentTaskFactory(PackageHandler packageHandler,
135             EndpointService endpointService,
136             DeploymentServiceImpl deploymentService, SystemState recoverySrv,
137             RepositoryService repositorySrv, LoggingUtil log,
138             LifeCycleManagerService managerService) {
139         super();
140         this.packageHandler = packageHandler;
141         this.endpointService = endpointService;
142         this.deploymentService = deploymentService;
143         this.recoverySrv = recoverySrv;
144         this.repositorySrv = repositorySrv;
145         this.log = log;
146         this.managerService = managerService;
147
148         /*
149          * Create Tasks
150          */

151         descriptorAndURIRetrievalTask = new DescriptorAndURIRetrievalTask(
152                 packageHandler);
153
154         resultCreationTask = new XMLDeploymentResultCreationTask();
155
156         packageCheckingTask = new SAPackageCheckingTask(log, deploymentService);
157
158         extractionTask = new SAAndSUExtractionTask(packageHandler,
159                 repositorySrv, log);
160
161         allSUDeploymentTask = new AllSUDeploymentTask(recoverySrv,
162                 repositorySrv, managerService, deploymentService, log);
163
164         saLifeCycleRegistrationTask = new SALifeCycleRegistrationTask(
165                 managerService, log);
166
167         allConnectionRegistrationTask = new AllConnectionRegistrationTask(
168                 endpointService, log);
169
170         stateHolderCreationTask = new SAStateHolderCreationTask(recoverySrv,
171                 repositorySrv, log);
172
173         copyArchiveToInstalledDirTask = new CopyArchiveToInstalledDirTask(log);
174
175         deploymentSuccessTask = new SADeploymentSuccessTask(deploymentService, log);
176
177         suToComponentDeploymentTask = new SUToComponentDeploymentTask(log,
178                 managerService);
179
180         createAndRegisterSULifeCycleTask = new CreateAndRegisterSULifeCycleTask(
181                 log, managerService);
182
183         saAndSUInstallRootRetrievalTask = new SAAndSUInstallRootRetrievalTask(
184                 repositorySrv, packageHandler);
185
186         allConnectionsRemovalTask = new AllConnectionsRemovalTask(
187                 endpointService);
188
189         allSUUndeploymentTask = new AllSUUndeploymentTask(managerService, log);
190
191         saCacheRemovalTask = new SACacheRemovalTask(deploymentService);
192
193         saFolderRemovalTask = new SAFolderRemovalTask();
194
195         saLifeCycleRetrievalTask = new SALifeCycleRetrievalTask(managerService,
196                 log);
197
198         saLifeCycleUnregistrationTask = new SALifeCycleUnregistrationTask(
199                 managerService);
200
201         saStateHolderRemovalTask = new SAStateHolderRemovalTask(recoverySrv);
202
203         xmlUndeploymentResultCreationTask = new XMLUndeploymentResultCreationTask();
204         
205         deleteArchiveFromInstalledDirTask = new DeleteArchiveFromInstalledDirTask();
206
207     }
208
209     public AllConnectionRegistrationTask getAllConnectionRegistrationTask() {
210         return allConnectionRegistrationTask;
211     }
212
213     public AllSUDeploymentTask getAllSUDeploymentTask() {
214         return allSUDeploymentTask;
215     }
216
217     public CopyArchiveToInstalledDirTask getCopyArchiveToInstalledDirTask() {
218         return copyArchiveToInstalledDirTask;
219     }
220
221     public CreateAndRegisterSULifeCycleTask getCreateAndRegisterSULifeCycleTask() {
222         return createAndRegisterSULifeCycleTask;
223     }
224
225     public SADeploymentSuccessTask getDeploymentSuccessTask() {
226         return deploymentSuccessTask;
227     }
228
229     public DescriptorAndURIRetrievalTask getDescriptorAndURIRetrievalTask() {
230         return descriptorAndURIRetrievalTask;
231     }
232
233     public SAAndSUExtractionTask getExtractionTask() {
234         return extractionTask;
235     }
236
237     public SAPackageCheckingTask getPackageCheckingTask() {
238         return packageCheckingTask;
239     }
240
241     public XMLDeploymentResultCreationTask getResultCreationTask() {
242         return resultCreationTask;
243     }
244
245     public SALifeCycleRegistrationTask getSaLifeCycleRegistrationTask() {
246         return saLifeCycleRegistrationTask;
247     }
248
249     public SAStateHolderCreationTask getStateHolderCreationTask() {
250         return stateHolderCreationTask;
251     }
252
253     public SUToComponentDeploymentTask getSuToComponentDeploymentTask() {
254         return suToComponentDeploymentTask;
255     }
256
257     public AllConnectionsRemovalTask getAllConnectionsRemovalTask() {
258         return allConnectionsRemovalTask;
259     }
260
261     public AllSUUndeploymentTask getAllSUUndeploymentTask() {
262         return allSUUndeploymentTask;
263     }
264
265     public SACacheRemovalTask getSaCacheRemovalTask() {
266         return saCacheRemovalTask;
267     }
268
269     public SAFolderRemovalTask getSaFolderRemovalTask() {
270         return saFolderRemovalTask;
271     }
272
273     public SALifeCycleRetrievalTask getSaLifeCycleRetrievalTask() {
274         return saLifeCycleRetrievalTask;
275     }
276
277     public SALifeCycleUnregistrationTask getSaLifeCycleUnregistrationTask() {
278         return saLifeCycleUnregistrationTask;
279     }
280
281     public SAStateHolderRemovalTask getSaStateHolderRemovalTask() {
282         return saStateHolderRemovalTask;
283     }
284
285     public XMLUndeploymentResultCreationTask getXmlUndeploymentResultCreationTask() {
286         return xmlUndeploymentResultCreationTask;
287     }
288
289     public SAAndSUInstallRootRetrievalTask getSaAndSUInstallRootRetrievalTask() {
290         return saAndSUInstallRootRetrievalTask;
291     }
292
293     public DeleteArchiveFromInstalledDirTask getDeleteArchiveFromInstalledDirTask() {
294         return deleteArchiveFromInstalledDirTask;
295     }
296
297 }
298
Popular Tags