KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

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

64     public void addConfiguredDbCluster(DbCluster dbCluster) {
65         dbCluster.setRootTask(getRootTask());
66         log(INFO + "DbCluster added");
67         dbCluster.setLogInfo("DbCluster");
68         addClusterTask(dbCluster);
69     }
70
71     /**
72      * Add tasks for Mail configuration
73      * @param mailCluster added task
74      */

75     public void addConfiguredMailCluster(MailCluster mailCluster) {
76         mailCluster.setRootTask(getRootTask());
77         log(INFO + "MailCluster added");
78         mailCluster.setLogInfo("MailCluster");
79         addClusterTask(mailCluster);
80     }
81
82     /**
83      * Add tasks for Jms configuration
84      * @param jmsCluster added task
85      */

86     public void addConfiguredJmsCluster(JmsCluster jmsCluster) {
87         jmsCluster.setRootTask(getRootTask());
88         log(INFO + "JmsCluster added");
89         jmsCluster.setLogInfo("JmsCluster");
90         addClusterTask(jmsCluster);
91     }
92
93     /**
94      * Add tasks for WsdlPublish configuration
95      * @param wsdlPublishCluster added task
96      */

97     public void addConfiguredWsdlPublishCluster(WsdlPublishCluster wsdlPublishCluster) {
98         wsdlPublishCluster.setRootTask(getRootTask());
99         log(INFO + "WsdlPublishCluster added");
100         wsdlPublishCluster.setLogInfo("WsdlPublishCluster");
101         addClusterTask(wsdlPublishCluster);
102     }
103
104     /**
105      * Add tasks for Discovery configuration
106      * @param discoveryCluster added task
107      */

108     public void addConfiguredDiscoveryCluster(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 JavaDoc it = this.getClusterTasks().iterator(); it.hasNext();) {
121             ClusterTasks ct = (ClusterTasks) it.next();
122             log(INFO + "tasks generation for " + ct.getLogInfo());
123             ct.setArch(getArch());
124             ct.setDestDirPrefix(getDestDirPrefix());
125             ct.setDestDirSuffixIndFirst(getDestDirSuffixIndFirst());
126             ct.setDestDirSuffixIndLast(getDestDirSuffixIndLast());
127             ct.generatesTasks();
128             addTasks(ct);
129         }
130     }
131
132 }
Popular Tags