KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > persistence > impl > NullPersistenceTransactionProvider


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.objectserver.persistence.impl;
5
6 import com.tc.objectserver.persistence.api.PersistenceTransaction;
7 import com.tc.objectserver.persistence.api.PersistenceTransactionProvider;
8
9 public class NullPersistenceTransactionProvider implements PersistenceTransactionProvider {
10
11   private static final PersistenceTransaction NULL_TRANSACTION = new NullPersistenceTransaction();
12
13   public PersistenceTransaction newTransaction() {
14     return NULL_TRANSACTION;
15   }
16
17   public PersistenceTransaction nullTransaction() {
18     return NULL_TRANSACTION;
19   }
20
21   private final static class NullPersistenceTransaction implements PersistenceTransaction {
22     public void commit() {
23       return;
24     }
25   }
26
27 }
28
Popular Tags