public void notifySipApplicationSessionListeners ( SipApplicationSessionEventType sipApplicationSessionEventType ) { List < SipApplicationSessionListener > listeners = sipContext . getListeners ( ) . getSipApplicationSessionListeners ( ) ; if ( listeners . size ( ) > 0 ) { ClassLoader oldClassLoader = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; sipContext . enterSipContext ( ) ; SipApplicationSessionEvent event = new SipApplicationSessionEvent ( this . getFacade ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "notifying sip application session listeners of context " + key . getApplicationName ( ) + " of following event " + sipApplicationSessionEventType ) ; } for ( SipApplicationSessionListener sipApplicationSessionListener : listeners ) { try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "notifying sip application session listener " + sipApplicationSessionListener . getClass ( ) . getName ( ) + " of context " + key . getApplicationName ( ) + " of following event " + sipApplicationSessionEventType ) ; } if ( SipApplicationSessionEventType . CREATION . equals ( sipApplicationSessionEventType ) ) { sipApplicationSessionListener . sessionCreated ( event ) ; } else if ( SipApplicationSessionEventType . DELETION . equals ( sipApplicationSessionEventType ) ) { sipApplicationSessionListener . sessionDestroyed ( event ) ; } else if ( SipApplicationSessionEventType . EXPIRATION . equals ( sipApplicationSessionEventType ) ) { sipApplicationSessionListener . sessionExpired ( event ) ; } else if ( SipApplicationSessionEventType . READYTOINVALIDATE . equals ( sipApplicationSessionEventType ) ) { sipApplicationSessionListener . sessionReadyToInvalidate ( event ) ; } } catch ( Throwable t ) { logger . error ( "SipApplicationSessionListener threw exception" , t ) ; } } sipContext . exitSipContext ( oldClassLoader ) ; } }
Notifies the listeners that a lifecycle event occured on that sip application session