private void addNotificationListener ( ObjectName objectName , final String correlationKey , MBeanServerConnection serverConnection ) { try { notificationListener = new NotificationListener ( ) { @ Override public void handleNotification ( Notification notification , Object handback ) { correlationManager . store ( correlationKey , new DefaultMessage ( notification . getMessage ( ) ) ) ; } } ; serverConnection . addNotificationListener ( objectName , notificationListener , getEndpointConfiguration ( ) . getNotificationFilter ( ) , getEndpointConfiguration ( ) . getNotificationHandback ( ) ) ; } catch ( InstanceNotFoundException e ) { throw new CitrusRuntimeException ( "Failed to find object name instance" , e ) ; } catch ( IOException e ) { throw new CitrusRuntimeException ( "Failed to add notification listener" , e ) ; } }
Add notification listener for response messages .