protected Requestor getOutterInstance() {
return this;
}
protected AbstractMessageListenerContainer createListenerContainer() {
SimpleMessageListenerContainer answer = configuration.isUseVersion102()
? new SimpleMessageListenerContainer102() : new SimpleMessageListenerContainer();
answer.setDestinationName("temporary");
answer.setDestinationResolver(new DestinationResolver() {
public Destination resolveDestinationName(Session session, String destinationName,
boolean pubSubDomain) throws JMSException {
TemporaryQueue queue = null;
synchronized (getOutterInstance()) {
try {
queue = session.createTemporaryQueue();
setReplyTo(queue);
} finally {
getOutterInstance().notifyAll();
}
}
return queue;
}
});
answer.setAutoStartup(true);
answer.setMessageListener(this);
answer.setPubSubDomain(false);
answer.setSubscriptionDurable(false);
answer.setConcurrentConsumers(1);
answer.setConnectionFactory(configuration.getConnectionFactory());
String clientId = configuration.getClientId();
if (clientId != null) {
clientId += ".Requestor";
answer.setClientId(clientId);
}
TaskExecutor taskExecutor = configuration.getTaskExecutor();
if (taskExecutor != null) {
answer.setTaskExecutor(taskExecutor);
}
ExceptionListener exceptionListener = configuration.getExceptionListener();
if (exceptionListener != null) {
answer.setExceptionListener(exceptionListener);
}
return answer;
}