private void invokeChainedMethod ( Event event ) { Queue < MethodWrapper > queue = conversationQueueMap . get ( event . getSender ( ) . getId ( ) ) ; if ( queue != null && ! queue . isEmpty ( ) ) { MethodWrapper methodWrapper = queue . peek ( ) ; try { EventType [ ] eventTypes = methodWrapper . getMethod ( ) . getAnnotation ( Controller . class ) . events ( ) ; for ( EventType eventType : eventTypes ) { if ( eventType . name ( ) . equalsIgnoreCase ( event . getType ( ) . name ( ) ) ) { methodWrapper . getMethod ( ) . invoke ( this , event ) ; return ; } } } catch ( Exception e ) { logger . error ( "Error invoking chained method: " , e ) ; } } }
Invoke the appropriate method in a conversation .