01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: * --------------------------------------------------------------------------
22: * $Id: ClusterDaemonConfiguration.java 8443 2006-06-09 10:01:52Z pelletib $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_clusterd.api;
25:
26: import org.objectweb.jonas_clusterd.xml.ClusterDaemon;
27:
28: import org.objectweb.jonas_lib.deployment.api.AbsDeploymentDesc;
29:
30: /**
31: * This class provides a cluster daemon configuration structure as described by the
32: * description file.
33: * It extends the AbsDeploymentDesc which requires to implement toString()
34: * and provides getSAXMsg() method (displayName is not used by ClusterDaemonConfiguration).
35: * @author Benoit Pelletier
36: */
37:
38: public class ClusterDaemonConfiguration extends AbsDeploymentDesc {
39:
40: /**
41: * The cluster daemon configuraton
42: */
43: private ClusterDaemon clusterDaemon = null;
44:
45: /**
46: * Constructor
47: * @param clusterDaemon Cluster daemon
48: */
49: public ClusterDaemonConfiguration(ClusterDaemon clusterDaemon) {
50:
51: this .clusterDaemon = clusterDaemon;
52:
53: }
54:
55: /**
56: * Return a String representation of the ClusterDaemonConfiguration
57: * @return a String representation of the ClusterDaemonConfiguration
58: */
59: public String toString() {
60:
61: return toXML();
62: }
63:
64: /**
65: *
66: * @return Return a XML representation of the clusterDaemonConfiguration
67: */
68: public String toXML() {
69:
70: StringBuffer sb = new StringBuffer();
71: sb.append("<?xml version=\"1.0\"?>\n");
72: sb.append(clusterDaemon.toXML());
73: return sb.toString();
74: }
75:
76: /**
77: *
78: * @return the cluster daemon bean
79: */
80: public ClusterDaemon getClusterDaemon() {
81: return clusterDaemon;
82: }
83:
84: /**
85: *
86: * Set the cluster daemon bean
87: * @param clusterDaemon cluster daemon
88: */
89: public void setClusterDaemon(ClusterDaemon clusterDaemon) {
90: this.clusterDaemon = clusterDaemon;
91: }
92: }
|