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: Common.java 8379 2006-05-22 15:06:33Z pelletib $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas.ant.cluster;
026:
027: import java.util.Iterator;
028:
029: /**
030: * Common task
031: * @author Benoit Pelletier
032: */
033: public class Common extends ClusterTasks {
034:
035: /**
036: * Info for the logger
037: */
038: private static final String INFO = "[Common] ";
039:
040: /**
041: * Default constructor
042: */
043: public Common() {
044: super ();
045: }
046:
047: /**
048: * Add tasks for Carol configuration
049: * @param carolCluster added task
050: */
051: public void addConfiguredCarolCluster(CarolCluster carolCluster) {
052: carolCluster.setRootTask(getRootTask());
053: log(INFO + "CarolCluster added");
054: carolCluster.setLogInfo("CarolCluster");
055: addClusterTask(carolCluster);
056: }
057:
058: /**
059: * Add tasks for Db configuration
060: * @param dbCluster added task
061: */
062: public void addConfiguredDbCluster(DbCluster dbCluster) {
063: dbCluster.setRootTask(getRootTask());
064: log(INFO + "DbCluster added");
065: dbCluster.setLogInfo("DbCluster");
066: addClusterTask(dbCluster);
067: }
068:
069: /**
070: * Add tasks for Mail configuration
071: * @param mailCluster added task
072: */
073: public void addConfiguredMailCluster(MailCluster mailCluster) {
074: mailCluster.setRootTask(getRootTask());
075: log(INFO + "MailCluster added");
076: mailCluster.setLogInfo("MailCluster");
077: addClusterTask(mailCluster);
078: }
079:
080: /**
081: * Add tasks for Jms configuration
082: * @param jmsCluster added task
083: */
084: public void addConfiguredJmsCluster(JmsCluster jmsCluster) {
085: jmsCluster.setRootTask(getRootTask());
086: log(INFO + "JmsCluster added");
087: jmsCluster.setLogInfo("JmsCluster");
088: addClusterTask(jmsCluster);
089: }
090:
091: /**
092: * Add tasks for WsdlPublish configuration
093: * @param wsdlPublishCluster added task
094: */
095: public void addConfiguredWsdlPublishCluster(
096: WsdlPublishCluster wsdlPublishCluster) {
097: wsdlPublishCluster.setRootTask(getRootTask());
098: log(INFO + "WsdlPublishCluster added");
099: wsdlPublishCluster.setLogInfo("WsdlPublishCluster");
100: addClusterTask(wsdlPublishCluster);
101: }
102:
103: /**
104: * Add tasks for Discovery configuration
105: * @param discoveryCluster added task
106: */
107: public void addConfiguredDiscoveryCluster(
108: DiscoveryCluster discoveryCluster) {
109: discoveryCluster.setRootTask(getRootTask());
110: log(INFO + "DiscoveryCluster added");
111: discoveryCluster.setLogInfo("DiscoveryCluster");
112: addClusterTask(discoveryCluster);
113: }
114:
115: /**
116: * Generates tasks for common
117: */
118: public void generatesTasks() {
119:
120: for (Iterator it = this .getClusterTasks().iterator(); it
121: .hasNext();) {
122: ClusterTasks ct = (ClusterTasks) it.next();
123: log(INFO + "tasks generation for " + ct.getLogInfo());
124: ct.setArch(getArch());
125: ct.setDestDirPrefix(getDestDirPrefix());
126: ct.setDestDirSuffixIndFirst(getDestDirSuffixIndFirst());
127: ct.setDestDirSuffixIndLast(getDestDirSuffixIndLast());
128: ct.generatesTasks();
129: addTasks(ct);
130: }
131: }
132:
133: }
|