|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2011 the original author or authors. |
|
|
|
* Copyright 2002-2012 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
@ -34,6 +34,8 @@ import javax.jms.MessageConsumer; |
|
|
|
import javax.jms.MessageProducer; |
|
|
|
import javax.jms.MessageProducer; |
|
|
|
import javax.jms.QueueSession; |
|
|
|
import javax.jms.QueueSession; |
|
|
|
import javax.jms.Session; |
|
|
|
import javax.jms.Session; |
|
|
|
|
|
|
|
import javax.jms.TemporaryQueue; |
|
|
|
|
|
|
|
import javax.jms.TemporaryTopic; |
|
|
|
import javax.jms.Topic; |
|
|
|
import javax.jms.Topic; |
|
|
|
import javax.jms.TopicSession; |
|
|
|
import javax.jms.TopicSession; |
|
|
|
|
|
|
|
|
|
|
@ -323,16 +325,18 @@ public class CachingConnectionFactory extends SingleConnectionFactory { |
|
|
|
// let raw JMS invocation throw an exception if Destination (i.e. args[0]) is null
|
|
|
|
// let raw JMS invocation throw an exception if Destination (i.e. args[0]) is null
|
|
|
|
if ((methodName.equals("createConsumer") || methodName.equals("createReceiver") || |
|
|
|
if ((methodName.equals("createConsumer") || methodName.equals("createReceiver") || |
|
|
|
methodName.equals("createSubscriber"))) { |
|
|
|
methodName.equals("createSubscriber"))) { |
|
|
|
if (args[0] != null) { |
|
|
|
Destination dest = (Destination) args[0]; |
|
|
|
return getCachedConsumer((Destination) args[0], |
|
|
|
if (dest != null && !(dest instanceof TemporaryQueue || dest instanceof TemporaryTopic)) { |
|
|
|
|
|
|
|
return getCachedConsumer(dest, |
|
|
|
(args.length > 1 ? (String) args[1] : null), |
|
|
|
(args.length > 1 ? (String) args[1] : null), |
|
|
|
(args.length > 2 && (Boolean) args[2]), |
|
|
|
(args.length > 2 && (Boolean) args[2]), |
|
|
|
null); |
|
|
|
null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (methodName.equals("createDurableSubscriber")) { |
|
|
|
else if (methodName.equals("createDurableSubscriber")) { |
|
|
|
if (args[0] != null) { |
|
|
|
Destination dest = (Destination) args[0]; |
|
|
|
return getCachedConsumer((Destination) args[0], |
|
|
|
if (dest != null) { |
|
|
|
|
|
|
|
return getCachedConsumer(dest, |
|
|
|
(args.length > 2 ? (String) args[2] : null), |
|
|
|
(args.length > 2 ? (String) args[2] : null), |
|
|
|
(args.length > 3 && (Boolean) args[3]), |
|
|
|
(args.length > 3 && (Boolean) args[3]), |
|
|
|
(String) args[1]); |
|
|
|
(String) args[1]); |
|
|
|