JmsMsgConsumer instantiateConsumer ( ConsumerProperties consumerProperties ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "instantiateConsumer" , consumerProperties ) ; JmsMsgConsumer messageConsumer = new JmsMsgConsumerImpl ( coreConnection , this , consumerProperties ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "instantiateConsumer" , messageConsumer ) ; return messageConsumer ; }
This method is overriden by subclasses in order to instantiate an instance of the MsgConsumer class . This means that the QueueSession . createReceiver method can delegate straight to Session . createConsumer and still get back an instance of a QueueReceiver rather than a vanilla MessageConsumer .