User: dmaplesden Date: 01/11/19 12:41:19 Modified: src/main/org/jboss/mq/pm/rollinglogged SpyTxLog.java Log: fixing my bad formatting Revision Changes Path 1.6 +100 -100 jbossmq/src/main/org/jboss/mq/pm/rollinglogged/SpyTxLog.java Index: SpyTxLog.java =================================================================== RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/pm/rollinglogged/SpyTxLog.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SpyTxLog.java 2001/11/19 04:06:04 1.5 +++ SpyTxLog.java 2001/11/19 20:41:19 1.6 @@ -18,107 +18,107 @@ * * @created August 16, 2001 * @author: Hiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ */ public class SpyTxLog { - ///////////////////////////////////////////////////////////////////// - // Attributes - ///////////////////////////////////////////////////////////////////// - private IntegrityLog transactionLog; - private int liveTransactionCount = 0; - private Object counterLock = new Object(); - - ///////////////////////////////////////////////////////////////////// - // Constructors - ///////////////////////////////////////////////////////////////////// - SpyTxLog( File file ) - throws JMSException { - try { - transactionLog = new IntegrityLog( file ); - } catch ( IOException e ) { - throwJMSException( "Could not open the queue's tranaction log: " + file.getAbsolutePath(), e ); - } - System.out.println("created SpyTxLog: " + this); - //new Exception().printStackTrace(); - } - - ///////////////////////////////////////////////////////////////////// - // Public Methods - ///////////////////////////////////////////////////////////////////// - public synchronized void close() - throws JMSException { - try { - transactionLog.close(); - } catch ( IOException e ) { - throwJMSException( "Could not close the queue's tranaction log.", e ); - } - } - - public synchronized void delete() - throws JMSException { - try { - transactionLog.delete(); - } catch ( IOException e ) { - throwJMSException( "Could not delete the queue's tranaction log.", e ); - } - } - - - public void createTx() - throws JMSException { - synchronized ( counterLock ) { - ++liveTransactionCount; - } - } - - public boolean completed() - throws JMSException { - synchronized ( counterLock ) { - return ( liveTransactionCount == 0 ); - } - } - - - public synchronized void restore( java.util.TreeSet result ) - throws JMSException { - try { - result.addAll( transactionLog.toTreeSet() ); - } catch ( Exception e ) { - throwJMSException( "Could not restore the transaction log.", e ); - } - } - - public synchronized void commitTx( org.jboss.mq.pm.Tx id ) - throws JMSException { - - try { - transactionLog.addTx( id ); - transactionLog.commit(); - synchronized ( counterLock ) { - --liveTransactionCount; - } - } catch ( IOException e ) { - throwJMSException( "Could not create a new transaction.", e ); - } - - } - - public void rollbackTx( org.jboss.mq.pm.Tx txId ) - throws JMSException { - synchronized ( counterLock ) { - --liveTransactionCount; - } - } - - - ///////////////////////////////////////////////////////////////////// - // Private Methods - ///////////////////////////////////////////////////////////////////// - private void throwJMSException( String message, Exception e ) - throws JMSException { - JMSException newE = new SpyJMSException( message ); - newE.setLinkedException( e ); - throw newE; - } + ///////////////////////////////////////////////////////////////////// + // Attributes + ///////////////////////////////////////////////////////////////////// + private IntegrityLog transactionLog; + private int liveTransactionCount = 0; + private Object counterLock = new Object(); + + ///////////////////////////////////////////////////////////////////// + // Constructors + ///////////////////////////////////////////////////////////////////// + SpyTxLog( File file ) + throws JMSException { + try { + transactionLog = new IntegrityLog( file ); + } catch ( IOException e ) { + throwJMSException( "Could not open the queue's tranaction log: " + file.getAbsolutePath(), e ); + } + System.out.println("created SpyTxLog: " + this); + //new Exception().printStackTrace(); + } + + ///////////////////////////////////////////////////////////////////// + // Public Methods + ///////////////////////////////////////////////////////////////////// + public synchronized void close() + throws JMSException { + try { + transactionLog.close(); + } catch ( IOException e ) { + throwJMSException( "Could not close the queue's tranaction log.", e ); + } + } + + public synchronized void delete() + throws JMSException { + try { + transactionLog.delete(); + } catch ( IOException e ) { + throwJMSException( "Could not delete the queue's tranaction log.", e ); + } + } + + + public void createTx() + throws JMSException { + synchronized ( counterLock ) { + ++liveTransactionCount; + } + } + + public boolean completed() + throws JMSException { + synchronized ( counterLock ) { + return ( liveTransactionCount == 0 ); + } + } + + + public synchronized void restore( java.util.TreeSet result ) + throws JMSException { + try { + result.addAll( transactionLog.toTreeSet() ); + } catch ( Exception e ) { + throwJMSException( "Could not restore the transaction log.", e ); + } + } + + public synchronized void commitTx( org.jboss.mq.pm.Tx id ) + throws JMSException { + + try { + transactionLog.addTx( id ); + transactionLog.commit(); + synchronized ( counterLock ) { + --liveTransactionCount; + } + } catch ( IOException e ) { + throwJMSException( "Could not create a new transaction.", e ); + } + + } + + public void rollbackTx( org.jboss.mq.pm.Tx txId ) + throws JMSException { + synchronized ( counterLock ) { + --liveTransactionCount; + } + } + + + ///////////////////////////////////////////////////////////////////// + // Private Methods + ///////////////////////////////////////////////////////////////////// + private void throwJMSException( String message, Exception e ) + throws JMSException { + JMSException newE = new SpyJMSException( message ); + newE.setLinkedException( e ); + throw newE; + } }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development