*/
private DirectConsumer _createAndAddConsumer(String methodName,
Destination destination,
String selector, String durableName, boolean noLocal)
throws JMSException {
JMSServiceReply reply;
long consumerId = 0L;
com.sun.messaging.jmq.jmsservice.Destination jmsservice_dest;
if (_logFINE){
_loggerJS.fine(_lgrMID_INF + "sessionId=" + this.sessionId +
":" + methodName +
":Destination=" + destination + ":Selector=" + selector +
":DurableName=" + durableName + ":noLocal=" + noLocal);
}
this._checkIfClosed(methodName);
jmsservice_dest = this._checkDestinationForConsumer(destination);
DirectConsumer consumer = new DirectConsumer(this, jmsservice,
destination, jmsservice_dest, noLocal, selector, durableName);
try {
reply = jmsservice.addConsumer(connectionId, sessionId,
jmsservice_dest, selector, durableName,
this.getConnection()._getClientID(),
noLocal,
//XXX:tharakan:using false for shared temporarily
false);
try {
//Set consumerId right away
consumerId = reply.getJMQConsumerID();
consumer._setConsumerId(consumerId);
} catch (NoSuchFieldException nsfe){
String exerrmsg = _lgrMID_EXC +
"JMSServiceException:Missing JMQConsumerID";
JMSException jmse = new JMSException(exerrmsg);