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: WebLevel.java 6896 2005-06-07 08:21:28Z pelletib $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas.ant.cluster;
026:
027: import java.util.Iterator;
028:
029: /**
030: * Defines Weblevel task
031: * @author Benoit Pelletier
032: */
033: public class WebLevel extends ClusterTasks {
034:
035: /**
036: * Info for the logger
037: */
038: private static final String INFO = "[WebLevel] ";
039:
040: /**
041: * Default constructor
042: */
043: public WebLevel() {
044: super ();
045: }
046:
047: /**
048: * Add tasks for Services 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 WebContainer configuration
061: * @param webContainerCluster added task
062: */
063: public void addConfiguredWebContainerCluster(
064: WebContainerCluster webContainerCluster) {
065: webContainerCluster.setRootTask(getRootTask());
066: log(INFO + "WebContainerCluster added");
067: webContainerCluster.setLogInfo("WebContainerCluster");
068: addClusterTask(webContainerCluster);
069: }
070:
071: /**
072: * Add tasks for LibCluster configuration
073: * @param libCluster added task
074: */
075: public void addConfiguredLibCluster(LibCluster libCluster) {
076: libCluster.setRootTask(getRootTask());
077: log(INFO + "LibCluster added");
078: libCluster.setLogInfo("LibCluster");
079: addClusterTask(libCluster);
080: }
081:
082: /**
083: * Generates tasks for common
084: */
085: public void generatesTasks() {
086:
087: for (Iterator it = this .getClusterTasks().iterator(); it
088: .hasNext();) {
089: ClusterTasks ct = (ClusterTasks) it.next();
090:
091: log(INFO + "tasks generation for " + ct.getLogInfo());
092:
093: ct.setArch(getArch());
094: ct.setDestDirPrefix(getDestDirPrefix());
095: ct.setDestDirSuffixIndFirst(getDestDirSuffixIndFirst());
096: ct.setDestDirSuffixIndLast(getDestDirSuffixIndLast());
097: ct.generatesTasks();
098: addTasks(ct);
099: }
100: }
101:
102: }
|