this.deliveredMessages = new DefaultQueueList();
this.messageExecutor = new ActiveMQSessionExecutor(this, connection.getMemoryBoundedQueue("Session("
+ sessionId + ")"));
this.messageExecutor.setOptimizedMessageDispatch(theConnection.isOptimizedMessageDispatch());
connection.addSession(this);
stats = new JMSSessionStatsImpl(producers, consumers);
this.consumerDispatchState = CONSUMER_DISPATCH_UNSET;
this.compression = new ByteArrayCompression();
this.compression.setCompressionLevel(theConnection.getMessageCompressionLevel());
this.compression.setCompressionStrategy(theConnection.getMessageCompressionStrategy());
this.compression.setCompressionLimit(theConnection.getMessageCompressionLimit());