KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > ant > cluster > DbmCluster


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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,v 1.1 2005/06/07 08:21:27 pelletib Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas.ant.cluster;
28
29 import java.io.File JavaDoc;
30 import org.objectweb.jonas.ant.jonasbase.Dbm;
31
32 /**
33  * Define DbmCluster task
34  * @author Benoit Pelletier
35  */

36 public class DbmCluster extends ClusterTasks {
37
38     /**
39      * Info for the logger
40      */

41     private static final String JavaDoc INFO = "[DbmCluster] ";
42
43     /**
44      * dataSource
45      */

46     private String JavaDoc dataSources = null;
47
48     /**
49      * Default constructor
50      */

51     public DbmCluster() {
52         super();
53     }
54
55     /**
56      * Set the dataSources for the Dbm service
57      * @param dataSources the dataSources for the Dbm service
58      */

59     public void setdataSources(String JavaDoc dataSources) {
60             this.dataSources = dataSources;
61     }
62
63     /**
64      * Generates the DbmCluster tasks for each JOnAS's instances
65      */

66     public void generatesTasks() {
67
68         int portInd = 0;
69
70         for (int i = getDestDirSuffixIndFirst(); i <= getDestDirSuffixIndLast(); i++) {
71
72             String JavaDoc destDir = getDestDir(getDestDirPrefix(), i);
73             log(INFO + "tasks generation for " + destDir);
74             // creation of the DbmCluster task
75
Dbm dbm = new Dbm();
76
77             dbm.setdataSources(dataSources);
78             dbm.setDestDir(new File JavaDoc(destDir));
79
80             addTask(dbm);
81
82             portInd++;
83
84         }
85     }
86 }
Popular Tags