001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 2005 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer: Benoit Pelletier
022: * --------------------------------------------------------------------------
023: * $Id: EjbLevel.java 8231 2006-04-11 14:23:27Z pelletib $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas.ant.cluster;
026:
027: import java.util.Iterator;
028:
029: /**
030: * Defines Ejblevel task
031: * @author Benoit Pelletier
032: */
033: public class EjbLevel extends ClusterTasks {
034:
035: /**
036: * Info for the logger
037: */
038: private static final String INFO = "[EjbLevel] ";
039:
040: /**
041: * Default constructor
042: */
043: public EjbLevel() {
044: super ();
045: }
046:
047: /**
048: * Add tasks for servicesCluster configuration
049: * @param servicesCluster added task
050: */
051: public void addConfiguredServicesCluster(
052: ServicesCluster servicesCluster) {
053: servicesCluster.setRootTask(getRootTask());
054: log(INFO + "ServicesCluster added");
055: servicesCluster.setLogInfo("ServicesCluster");
056: addClusterTask(servicesCluster);
057: }
058:
059: /**
060: * Add tasks for jdbcRaCluster configuration
061: * @param jdbcRaCluster added task
062: */
063: public void addConfiguredJdbcRaCluster(JdbcRaCluster jdbcRaCluster) {
064: jdbcRaCluster.setRootTask(getRootTask());
065: log(INFO + "JdbcRaCluster added");
066: jdbcRaCluster.setLogInfo("JdbcRaCluster");
067: addClusterTask(jdbcRaCluster);
068: }
069:
070: /**
071: * Add tasks for DbmCluster configuration
072: * @param dbmCluster added task
073: */
074: public void addConfiguredDbmCluster(DbmCluster dbmCluster) {
075: dbmCluster.setRootTask(getRootTask());
076: log(INFO + "DbmCluster added");
077: dbmCluster.setLogInfo("DbmCluster");
078: addClusterTask(dbmCluster);
079: }
080:
081: /**
082: * Add tasks for HaCluster configuration
083: * @param haCluster added task
084: */
085: public void addConfiguredHaCluster(HaCluster haCluster) {
086: haCluster.setRootTask(getRootTask());
087: log(INFO + "HaCluster added");
088: haCluster.setLogInfo("HaCluster");
089: addClusterTask(haCluster);
090: }
091:
092: /**
093: * Add tasks for LibCluster configuration
094: * @param libCluster added task
095: */
096: public void addConfiguredLibCluster(LibCluster libCluster) {
097: libCluster.setRootTask(getRootTask());
098: log(INFO + "LibCluster added");
099: libCluster.setLogInfo("LibCluster");
100: addClusterTask(libCluster);
101: }
102:
103: /**
104: * Generates tasks for common
105: */
106: public void generatesTasks() {
107:
108: for (Iterator it = this .getClusterTasks().iterator(); it
109: .hasNext();) {
110: ClusterTasks ct = (ClusterTasks) it.next();
111: log(INFO + "tasks generation for " + ct.getLogInfo());
112: ct.setArch(getArch());
113: ct.setDestDirPrefix(getDestDirPrefix());
114: ct.setDestDirSuffixIndFirst(getDestDirSuffixIndFirst());
115: ct.setDestDirSuffixIndLast(getDestDirSuffixIndLast());
116: ct.generatesTasks();
117: addTasks(ct);
118: }
119: }
120:
121: }
|