JmsMsgProducer instantiateProducer ( Destination jmsDestination ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "instantiateProducer" , jmsDestination ) ; JmsMsgProducer messageProducer = new JmsMsgProducerImpl ( jmsDestination , coreConnection , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "instantiateProducer" , messageProducer ) ; return messageProducer ; }
This method is overriden by subclasses in order to instantiate an instance of the MsgProducer class . This means that the QueueSession . createSender method can delegate straight to Session . createProducer and still get back an instance of a QueueSender rather than a vanilla MessageProducer .