r2311 - trunk/topia-persistence/src/main/java/org/nuiton/topia/framework
Author: tchemit Date: 2011-07-07 19:38:36 +0200 (Thu, 07 Jul 2011) New Revision: 2311 Url: http://nuiton.org/repositories/revision/topia/2311 Log: Evolution #1625: Add TopiaTransactionAware Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaTransactionAware.java Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaTransactionAware.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaTransactionAware.java (rev 0) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaTransactionAware.java 2011-07-07 17:38:36 UTC (rev 2311) @@ -0,0 +1,58 @@ +/* + * #%L + * ToPIA :: Persistence + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2004 - 2011 CodeLutin, Tony Chemit + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package org.nuiton.topia.framework; + +import org.nuiton.topia.TopiaContext; + +/** + * Use this contract on a object which use a {@code TopiaContext} as a + * transaction. + * <p/> + * The method {@link #getTransaction()} returns the internal transaction used. + * <p/> + * the method {@link #setTransaction(TopiaContext)} put the internal + * transaction. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.6.1 + */ +public interface TopiaTransactionAware { + + /** + * Obtains the internal transaction. + * <p/> + * If no transaction was opened, can return the {@code null} object. + * + * @return the current transaction (can be null or closed...). + */ + TopiaContext getTransaction(); + + /** + * Put in the instance, the given transaction. + * + * @param transaction the transaction to push + */ + void setTransaction(TopiaContext transaction); +} Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaTransactionAware.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native
participants (1)
-
tchemit@users.nuiton.org