001/*
002 * Copyright 2002-2007 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.jmx.export.metadata;
018
019/**
020 * Metadata that indicates to expose a given bean property as JMX attribute.
021 * Only valid when used on a JavaBean getter or setter.
022 *
023 * @author Rob Harrop
024 * @since 1.2
025 * @see org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
026 * @see org.springframework.jmx.export.MBeanExporter
027 */
028public class ManagedAttribute extends AbstractJmxAttribute {
029
030        public static final ManagedAttribute EMPTY = new ManagedAttribute();
031
032
033        private Object defaultValue;
034
035        private String persistPolicy;
036
037        private int persistPeriod = -1;
038
039
040        /**
041         * Set the default value of this attribute.
042         */
043        public void setDefaultValue(Object defaultValue) {
044                this.defaultValue = defaultValue;
045        }
046
047        /**
048         * Return the default value of this attribute.
049         */
050        public Object getDefaultValue() {
051                return this.defaultValue;
052        }
053
054        public void setPersistPolicy(String persistPolicy) {
055                this.persistPolicy = persistPolicy;
056        }
057
058        public String getPersistPolicy() {
059                return this.persistPolicy;
060        }
061
062        public void setPersistPeriod(int persistPeriod) {
063                this.persistPeriod = persistPeriod;
064        }
065
066        public int getPersistPeriod() {
067                return this.persistPeriod;
068        }
069
070}