001/* 002 * Copyright 2002-2014 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 019import org.springframework.util.StringUtils; 020 021/** 022 * Metadata that indicates a JMX notification emitted by a bean. 023 * 024 * @author Rob Harrop 025 * @since 2.0 026 */ 027public class ManagedNotification { 028 029 private String[] notificationTypes; 030 031 private String name; 032 033 private String description; 034 035 036 /** 037 * Set a single notification type, or a list of notification types 038 * as comma-delimited String. 039 */ 040 public void setNotificationType(String notificationType) { 041 this.notificationTypes = StringUtils.commaDelimitedListToStringArray(notificationType); 042 } 043 044 /** 045 * Set a list of notification types. 046 */ 047 public void setNotificationTypes(String... notificationTypes) { 048 this.notificationTypes = notificationTypes; 049 } 050 051 /** 052 * Return the list of notification types. 053 */ 054 public String[] getNotificationTypes() { 055 return this.notificationTypes; 056 } 057 058 /** 059 * Set the name of this notification. 060 */ 061 public void setName(String name) { 062 this.name = name; 063 } 064 065 /** 066 * Return the name of this notification. 067 */ 068 public String getName() { 069 return this.name; 070 } 071 072 /** 073 * Set a description for this notification. 074 */ 075 public void setDescription(String description) { 076 this.description = description; 077 } 078 079 /** 080 * Return a description for this notification. 081 */ 082 public String getDescription() { 083 return this.description; 084 } 085 086}