01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2005 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial developer: Benoit Pelletier
22: * --------------------------------------------------------------------------
23: * $Id: WsdlPublishCluster.java 6896 2005-06-07 08:21:28Z pelletib $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas.ant.cluster;
26:
27: import java.util.ArrayList;
28: import java.util.List;
29:
30: import org.objectweb.jonas.ant.jonasbase.wsdl.File;
31: import org.objectweb.jonas.ant.jonasbase.wsdl.Uddi;
32: import org.objectweb.jonas.ant.jonasbase.wsdl.WsdlPublish;
33:
34: /**
35: * Define WsdlPublishCluster task
36: * @author Benoit Pelletier
37: */
38: public class WsdlPublishCluster extends ClusterTasks {
39:
40: /**
41: * Info for the logger
42: */
43: private static final String INFO = "[WsdlPublishCluster] ";
44:
45: /**
46: * List of files (WSDL publish)
47: */
48: private List files = new ArrayList();
49:
50: /**
51: * List of uddi (WSDL publish)
52: */
53: private List uddis = new ArrayList();
54:
55: /**
56: * Add file (wsdl publish)
57: * @param file properties file
58: */
59: public void addConfiguredFile(File file) {
60: files.add(file);
61: }
62:
63: /**
64: * Add UDDI (wsdl publish)
65: * @param uddi properties file
66: */
67: public void addConfiguredUddi(Uddi uddi) {
68: uddis.add(uddi);
69: }
70:
71: /**
72: * Generates the mail tasks for each JOnAS's instances
73: */
74: public void generatesTasks() {
75:
76: for (int i = getDestDirSuffixIndFirst(); i <= getDestDirSuffixIndLast(); i++) {
77:
78: String destDir = getDestDir(getDestDirPrefix(), i);
79:
80: log(INFO + "tasks generation for " + destDir);
81:
82: // creation of the Mail task
83: WsdlPublish wsdl = new WsdlPublish();
84:
85: wsdl.setFiles(files);
86: wsdl.setUddis(uddis);
87:
88: wsdl.setDestDir(new java.io.File(destDir));
89:
90: addTask(wsdl);
91:
92: }
93: }
94: }
|