01: /*
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
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: * Initial developer(s): Adriana Danes
22: * Contributor(s):
23: *
24: * --------------------------------------------------------------------------
25: * $Id: ReconfiguredProp.java 2162 2003-05-16 08:58:15Z benoitf $
26: * --------------------------------------------------------------------------
27: */
28: package org.objectweb.jonas.management;
29:
30: import java.util.Properties;
31:
32: /**
33: *
34: */
35: public class ReconfiguredProp implements Reconfigured {
36: String propName;
37: String propValue;
38: Properties props;
39:
40: /**
41: * true = the normal case : the provided propVale replaces the old one
42: * false = special case when a property value is a String composed of a list of ',' separated sub-Strings
43: * (for example : the jonas.service.jms.topics propery)
44: */
45: boolean replace;
46: /**
47: * If true, add a new sub-String . If false, remove a sub-String
48: */
49: boolean add;
50:
51: public ReconfiguredProp(String propName, String propValue,
52: boolean replace) {
53: this .propName = propName;
54: this .propValue = propValue;
55: this .replace = replace;
56: }
57:
58: public ReconfiguredProp(String propName, String propValue) {
59: this (propName, propValue, true);
60: }
61:
62: public String getPropName() {
63: return propName;
64: }
65:
66: public String getPropValue() {
67: return propValue;
68: }
69:
70: public void setProps(Properties props) {
71: this .props = props;
72: }
73:
74: public Properties getProps() {
75: return props;
76: }
77:
78: public boolean replaceProp() {
79: return replace;
80: }
81:
82: public void setAdd(boolean add) {
83: this .add = add;
84: }
85:
86: public boolean addProp() {
87: return add;
88: }
89: }
|