01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.jmx.export.metadata;
18:
19: /**
20: * Metadata that indicates to expose a given bean property as JMX attribute.
21: * Only valid when used on a JavaBean getter or setter.
22: *
23: * @author Rob Harrop
24: * @since 1.2
25: * @see org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
26: * @see org.springframework.jmx.export.MBeanExporter
27: */
28: public class ManagedAttribute extends AbstractJmxAttribute {
29:
30: public static final ManagedAttribute EMPTY = new ManagedAttribute();
31:
32: private Object defaultValue;
33:
34: private String persistPolicy;
35:
36: private int persistPeriod = -1;
37:
38: /**
39: * Set the default value of this attribute.
40: */
41: public void setDefaultValue(Object defaultValue) {
42: this .defaultValue = defaultValue;
43: }
44:
45: /**
46: * Return the default value of this attribute.
47: */
48: public Object getDefaultValue() {
49: return this .defaultValue;
50: }
51:
52: public void setPersistPolicy(String persistPolicy) {
53: this .persistPolicy = persistPolicy;
54: }
55:
56: public String getPersistPolicy() {
57: return this .persistPolicy;
58: }
59:
60: public void setPersistPeriod(int persistPeriod) {
61: this .persistPeriod = persistPeriod;
62: }
63:
64: public int getPersistPeriod() {
65: return this.persistPeriod;
66: }
67:
68: }
|