com.sun.sgs.service
Interface TransactionProxy


public interface TransactionProxy

This is a proxy that provides access to the current transaction and its owner. Note that there is only ever one instance of TransactionProxy.


Method Summary
 Identity getCurrentOwner()
          Returns the owner of the task that is executing the current transaction.
 Transaction getCurrentTransaction()
          Returns the current transaction state.
<T extends Service>
T
getService(Class<T> type)
          Returns a Service, based on the given type, that is available in the context of the current Transaction.
 boolean inTransaction()
          Returns true if there is a current transaction, even if the transaction has been aborted.
 

Method Detail

getCurrentTransaction

Transaction getCurrentTransaction()
Returns the current transaction state.

Returns:
the current Transaction
Throws:
TransactionNotActiveException - if there is no current, active transaction, or if the current transaction has already started preparing or aborting
TransactionTimeoutException - if the current transaction has timed out

inTransaction

boolean inTransaction()
Returns true if there is a current transaction, even if the transaction has been aborted.

Returns:
true if there is a current transaction

getCurrentOwner

Identity getCurrentOwner()
Returns the owner of the task that is executing the current transaction.

Returns:
the current transaction owner's Identity

getService

<T extends Service> T getService(Class<T> type)
Returns a Service, based on the given type, that is available in the context of the current Transaction. If the type is unknown, or if there is more than one Service of the given type, MissingResourceException is thrown.

Type Parameters:
T - the type of the Service
Parameters:
type - the Class of the requested Service
Returns:
the requested Service
Throws:
MissingResourceException - if there wasn't exactly one match to the requested type

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved