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: * http://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:
017: package 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</code>.
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: */
030: public 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: * Set the JMX ObjectName of this managed resource.
048: */
049: public void setObjectName(String objectName) {
050: this .objectName = objectName;
051: }
052:
053: /**
054: * Return the JMX ObjectName of this managed resource.
055: */
056: public String getObjectName() {
057: return this .objectName;
058: }
059:
060: public void setLog(boolean log) {
061: this .log = log;
062: }
063:
064: public boolean isLog() {
065: return this .log;
066: }
067:
068: public void setLogFile(String logFile) {
069: this .logFile = logFile;
070: }
071:
072: public String getLogFile() {
073: return this .logFile;
074: }
075:
076: public void setPersistPolicy(String persistPolicy) {
077: this .persistPolicy = persistPolicy;
078: }
079:
080: public String getPersistPolicy() {
081: return this .persistPolicy;
082: }
083:
084: public void setPersistPeriod(int persistPeriod) {
085: this .persistPeriod = persistPeriod;
086: }
087:
088: public int getPersistPeriod() {
089: return this .persistPeriod;
090: }
091:
092: public void setPersistName(String persistName) {
093: this .persistName = persistName;
094: }
095:
096: public String getPersistName() {
097: return this .persistName;
098: }
099:
100: public void setPersistLocation(String persistLocation) {
101: this .persistLocation = persistLocation;
102: }
103:
104: public String getPersistLocation() {
105: return this.persistLocation;
106: }
107:
108: }
|