001/*
002 * Copyright 2002-2012 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 indicating that instances of an annotated class
021 * are to be registered with a JMX server.
022 * Only valid when used on a {@code Class}.
023 *
024 * @author Rob Harrop
025 * @since 1.2
026 * @see org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
027 * @see org.springframework.jmx.export.naming.MetadataNamingStrategy
028 * @see org.springframework.jmx.export.MBeanExporter
029 */
030public class ManagedResource extends AbstractJmxAttribute {
031
032        private String objectName;
033
034        private boolean log = false;
035
036        private String logFile;
037
038        private String persistPolicy;
039
040        private int persistPeriod = -1;
041
042        private String persistName;
043
044        private String persistLocation;
045
046
047        /**
048         * Set the JMX ObjectName of this managed resource.
049         */
050        public void setObjectName(String objectName) {
051                this.objectName = objectName;
052        }
053
054        /**
055         * Return the JMX ObjectName of this managed resource.
056         */
057        public String getObjectName() {
058                return this.objectName;
059        }
060
061        public void setLog(boolean log) {
062                this.log = log;
063        }
064
065        public boolean isLog() {
066                return this.log;
067        }
068
069        public void setLogFile(String logFile) {
070                this.logFile = logFile;
071        }
072
073        public String getLogFile() {
074                return this.logFile;
075        }
076
077        public void setPersistPolicy(String persistPolicy) {
078                this.persistPolicy = persistPolicy;
079        }
080
081        public String getPersistPolicy() {
082                return this.persistPolicy;
083        }
084
085        public void setPersistPeriod(int persistPeriod) {
086                this.persistPeriod = persistPeriod;
087        }
088
089        public int getPersistPeriod() {
090                return this.persistPeriod;
091        }
092
093        public void setPersistName(String persistName) {
094                this.persistName = persistName;
095        }
096
097        public String getPersistName() {
098                return this.persistName;
099        }
100
101        public void setPersistLocation(String persistLocation) {
102                this.persistLocation = persistLocation;
103        }
104
105        public String getPersistLocation() {
106                return this.persistLocation;
107        }
108
109}