|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.system.ListenerServiceMBeanSupport
org.jboss.monitor.services.NotificationListener
public class NotificationListener
A simple JMX notification listener that outputs notifications as log.INFO messages, and demonstrates the usefulness of ListenerServiceMBeanSupport.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jboss.system.ListenerServiceMBeanSupport |
---|
org.jboss.system.ListenerServiceMBeanSupport.SubscriptionInfo |
Field Summary | |
---|---|
protected org.jboss.logging.DynamicLogger |
log
The dynamic logger |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ListenerServiceMBean |
---|
SL_FILTER_ELEMENT, SL_FILTER_FACTORY_ATTRIBUTE, SL_MBEAN_ELEMENT, SL_MBEAN_HANDBACK_ATTRIBUTE, SL_MBEAN_NAME_ATTRIBUTE, SL_NOTIFICATION_ELEMENT, SL_NOTIFICATION_TYPE_ATTRIBUTE, SL_ROOT_ELEMENT |
Fields inherited from interface org.jboss.system.ServiceMBean |
---|
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
---|---|
NotificationListener()
CTOR |
Method Summary | |
---|---|
boolean |
getDynamicSubscriptions()
Gets the dynamic subscriptions status |
String |
getLogLevel()
Gets the dynamic log level |
long |
getNotificationCount()
Number of notifications received. |
javax.management.ObjectName |
getNotificationListener()
Gets listener of notifications |
void |
handleNotification2(javax.management.Notification notification,
Object handback)
Overriden to add handling! |
void |
setDynamicSubscriptions(boolean dynamicSubscriptions)
Enables/disables dynamic subscriptions |
void |
setLogLevel(String logLevel)
Sets the dynamic log level |
void |
setNotificationListener(javax.management.ObjectName notificationListener)
Sets listener of notifications |
void |
startService()
Start |
void |
stopService()
Stop |
Methods inherited from class org.jboss.system.ListenerServiceMBeanSupport |
---|
handleNotification, setSubscriptionList, subscribe, subscribe, subscribe, unsubscribe |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.ListenerServiceMBean |
---|
setSubscriptionList |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Field Detail |
---|
protected org.jboss.logging.DynamicLogger log
Constructor Detail |
---|
public NotificationListener()
Method Detail |
---|
public long getNotificationCount()
getNotificationCount
in interface NotificationListenerMBean
public void setDynamicSubscriptions(boolean dynamicSubscriptions)
setDynamicSubscriptions
in interface NotificationListenerMBean
public boolean getDynamicSubscriptions()
getDynamicSubscriptions
in interface NotificationListenerMBean
public void setNotificationListener(javax.management.ObjectName notificationListener)
setNotificationListener
in interface NotificationListenerMBean
public javax.management.ObjectName getNotificationListener()
getNotificationListener
in interface NotificationListenerMBean
public void setLogLevel(String logLevel)
setLogLevel
in interface NotificationListenerMBean
public String getLogLevel()
getLogLevel
in interface NotificationListenerMBean
public void startService() throws Exception
startService
in class org.jboss.system.ServiceMBeanSupport
Exception
public void stopService() throws Exception
stopService
in class org.jboss.system.ServiceMBeanSupport
Exception
public void handleNotification2(javax.management.Notification notification, Object handback)
handleNotification2
in class org.jboss.system.ListenerServiceMBeanSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |