Capturing Server Events

Lee Painter

The Maverick APIs have an event framework that enables you to capture and perform actions when an event is fired. 

This simply involved adding an EventListener to your code that will filter and process events, you may add as many listeners as you like.

EventServiceImplementation.getInstance().addListener( 
new EventListener() {
public void processEvent(Event evt) {

}
});

 

The supported events are provided as final static fields on the SSHDEventCodes class. The same mechanism can be used to capture both client and server events if the APIs are running within the same JVM.

You can filter server events only by using the following code within your processEvent(Event evt) method

if ((evt.getId() & SSHDEventCodes.SSHD_EVENT_CLASS) == SSHDEventCodes.SSHD_EVENT_CLASS) { 

}