public ConsumerDelegate createConsumerDelegate(Destination jmsDestination) throws JBossJMSException
public ConsumerDelegate createConsumerDelegate(Destination jmsDestination, String selector) throws JMSException
   public ConsumerDelegate createConsumerDelegate(Destination jmsDestination)         throws JBossJMSException   {      // look-up destination      DestinationManager dm = serverPeer.getDestinationManager();      AbstractDestination destination = null;      try      {         destination = dm.getDestination(jmsDestination);      }      catch(Exception e)      {         throw new JBossJMSException("Cannot map destination " + jmsDestination, e);      }      // create the MessageConsumer dynamic proxy      String stackName = "ConsumerStack";      AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);      // TODO why do I need to the advisor to create the interceptor stack?      Interceptor[] interceptors = stack.createInterceptors(serverPeer.getSessionAdvisor(), null);      JMSConsumerInvocationHandler h = new JMSConsumerInvocationHandler(interceptors);      String consumerID = generateConsumerID();      SimpleMetaData metadata = new SimpleMetaData();      metadata.addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, serverPeer.getConsumerAdvisor().getName(), PayloadKey.AS_IS);      metadata.addMetaData(InvokerInterceptor.REMOTING,                           InvokerInterceptor.INVOKER_LOCATOR,                           serverPeer.getLocator(),                           PayloadKey.AS_IS);      metadata.addMetaData(InvokerInterceptor.REMOTING,                           InvokerInterceptor.SUBSYSTEM,                           "JMS",                           PayloadKey.AS_IS);      // TODO: Is this really necessary? Can't I just use the consumerID?      metadata.addMetaData(JMSAdvisor.JMS, JMSAdvisor.CLIENT_ID, connectionEndpoint.getClientID(), PayloadKey.AS_IS);      metadata.addMetaData(JMSAdvisor.JMS, JMSAdvisor.SESSION_ID, sessionID, PayloadKey.AS_IS);      metadata.addMetaData(JMSAdvisor.JMS, JMSAdvisor.CONSUMER_ID, consumerID, PayloadKey.AS_IS);      h.getMetaData().mergeIn(metadata);      // TODO      ClassLoader loader = getClass().getClassLoader();      Class[] interfaces = new Class[] { ConsumerDelegate.class, AcknowledgmentHandler.class };      ConsumerDelegate delegate = (ConsumerDelegate)Proxy.newProxyInstance(loader, interfaces, h);      if (callbackHandler == null)      {         throw new JBossJMSException("null callback handler");      }      // create the Consumer endpoint and register it with this SessionDelegate instance      ServerConsumerDelegate scd =            new ServerConsumerDelegate(consumerID, destination, callbackHandler, this);      putConsumerDelegate(consumerID, scd);      log.debug("created consumer endpoint (destination=" + jmsDestination + ")");      return delegate;   }