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: DbmCluster.java 6896 2005-06-07 08:21:28Z pelletib $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas.ant.cluster;
26:
27: import java.io.File;
28: import org.objectweb.jonas.ant.jonasbase.Dbm;
29:
30: /**
31: * Define DbmCluster task
32: * @author Benoit Pelletier
33: */
34: public class DbmCluster extends ClusterTasks {
35:
36: /**
37: * Info for the logger
38: */
39: private static final String INFO = "[DbmCluster] ";
40:
41: /**
42: * dataSource
43: */
44: private String dataSources = null;
45:
46: /**
47: * Default constructor
48: */
49: public DbmCluster() {
50: super ();
51: }
52:
53: /**
54: * Set the dataSources for the Dbm service
55: * @param dataSources the dataSources for the Dbm service
56: */
57: public void setdataSources(String dataSources) {
58: this .dataSources = dataSources;
59: }
60:
61: /**
62: * Generates the DbmCluster tasks for each JOnAS's instances
63: */
64: public void generatesTasks() {
65:
66: int portInd = 0;
67:
68: for (int i = getDestDirSuffixIndFirst(); i <= getDestDirSuffixIndLast(); i++) {
69:
70: String destDir = getDestDir(getDestDirPrefix(), i);
71: log(INFO + "tasks generation for " + destDir);
72: // creation of the DbmCluster task
73: Dbm dbm = new Dbm();
74:
75: dbm.setdataSources(dataSources);
76: dbm.setDestDir(new File(destDir));
77:
78: addTask(dbm);
79:
80: portInd++;
81:
82: }
83: }
84: }
|