protected void createConsumer ( ConsumerConnectionContext context , String messageSelector ) throws JMSException { if ( context == null ) { throw new IllegalStateException ( "The context is null" ) ; } Session session = context . getSession ( ) ; if ( session == null ) { throw new IllegalStateException ( "The context had a null session" ) ; } Destination dest = context . getDestination ( ) ; if ( dest == null ) { throw new IllegalStateException ( "The context had a null destination" ) ; } MessageConsumer consumer = session . createConsumer ( dest , messageSelector ) ; context . setMessageConsumer ( consumer ) ; }
Creates a message consumer using the context s session and destination .