Sun GlassFish Message Queue 4.4 Developer's Guide for Java Clients

Event Listener Examples

In this example, an application chooses to have its event listener log the connection event to the application's logging system.

public class ApplicationEventListener implements
				com.sun.messaging.jms.notification.EventListener {

public void onEvent ( com.sun.messaging.jms.notification.Event connEvent ) {
      	log (connEvent);
private void log ( com.sun.messaging.jms.notification.Event connEvent ) {
	       String eventCode = connEvent.getEventCode(); 
      	String eventMessage = connEvent.getEventMessage();
    	  //write event information to the output stream.