KickJava   Java API By Example, From Geeks To Geeks.

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


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: EjbLevel.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.util.Iterator JavaDoc;
30
31 /**
32  * Defines Ejblevel task
33  * @author Benoit Pelletier
34  */

35 public class EjbLevel extends ClusterTasks {
36
37     /**
38      * Info for the logger
39      */

40     private static final String JavaDoc INFO = "[EjbLevel] ";
41
42     /**
43      * Default constructor
44      */

45     public EjbLevel() {
46         super();
47     }
48
49     /**
50      * Add tasks for servicesCluster configuration
51      * @param servicesCluster added task
52      */

53     public void addConfiguredServicesCluster(ServicesCluster servicesCluster) {
54         servicesCluster.setRootTask(getRootTask());
55         log(INFO + "ServicesCluster added");
56         servicesCluster.setLogInfo("ServicesCluster");
57         addClusterTask(servicesCluster);
58     }
59
60     /**
61      * Add tasks for jdbcRaCluster configuration
62      * @param jdbcRaCluster added task
63      */

64     public void addConfiguredJdbcRaCluster(JdbcRaCluster jdbcRaCluster) {
65         jdbcRaCluster.setRootTask(getRootTask());
66         log(INFO + "JdbcRaCluster added");
67         jdbcRaCluster.setLogInfo("JdbcRaCluster");
68         addClusterTask(jdbcRaCluster);
69     }
70
71     /**
72      * Add tasks for DbmCluster configuration
73      * @param dbmCluster added task
74      */

75     public void addConfiguredDbmCluster(DbmCluster dbmCluster) {
76         dbmCluster.setRootTask(getRootTask());
77         log(INFO + "DbmCluster added");
78         dbmCluster.setLogInfo("DbmCluster");
79         addClusterTask(dbmCluster);
80     }
81
82     /**
83      * Add tasks for LibCluster configuration
84      * @param libCluster added task
85      */

86     public void addConfiguredLibCluster(LibCluster libCluster) {
87         libCluster.setRootTask(getRootTask());
88         log(INFO + "LibCluster added");
89         libCluster.setLogInfo("LibCluster");
90         addClusterTask(libCluster);
91     }
92
93     /**
94      * Generates tasks for common
95      */

96     public void generatesTasks() {
97
98         for (Iterator JavaDoc it = this.getClusterTasks().iterator(); it.hasNext();) {
99             ClusterTasks ct = (ClusterTasks) it.next();
100             log(INFO + "tasks generation for " + ct.getLogInfo());
101             ct.setArch(getArch());
102             ct.setDestDirPrefix(getDestDirPrefix());
103             ct.setDestDirSuffixIndFirst(getDestDirSuffixIndFirst());
104             ct.setDestDirSuffixIndLast(getDestDirSuffixIndLast());
105             ct.generatesTasks();
106             addTasks(ct);
107         }
108     }
109
110 }
Popular Tags