01: /*
02: * Copyright 2002-2005 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: public void setDefaultValue(Object defaultValue) {
39: this .defaultValue = defaultValue;
40: }
41:
42: public Object getDefaultValue() {
43: return defaultValue;
44: }
45:
46: public void setPersistPolicy(String persistPolicy) {
47: this .persistPolicy = persistPolicy;
48: }
49:
50: public String getPersistPolicy() {
51: return persistPolicy;
52: }
53:
54: public void setPersistPeriod(int persistPeriod) {
55: this .persistPeriod = persistPeriod;
56: }
57:
58: public int getPersistPeriod() {
59: return persistPeriod;
60: }
61:
62: }
|