lumis.util
Interface ITransaction

Package class diagram package ITransaction
All Known Subinterfaces:
ITransaction, ITransactionHibernate, ITransactionJdbc, ITransactionJPA, ITransactionSPI
All Known Implementing Classes:
TransactionHibernate

public interface ITransaction

Represents a transaction that offers persistence access. An instance of transaction is not thread-safe.

This interface will be replaced by ITransaction in a future release.

Since:
4.0.8

Method Summary
 boolean addObserver(ITransactionObserver observer)
          Adds an observer for this transaction.
 void begin()
           
 void commit()
           
 void dispose()
           
 Object getAttribute(String name)
          Returns the value of the named attribute, or null if no attribute of the given name exists.
 ITransaction getByConnectionId(String id)
          Returns an ITransaction that represents the same transaction but that returns the connection with the given id as default.
 boolean isActive()
          Returns true if the transaction is currently active, false otherwise.
 void removeAttribute(String name)
          Removes an attribute from this transaction.
 boolean removeObserver(ITransactionObserver observer)
          Removes an observer for this transaction.
 void rollback()
           
 void setAttribute(String name, Object value)
          Stores an attribute in this transaction.
 

Method Detail

begin

void begin()
           throws DaoException
Throws:
DaoException

commit

void commit()
            throws DaoException
Throws:
DaoException

rollback

void rollback()
              throws DaoException
Throws:
DaoException

dispose

void dispose()
             throws DaoException
Throws:
DaoException

isActive

boolean isActive()
Returns true if the transaction is currently active, false otherwise.

Returns:
true if the transaction is currently active, false otherwise.
Since:
4.1.0

addObserver

boolean addObserver(ITransactionObserver observer)
                    throws PortalException
Adds an observer for this transaction. The observer is added only if the current observer list does not already contain it.

Parameters:
observer - the observer.
Returns:
true if the observer was added, false otherwise.
Throws:
PortalException
Since:
4.0.8

removeObserver

boolean removeObserver(ITransactionObserver observer)
                       throws PortalException
Removes an observer for this transaction. If the current observer list does not contain the given observer nothing happens.

Parameters:
observer - the observer.
Returns:
true if the observer was removed, false otherwise.
Throws:
PortalException
Since:
4.1.0

getByConnectionId

ITransaction getByConnectionId(String id)
                               throws DaoException
Returns an ITransaction that represents the same transaction but that returns the connection with the given id as default. How the id represents the connection is defined by the concrete class that implements this interface.

Parameters:
id - the connection id.
Returns:
the ITransaction object.
Throws:
DaoException
Since:
4.0.4

getAttribute

Object getAttribute(String name)
Returns the value of the named attribute, or null if no attribute of the given name exists.

Different transaction instances that refer to the same transaction (see getByConnectionId(String)) share the same attributes.

Parameters:
name - the name of the attribute.
Returns:
the value of the attribute, or null if the attribute does not exist.
Since:
4.1.0

setAttribute

void setAttribute(String name,
                  Object value)
Stores an attribute in this transaction. If the value passed in is null, the effect is the same as calling removeAttribute(String).

Parameters:
name - the name of the attribute.
value - the value to be stored.
Since:
4.1.0

removeAttribute

void removeAttribute(String name)
Removes an attribute from this transaction.

Parameters:
name - the name of the attribute.
Since:
4.1.0


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.