[jboss-svn-commits] JBL Code SVN: r23772 - labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Nov 7 01:38:20 EST 2008
Author: beve
Date: 2008-11-07 01:38:19 -0500 (Fri, 07 Nov 2008)
New Revision: 23772
Removed:
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/RollbackTransactionAction.java
Log:
Deleting unused action.
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/RollbackTransactionAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/RollbackTransactionAction.java 2008-11-07 06:27:01 UTC (rev 23771)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/RollbackTransactionAction.java 2008-11-07 06:38:19 UTC (rev 23772)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.jmstransacted.test;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.common.TransactionStrategy;
-import org.jboss.soa.esb.common.TransactionStrategyException;
-
-/**
- * RollbackTransactionAction is a simple action that rolls back the <br>
- * the current transaction if the rollback field is true.
- * </p>
- * Note that this class in only intended to be used with the
- * jms_transacted quickstart.
- * </p>
- * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
- *
- */
-public class RollbackTransactionAction implements ActionLifecycle
-{
- private Logger log = Logger .getLogger( RollbackTransactionAction.class );
-
- /**
- * Flag indicating if the current transaction should be rolledback
- */
- private boolean rollback;
-
- /**
- * Number of times we should rollback. This is just used so that we
- * can specify when the action should proceed without rollingback the transaction
- */
- private int nrOfTimesToRollback;
-
- /**
- * Simple counter
- */
- private static int rollbackCounter;
-
- public RollbackTransactionAction( final ConfigTree config )
- {
- rollback = Boolean.parseBoolean( config.getAttribute( "rollback", "true") );
- nrOfTimesToRollback = Integer.parseInt( config.getAttribute( "nr-of-rollbacks", "3") );
- }
-
- /**
- * Will rollback the the current transaction if the rollback
- * configuration paramater is true. Else this is a NOOP and
- * simple passes the message through.
- *
- * @param message - ESB Message object
- * @return Message - ESB Message Object
- * @throws TransactionStrategyException
- */
- public Message process( Message message ) throws TransactionStrategyException
- {
- log.debug( "rollback [ " + rollback + "], rollbackCounter [" + rollbackCounter + "], nr-of-rollbacks [" + nrOfTimesToRollback + "]");
- if ( rollback )
- {
- rollbackCounter++;
- if ( rollbackCounter < nrOfTimesToRollback )
- {
- TransactionStrategy strategy = TransactionStrategy.getTransactionStrategy(true);
- log.info( "Setting transaction to rollback only" );
- strategy.rollbackOnly();
- message = null;
- }
- else
- {
- rollbackCounter = 0;
- }
- }
- return message;
- }
-
- public void processException(final Message message, final Throwable th) { }
- public void destroy() throws ActionLifecycleException {}
- public void initialise() throws ActionLifecycleException {}
-
-}
More information about the jboss-svn-commits
mailing list