public < T extends BasicMessage > void listen ( ConsumerConnectionContext context , AbstractBasicMessageListener < T > listener ) throws JMSException { if ( context == null ) { throw new NullPointerException ( "context must not be null" ) ; } if ( listener == null ) { throw new NullPointerException ( "listener must not be null" ) ; } MessageConsumer consumer = context . getMessageConsumer ( ) ; if ( consumer == null ) { throw new NullPointerException ( "context had a null consumer" ) ; } listener . setConsumerConnectionContext ( context ) ; consumer . setMessageListener ( listener ) ; }
Listens for messages .