KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > OptimisticTransactionEntry


1 /*
2  * JBoss, Home of Professional Open Source
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.cache;
8
9
10 import org.jboss.cache.optimistic.TransactionWorkspace;
11 import org.jboss.cache.optimistic.TransactionWorkspaceImpl;
12
13 /**
14  * Subclasses the {@link TransactionEntry} class to add a {@link TransactionWorkspace}. Used with optimistic locking
15  * where each call is assigned a trasnaction and a transaction workspace.
16  *
17  * @author <a HREF="mailto:manik@jboss.org">Manik Surtani (manik@jboss.org)</a>
18  * @author <a HREF="mailto:stevew@jofti.com">Steve Woodcock (stevew@jofti.com)</a>
19  */

20
21 public class OptimisticTransactionEntry extends TransactionEntry{
22
23    private TransactionWorkspace transactionWorkSpace = new TransactionWorkspaceImpl();
24
25    public OptimisticTransactionEntry() {
26    }
27
28    public String JavaDoc toString() {
29       StringBuffer JavaDoc sb = new StringBuffer JavaDoc(super.toString());
30       sb.append("\nworkspace: ").append(transactionWorkSpace);
31       return sb.toString();
32    }
33
34     /**
35      * @return Returns the transactionWorkSpace.
36      */

37     public TransactionWorkspace getTransactionWorkSpace() {
38         return transactionWorkSpace;
39     }
40     
41     /**
42      * @param transactionWorkSpace The transactionWorkSpace to set.
43      */

44     public void setTransactionWorkSpace(
45             TransactionWorkspace transactionWorkSpace) {
46         this.transactionWorkSpace = transactionWorkSpace;
47     }
48
49 }
50
Popular Tags