Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -131,8 +131,8 @@ public abstract class ConnectionFactoryUtils {
|
||||
* @return the transactional Session, or {@code null} if none found
|
||||
* @throws JMSException in case of JMS failure
|
||||
*/
|
||||
public static Session getTransactionalSession(
|
||||
final ConnectionFactory cf, final Connection existingCon, final boolean synchedLocalTransactionAllowed)
|
||||
public static Session getTransactionalSession(final ConnectionFactory cf,
|
||||
final Connection existingCon, final boolean synchedLocalTransactionAllowed)
|
||||
throws JMSException {
|
||||
|
||||
return doGetTransactionalSession(cf, new ResourceFactory() {
|
||||
@@ -173,8 +173,8 @@ public abstract class ConnectionFactoryUtils {
|
||||
* @return the transactional Session, or {@code null} if none found
|
||||
* @throws JMSException in case of JMS failure
|
||||
*/
|
||||
public static QueueSession getTransactionalQueueSession(
|
||||
final QueueConnectionFactory cf, final QueueConnection existingCon, final boolean synchedLocalTransactionAllowed)
|
||||
public static QueueSession getTransactionalQueueSession(final QueueConnectionFactory cf,
|
||||
final QueueConnection existingCon, final boolean synchedLocalTransactionAllowed)
|
||||
throws JMSException {
|
||||
|
||||
return (QueueSession) doGetTransactionalSession(cf, new ResourceFactory() {
|
||||
@@ -215,8 +215,8 @@ public abstract class ConnectionFactoryUtils {
|
||||
* @return the transactional Session, or {@code null} if none found
|
||||
* @throws JMSException in case of JMS failure
|
||||
*/
|
||||
public static TopicSession getTransactionalTopicSession(
|
||||
final TopicConnectionFactory cf, final TopicConnection existingCon, final boolean synchedLocalTransactionAllowed)
|
||||
public static TopicSession getTransactionalTopicSession(final TopicConnectionFactory cf,
|
||||
final TopicConnection existingCon, final boolean synchedLocalTransactionAllowed)
|
||||
throws JMSException {
|
||||
|
||||
return (TopicSession) doGetTransactionalSession(cf, new ResourceFactory() {
|
||||
@@ -234,7 +234,8 @@ public abstract class ConnectionFactoryUtils {
|
||||
}
|
||||
@Override
|
||||
public Session createSession(Connection con) throws JMSException {
|
||||
return ((TopicConnection) con).createTopicSession(synchedLocalTransactionAllowed, Session.AUTO_ACKNOWLEDGE);
|
||||
return ((TopicConnection) con).createTopicSession(
|
||||
synchedLocalTransactionAllowed, Session.AUTO_ACKNOWLEDGE);
|
||||
}
|
||||
@Override
|
||||
public boolean isSynchedLocalTransactionAllowed() {
|
||||
@@ -339,8 +340,8 @@ public abstract class ConnectionFactoryUtils {
|
||||
}
|
||||
if (resourceHolderToUse != resourceHolder) {
|
||||
TransactionSynchronizationManager.registerSynchronization(
|
||||
new JmsResourceSynchronization(
|
||||
resourceHolderToUse, connectionFactory, resourceFactory.isSynchedLocalTransactionAllowed()));
|
||||
new JmsResourceSynchronization(resourceHolderToUse, connectionFactory,
|
||||
resourceFactory.isSynchedLocalTransactionAllowed()));
|
||||
resourceHolderToUse.setSynchronizedWithTransaction(true);
|
||||
TransactionSynchronizationManager.bindResource(connectionFactory, resourceHolderToUse);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user