1 16 17 package org.springframework.jmx.export; 18 19 import javax.management.NotificationFilter ; 20 import javax.management.NotificationListener ; 21 22 import org.springframework.beans.factory.InitializingBean; 23 import org.springframework.util.Assert; 24 25 39 public class NotificationListenerBean implements InitializingBean { 40 41 private NotificationListener notificationListener; 42 43 private NotificationFilter notificationFilter; 44 45 private Object handback; 46 47 private String [] mappedObjectNames; 48 49 50 53 public NotificationListenerBean() { 54 } 55 56 60 public NotificationListenerBean(NotificationListener notificationListener) { 61 this.notificationListener = notificationListener; 62 } 63 64 65 69 public void setNotificationListener(NotificationListener notificationListener) { 70 this.notificationListener = notificationListener; 71 } 72 73 77 public NotificationListener getNotificationListener() { 78 return notificationListener; 79 } 80 81 87 public void setNotificationFilter(NotificationFilter notificationFilter) { 88 this.notificationFilter = notificationFilter; 89 } 90 91 97 public NotificationFilter getNotificationFilter() { 98 return notificationFilter; 99 } 100 101 109 public void setHandback(Object handback) { 110 this.handback = handback; 111 } 112 113 120 public Object getHandback() { 121 return handback; 122 } 123 124 133 public void setMappedObjectName(String mappedObjectName) { 134 setMappedObjectNames(mappedObjectName != null ? new String [] {mappedObjectName} : null); 135 } 136 137 146 public void setMappedObjectNames(String [] mappedObjectNames) { 147 this.mappedObjectNames = mappedObjectNames; 148 } 149 150 156 public String [] getMappedObjectNames() { 157 return mappedObjectNames; 158 } 159 160 161 165 public void afterPropertiesSet() { 166 Assert.notNull(this.notificationListener, "Property 'notificationListener' is required"); 167 } 168 169 } 170 | Popular Tags |