[jboss-user] [Microcontainer] - Re: To get Event when Jboss is called for shutdown

alesj do-not-reply at jboss.com
Mon Feb 25 05:51:16 EST 2008


"svsubramanyam007" wrote : I want to get event when jboss is called for shutdown.When i was walking through code i was not able to understand ..how to get event when it is about to shutdown...can anyone help me in understanding...whether it is possible to get event.
What's there to understand, it's a simple even/listener pattern:

  |       // Send a notification that server stop is initiated
  |       Notification msg = new Notification(STOP_NOTIFICATION_TYPE, this, 2);
  |       sendNotification(msg);
  | 
  | 	List currentList;
  | 	synchronized (lock) {
  | 	    currentList = listenerList;
  | 	}
  | 
  | 	final int size = currentList.size();
  | 	for (int i = 0; i < size; i++) {
  | 	    ListenerInfo li = (ListenerInfo) currentList.get(i);
  | 
  | 	    if (li.filter == null
  | 		|| li.filter.isNotificationEnabled(notification)) {
  | 		try {
  | 		    this.handleNotification(li.listener, notification,
  | 					    li.handback);
  | 		} catch (Exception e) {
  | 		    trace("sendNotification",
  | 			  "exception from listener: " + e);
  | 		}
  | 	    }
  | 	}
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131785#4131785

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131785



More information about the jboss-user mailing list