KickJava   Java API By Example, From Geeks To Geeks.

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


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: WebLevel.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 Weblevel task
33  * @author Benoit Pelletier
34  */

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

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

45     public WebLevel() {
46         super();
47     }
48
49     /**
50      * Add tasks for Services 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 WebContainer configuration
62      * @param webContainerCluster added task
63      */

64     public void addConfiguredWebContainerCluster(WebContainerCluster webContainerCluster) {
65         webContainerCluster.setRootTask(getRootTask());
66         log(INFO + "WebContainerCluster added");
67         webContainerCluster.setLogInfo("WebContainerCluster");
68         addClusterTask(webContainerCluster);
69     }
70
71     /**
72      * Add tasks for LibCluster configuration
73      * @param libCluster added task
74      */

75     public void addConfiguredLibCluster(LibCluster libCluster) {
76         libCluster.setRootTask(getRootTask());
77         log(INFO + "LibCluster added");
78         libCluster.setLogInfo("LibCluster");
79         addClusterTask(libCluster);
80     }
81
82     /**
83      * Generates tasks for common
84      */

85     public void generatesTasks() {
86
87         for (Iterator JavaDoc it = this.getClusterTasks().iterator(); it.hasNext();) {
88             ClusterTasks ct = (ClusterTasks) it.next();
89
90             log(INFO + "tasks generation for " + ct.getLogInfo());
91
92             ct.setArch(getArch());
93             ct.setDestDirPrefix(getDestDirPrefix());
94             ct.setDestDirSuffixIndFirst(getDestDirSuffixIndFirst());
95             ct.setDestDirSuffixIndLast(getDestDirSuffixIndLast());
96             ct.generatesTasks();
97             addTasks(ct);
98         }
99     }
100
101 }
Popular Tags