|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.peer.LyTransactionManager
public class LyTransactionManager
This class is used to manage transactions in an application.
LyDataProvider
,
LyRequestEncoder
,
LyConnection
,
LyTransaction
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Constructor Summary | |
---|---|
LyTransactionManager(LyApplication application)
Constructs a transaction manager. |
Method Summary | |
---|---|
void |
abort(LyDataProvider provider)
Abort all pending transactions (rollback) for a data provider. |
void |
abort(LyDataSession session)
Abort all pending transactions (rollback) for a session. |
LyTransaction |
begin()
To begin a new transaction. |
LyResponse |
createObject(LyDataSource dataSource,
java.lang.Object peer,
LyResponseListener listener,
LyClassBinding classBinding)
Create a new object on the specified data source. |
LyResponse |
deleteObject(LyDataSource dataSource,
java.lang.Object peer,
LyResponseListener listener,
LyClassBinding classBinding)
Delete an object on the specified data source. |
LyResponse |
deleteObjects(LyDataSource dataSource,
java.util.Vector<java.lang.Object> peers,
LyResponseListener listener,
LyClassBinding classBinding)
Delete a list of objects on the specified data source. |
boolean |
end(LyTransaction transaction)
To end a transaction. if an error has occured during the transaction, do a rollback else do a commit. |
boolean |
end(LyTransaction transaction,
boolean commit)
To end a transaction. |
LyConnection |
getConnection(LyDataProvider provider)
Accessor to a connection instance from the connection pool of the specified data provider. |
int |
getSize(LyDataSource dataSource,
LyFilter peerFilter,
LyClassBinding classBinding)
Return the number of objects within the specified data source matching the given filter. |
LyTransaction |
getTransaction(LyDataProvider provider)
To get the last open transaction on the current session associated with a data provider. |
LyTransaction |
getTransaction(LyDataSession session)
To get the last open transaction on a session. |
LyResponse |
loadObject(LyDataSource dataSource,
LyObjectId peerId,
java.util.Vector<LyField> peerFields,
LyResponseListener listener,
LyClassBinding classBinding)
Method to load an object from its id on the specified data source. |
LyResponse |
loadObjects(LyDataSource dataSource,
java.util.Vector<LyField> peerFields,
LySort peerSort,
LyFilter peerFilter,
int n,
LyResponseListener listener,
LyClassBinding classBinding)
Method for loading objects on the specified data source. |
void |
releaseConnection(LyConnection connection,
LyDataProvider provider)
Return a connection instance to the connection pool of the specified data provider. |
LyResponse |
setObject(LyDataSource dataSource,
java.lang.Object peer,
LyResponseListener listener,
LyClassBinding classBinding)
Set an object on the specified data source. |
LyResponse |
setObjects(LyDataSource dataSource,
java.util.Vector<java.lang.Object> peers,
LyResponseListener listener,
LyClassBinding classBinding)
Set a list of objects on the specified data source. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyTransactionManager(LyApplication application)
application
- Current application instanceMethod Detail |
---|
public LyTransaction begin()
public boolean end(LyTransaction transaction)
transaction
- The transaction to end
public boolean end(LyTransaction transaction, boolean commit)
transaction
- The transaction to endcommit
- Specifiy if the transaction must be committed (true) or aborted (false).
public void abort(LyDataSession session)
session
- the sessionpublic void abort(LyDataProvider provider)
session
- the sessionpublic LyConnection getConnection(LyDataProvider provider)
If no connection is available currently, this method will block until a connection is released and available.
Important ! The connection MUST be released after usage so it's available for the connection pool. Invoke releaseConnection when the connection is no longer needed.
provider
- the data provider from which we want to get a connection.
releaseConnection(leon.peer.LyConnection, leon.peer.LyDataProvider)
public void releaseConnection(LyConnection connection, LyDataProvider provider)
The connection reference was obtained by getConnection()
Important ! The connection MUST be released after usage so it's available for the connection pool. Invoke releaseConnection when the connection is no longer needed.
connection
- a connection instance from the connection pool of the specified data
provider.provider
- the provider to return the connection.releaseConnection(leon.peer.LyConnection, leon.peer.LyDataProvider)
public LyTransaction getTransaction(LyDataProvider provider)
provider
- the associated provider of the search transaction.
public LyTransaction getTransaction(LyDataSession session)
session
- the session
public LyResponse loadObject(LyDataSource dataSource, LyObjectId peerId, java.util.Vector<LyField> peerFields, LyResponseListener listener, LyClassBinding classBinding)
dataSource
- The data source for loading the object.peerId
- Object identifier corresponding to the object to load.peerFields
- Fields to load (null means all fields).listener
- Listener of the response.classBinding
- binding between logical class and physical class This binding may
contain extra information required for encoding the request.
LyDataSource.loadObject(leon.data.LyObjectId, java.util.Vector extends leon.data.LyField>, leon.data.LyResponseListener, leon.info.binding.LyClassBinding)
public LyResponse loadObjects(LyDataSource dataSource, java.util.Vector<LyField> peerFields, LySort peerSort, LyFilter peerFilter, int n, LyResponseListener listener, LyClassBinding classBinding)
dataSource
- The data source for loading the objects.peerFields
- Fields to load (null means all fields).peerSort
- Gives sort criteria, or null if there is no sort (the order is the one
of the physical layer).peerFilter
- Gives filter criteria, or null if there is no filter (all objects).n
- Indicates the number of objects to load (-1 means no limit).listener
- Listener of the response.classBinding
- binding between logical class and physical class This binding may
contain extra information required for encoding the request.
LyDataSource.loadObjects(java.util.Vector extends leon.data.LyField>, leon.info.LySort, leon.info.LyFilter, int, leon.data.LyResponseListener, leon.info.binding.LyClassBinding)
public int getSize(LyDataSource dataSource, LyFilter peerFilter, LyClassBinding classBinding)
dataSource
- The data source for getting the number of objects.peerFilter
- Filter applied on objects for counting.classBinding
- Binding between logical class and physical class. This binding may
contain extra information required for encoding the request (such as
extra filter).
LyDataSource.getSize()
public LyResponse deleteObject(LyDataSource dataSource, java.lang.Object peer, LyResponseListener listener, LyClassBinding classBinding)
dataSource
- The data source for deleting the object.peer
- Object to delete.listener
- Listener of the response.classBinding
- Binding between logical class and physical class This binding may
contain extra information required for encoding the request.
LyDataSource.deleteObject(java.lang.Object, leon.data.LyResponseListener, leon.info.binding.LyClassBinding)
public LyResponse deleteObjects(LyDataSource dataSource, java.util.Vector<java.lang.Object> peers, LyResponseListener listener, LyClassBinding classBinding)
dataSource
- The data source for deleting the objects.peers
- List of objects to delete.listener
- Listener of the response.classBinding
- Binding between logical class and physical class This binding may
contain extra information required for encoding the request.
LyDataSource.deleteObjects(java.util.Vector extends java.lang.Object>, leon.data.LyResponseListener, leon.info.binding.LyClassBinding)
public LyResponse createObject(LyDataSource dataSource, java.lang.Object peer, LyResponseListener listener, LyClassBinding classBinding)
dataSource
- The data source for creating the object.peer
- Object to create.listener
- Listener of the response.classBinding
- Binding between logical class and physical class. This binding may
contain extra information required for encoding the request.
LyDataSource.createObject(java.lang.Object, leon.data.LyResponseListener, leon.info.binding.LyClassBinding)
public LyResponse setObject(LyDataSource dataSource, java.lang.Object peer, LyResponseListener listener, LyClassBinding classBinding)
dataSource
- The data source for setting the object.peer
- Object to modify.listener
- Listener of the response.classBinding
- Binding between logical class and physical class This binding may
contain extra information required for encoding the request.
LyDataSource.setObject(java.lang.Object, leon.data.LyResponseListener, leon.info.binding.LyClassBinding)
public LyResponse setObjects(LyDataSource dataSource, java.util.Vector<java.lang.Object> peers, LyResponseListener listener, LyClassBinding classBinding)
dataSource
- The data source for setting the objects.peers
- List of objects to modify.listener
- Listener of the response.classBinding
- Binding between logical class and physical class This binding may
contain extra information required for encoding the request.
LyDataSource.setObjects(java.util.Vector extends java.lang.Object>, leon.data.LyResponseListener, leon.info.binding.LyClassBinding)
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |