001/*
002 * Copyright 2002-2011 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.notification;
018
019import org.springframework.beans.factory.Aware;
020
021/**
022 * Interface to be implemented by any Spring-managed resource that is to be
023 * registered with an {@link javax.management.MBeanServer} and wishes to send
024 * JMX {@link javax.management.Notification javax.management.Notifications}.
025 *
026 * <p>Provides Spring-created managed resources with a {@link NotificationPublisher}
027 * as soon as they are registered with the {@link javax.management.MBeanServer}.
028 *
029 * <p><b>NOTE:</b> This interface only applies to simple Spring-managed
030 * beans which happen to get exported through Spring's
031 * {@link org.springframework.jmx.export.MBeanExporter}.
032 * It does not apply to any non-exported beans; neither does it apply
033 * to standard MBeans exported by Spring. For standard JMX MBeans,
034 * consider implementing the {@link javax.management.modelmbean.ModelMBeanNotificationBroadcaster}
035 * interface (or implementing a full {@link javax.management.modelmbean.ModelMBean}).
036 *
037 * @author Rob Harrop
038 * @author Chris Beams
039 * @since 2.0
040 * @see NotificationPublisher
041 */
042public interface NotificationPublisherAware extends Aware {
043
044        /**
045         * Set the {@link NotificationPublisher} instance for the current managed resource instance.
046         */
047        void setNotificationPublisher(NotificationPublisher notificationPublisher);
048
049}