if (log.isTraceEnabled()) { log.trace("creating session, transacted: " + transacted + " ackMode: " + acknowledgmentMode + " Xa:" + isXA); }
if (log.isTraceEnabled()) { log.trace("creating session, transacted=" + transacted + " ackMode=" + ToString.acknowledgmentMode(acknowledgmentMode) + " XA=" + isXA); }
   public SessionDelegate createSessionDelegate(boolean transacted,         int acknowledgmentMode,         boolean isXA)   {      if (log.isTraceEnabled())      {         log.trace("creating session, transacted: " + transacted + " ackMode: " + acknowledgmentMode + " Xa:" + isXA);      }            // create the dynamic proxy that implements SessionDelegate      SessionDelegate sd = null;      Serializable oid = serverPeer.getSessionAdvisor().getName();      String stackName = "SessionStack";      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);            // TODO: The ConnectionFactoryDelegate and ConnectionDelegate share the same locator (TCP/IP connection?). Performance?      JMSInvocationHandler h = new JMSInvocationHandler(interceptors);            String sessionID = generateSessionID();            SimpleMetaData metadata = new SimpleMetaData();      // TODO: The ConnectionFactoryDelegate and ConnectionDelegate share the same locator (TCP/IP connection?). Performance?      metadata.addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, oid, PayloadKey.AS_IS);      metadata.addMetaData(RemotingClientInterceptor.REMOTING,            RemotingClientInterceptor.INVOKER_LOCATOR,            serverPeer.getLocator(),            PayloadKey.AS_IS);      metadata.addMetaData(RemotingClientInterceptor.REMOTING,            RemotingClientInterceptor.SUBSYSTEM,            "JMS",            PayloadKey.AS_IS);      metadata.addMetaData(JMSAdvisor.JMS, JMSAdvisor.CONNECTION_ID, connectionID, PayloadKey.AS_IS);      metadata.addMetaData(JMSAdvisor.JMS, JMSAdvisor.SESSION_ID, sessionID, PayloadKey.AS_IS);                h.getMetaData().mergeIn(metadata);            // TODO       ClassLoader loader = getClass().getClassLoader();      Class[] interfaces = new Class[] { SessionDelegate.class };      sd = (SessionDelegate)Proxy.newProxyInstance(loader, interfaces, h);                  // create the corresponding "server-side" SessionDelegate and register it with this      // ConnectionDelegate instance      ServerSessionDelegate ssd = new ServerSessionDelegate(sessionID, this, acknowledgmentMode);      putSessionDelegate(sessionID, ssd);            log.debug("created session delegate (sessionID=" + sessionID + ")");            return sd;   }