001/* 002 * Copyright 2002-2020 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.annotation; 018 019import java.lang.annotation.Documented; 020import java.lang.annotation.ElementType; 021import java.lang.annotation.Retention; 022import java.lang.annotation.RetentionPolicy; 023import java.lang.annotation.Target; 024 025/** 026 * Method-level annotation that indicates to expose a given bean property as a 027 * JMX attribute, corresponding to the 028 * {@link org.springframework.jmx.export.metadata.ManagedAttribute}. 029 * 030 * <p>Only valid when used on a JavaBean getter or setter. 031 * 032 * @author Rob Harrop 033 * @since 1.2 034 * @see org.springframework.jmx.export.metadata.ManagedAttribute 035 */ 036@Target(ElementType.METHOD) 037@Retention(RetentionPolicy.RUNTIME) 038@Documented 039public @interface ManagedAttribute { 040 041 /** 042 * Set the default value for the attribute in a {@link javax.management.Descriptor}. 043 */ 044 String defaultValue() default ""; 045 046 /** 047 * Set the description for the attribute in a {@link javax.management.Descriptor}. 048 */ 049 String description() default ""; 050 051 /** 052 * Set the currency time limit field in a {@link javax.management.Descriptor}. 053 */ 054 int currencyTimeLimit() default -1; 055 056 /** 057 * Set the persistPolicy field in a {@link javax.management.Descriptor}. 058 */ 059 String persistPolicy() default ""; 060 061 /** 062 * Set the persistPeriod field in a {@link javax.management.Descriptor}. 063 */ 064 int persistPeriod() default -1; 065 066}