01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.ant.taskdefs.server;
23:
24: import org.apache.tools.ant.BuildException;
25: import org.apache.tools.ant.Task;
26: import org.jboss.test.util.server.Server;
27: import org.jboss.test.util.server.ServerManager;
28:
29: /**
30: * A ConfigManagerTask. Delegates to the Server manager.
31: *
32: * @author <a href="ryan.campbell@jboss.com">Ryan Campbell</a>
33: * @version $Revision: 57204 $
34: */
35: public class ConfigManagerTask extends Task {
36: /** The key for the project reference **/
37: protected static final String MANAGER_REF = "serverManager";
38:
39: ServerManager manager = null;
40:
41: /**
42: * Create a new ConfigManagerTask.
43: *
44: *
45: */
46: public ConfigManagerTask() {
47: manager = new ServerManager();
48: }
49:
50: /**
51: * Create a server manager using the specified configuration.
52: */
53: public void execute() throws BuildException {
54: if (getProject().getReference(MANAGER_REF) == null) {
55: getProject().addReference(MANAGER_REF, manager);
56: }
57: }
58:
59: /**
60: * Add a server.
61: */
62: public void addServer(Server server) {
63: manager.addServer(server);
64: }
65:
66: /**
67: * JAVA_HOME to start jboss with.
68: * @param javaHome
69: */
70: public void setJavaHome(String javaHome) {
71: manager.setJavaHome(javaHome);
72: }
73:
74: /**
75: * JBoss dist to start.
76: * @param jbossHome
77: */
78: public void setJbossHome(String jbossHome) {
79: manager.setJbossHome(jbossHome);
80: }
81:
82: /**
83: * JVM command to use default is "java"
84: * @param jvm
85: */
86: public void setJvm(String jvm) {
87: manager.setJvm(jvm);
88: }
89:
90: /**
91: * The UDP group to pass to org.jboss.Main using
92: * the -u option.
93: */
94: public void setUdpGroup(String udpGroup) {
95: manager.setUdpGroup(udpGroup);
96: }
97: }
|