You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2008/06/09 20:18:40 UTC
svn commit: r665811 - in
/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi:
container/JBIContainer.java messaging/DeliveryChannelImpl.java
nmr/flow/seda/SedaFlow.java
Author: gnodet
Date: Mon Jun 9 11:18:40 2008
New Revision: 665811
URL: http://svn.apache.org/viewvc?rev=665811&view=rev
Log:
SM-1385: Add a flag to disable transaction processing and behave like smx4
Modified:
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java?rev=665811&r1=665810&r2=665811&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java Mon Jun 9 11:18:40 2008
@@ -113,6 +113,7 @@
protected EventListenerList listeners = new EventListenerList();
protected EventListener[] configuredListeners;
protected boolean useShutdownHook = true;
+ protected boolean useNewTransactionModel;
protected transient Thread shutdownHook;
protected ExecutorFactory executorFactory;
private String name = DEFAULT_NAME;
@@ -232,7 +233,7 @@
/**
* Set the broker message flows
*
- * @param flow
+ * @param flows
*/
public void setFlows(Flow[] flows) {
getDefaultBroker().setFlows(flows);
@@ -258,6 +259,18 @@
this.useShutdownHook = useShutdownHook;
}
+ public boolean isUseNewTransactionModel() {
+ return useNewTransactionModel;
+ }
+
+ /**
+ * Sets whether the new transaction model should be used.
+ * @param useNewTransactionModel
+ */
+ public void setUseNewTransactionModel(boolean useNewTransactionModel) {
+ this.useNewTransactionModel = useNewTransactionModel;
+ }
+
/**
* @return the services
*/
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java?rev=665811&r1=665810&r2=665811&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImpl.java Mon Jun 9 11:18:40 2008
@@ -728,7 +728,7 @@
}
protected void suspendTx(MessageExchangeImpl me) {
- if (transactionManager != null) {
+ if (transactionManager != null && !container.isUseNewTransactionModel()) {
try {
Transaction oldTx = me.getTransactionContext();
if (oldTx != null) {
@@ -749,7 +749,7 @@
}
protected void resumeTx(MessageExchangeImpl me) throws MessagingException {
- if (transactionManager != null) {
+ if (transactionManager != null && !container.isUseNewTransactionModel()) {
try {
Transaction oldTx = me.getTransactionContext();
if (oldTx != null) {
@@ -771,7 +771,7 @@
* @throws MessagingException
*/
protected void autoEnlistInTx(MessageExchangeImpl me) throws MessagingException {
- if (transactionManager != null && container.isAutoEnlistInTransaction()) {
+ if (transactionManager != null && container.isAutoEnlistInTransaction() && !container.isUseNewTransactionModel()) {
try {
Transaction tx = transactionManager.getTransaction();
if (tx != null) {
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java?rev=665811&r1=665810&r2=665811&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java Mon Jun 9 11:18:40 2008
@@ -94,7 +94,8 @@
return false;
}
// we have the mirror, so the role is the one for the target component
- if (isTransacted(me) && !isSynchronous(me) && me.getStatus() == ExchangeStatus.ACTIVE) {
+ if (!broker.getContainer().isUseNewTransactionModel()
+ && isTransacted(me) && !isSynchronous(me) && me.getStatus() == ExchangeStatus.ACTIVE) {
return false;
}
return true;
@@ -280,6 +281,9 @@
}
protected void suspendTx(MessageExchangeImpl me) throws MessagingException {
+ if (broker.getContainer().isUseNewTransactionModel()) {
+ return;
+ }
try {
Transaction oldTx = me.getTransactionContext();
if (oldTx != null) {
@@ -301,6 +305,9 @@
}
protected void resumeTx(MessageExchangeImpl me) throws MessagingException {
+ if (broker.getContainer().isUseNewTransactionModel()) {
+ return;
+ }
try {
Transaction oldTx = me.getTransactionContext();
if (oldTx != null) {