|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Internal interface that must be provided by any implementation of the public
TransactionalEditingDomain
API, in order to function correctly in the transactional
editing domain framework.
Nested Class Summary |
---|
Nested classes inherited from class org.eclipse.emf.transaction.TransactionalEditingDomain |
---|
TransactionalEditingDomain.Factory, TransactionalEditingDomain.Registry |
Method Summary | |
---|---|
void |
activate(InternalTransaction tx)
Activates (starts) the specified transaction. |
void |
broadcastUnbatched(org.eclipse.emf.common.notify.Notification notification)
Broadcasts the specified notification to listeners as a singleton list, in a situation where batching is not possible because events are occurring outside of any transaction context. |
void |
deactivate(InternalTransaction tx)
Deactivates the specified transaction. |
void |
endPrivileged(PrivilegedRunnable runnable)
Returns me to my previous owner, upon completion of the specified privileged runnable. |
InternalTransaction |
getActiveTransaction()
Obtains the transaction that currently has access to me, and whose thread of execution is active. |
TransactionChangeRecorder |
getChangeRecorder()
Obtains the change recorder that I use to track changes in my resource set. |
java.util.Map |
getUndoRedoOptions()
Retrieves the undo/redo options that should be used when creating transactions. |
TransactionValidator |
getValidator()
Gets the validator that transactions should use to validate themselves upon committing. |
void |
precommit(InternalTransaction tx)
Performs the pre-commit notifications and processing of trigger comamnds. |
void |
startPrivileged(PrivilegedRunnable runnable)
Transfers ownership of this editing domain to the specified privileged runnable. |
InternalTransaction |
startTransaction(boolean readOnly,
java.util.Map options)
Creates and starts a new transaction. |
Methods inherited from interface org.eclipse.emf.transaction.TransactionalEditingDomain |
---|
addResourceSetListener, createPrivilegedRunnable, dispose, getID, removeResourceSetListener, runExclusive, setID, yield |
Methods inherited from interface org.eclipse.emf.edit.domain.EditingDomain |
---|
createCommand, createOverrideCommand, createResource, getChildren, getClipboard, getCommandStack, getNewChildDescriptors, getOptimizeCopy, getParent, getResourceSet, getRoot, getTreePath, isControllable, isReadOnly, loadResource, setClipboard, treeIterator |
Method Detail |
public InternalTransaction startTransaction(boolean readOnly, java.util.Map options) throws java.lang.InterruptedException
readOnly
- true
if the transaction is intended only
to read the resource set; false
if it will modify itoptions
- the options to apply to the transaction (as specified by
the TransactionalCommandStack
interface
java.lang.InterruptedException
- if the current thread is interrupted while
waiting for the transaction to start
java.lang.IllegalArgumentException
- if the current thread does not
own
the transaction that it wants
to start or if it is attempting to start a transaction in an
inappropriate contextInternalTransactionalEditingDomain.activate(InternalTransaction)
public InternalTransaction getActiveTransaction()
null
if no transaction
is currently activepublic void activate(InternalTransaction tx) throws java.lang.InterruptedException
active transaction
until it either
yields (in the case of a read-only transaction) or closes.
Note that only the thread that owns a transaction may activate it. Also,
a nested read-write transaction cannot be activated if its parent
transaction is read-only, unless the read-write transaction has the
'unprotected' option
.
tx
- the transaction to activate
java.lang.InterruptedException
- if the current thread is interrupted while
waiting for me to activate its transaction
java.lang.IllegalArgumentException
- if the current thread does not
own
the transaction that it wants
to activate or if it is attempting to activate a transaction in an
inappropriate context{@link #getActiveTransaction() }
,
TransactionalEditingDomain.yield()
,
InternalTransactionalEditingDomain.startTransaction(boolean, Map)
,
InternalTransactionalEditingDomain.deactivate(InternalTransaction)
public void precommit(InternalTransaction tx) throws RollbackException
commit
of a read/write transaction (not a
read-only transaction), unless it has the
'no triggers' option
.
tx
- the transaction that is being committed
RollbackException
- if any of the pre-commit listeners forces
rollback of the transaction. The caller must honour this rollback
request by actually rolling back
the transactionTransaction.commit()
,
Transaction.rollback()
,
ResourceSetListener.transactionAboutToCommit(org.eclipse.emf.transaction.ResourceSetChangeEvent)
public void deactivate(InternalTransaction tx)
active transaction
.
The current thread must own the transaction that it is attempting to deactivate and this transaction must currently be my active transaction.
Note that a transaction must ensure that this method is called when it closes, either by commit or by rollback, and at most once.
tx
- the transaction to deactivate
java.lang.IllegalArgumentException
- if either the transaction is not the
active transaction, or the current thread does not own itInternalTransactionalEditingDomain.activate(InternalTransaction)
,
Transaction.commit()
,
Transaction.rollback()
public TransactionChangeRecorder getChangeRecorder()
starting
and
resuming
committing
and
pausing
rolling back
public TransactionValidator getValidator()
'no validation' option
.
public void broadcastUnbatched(org.eclipse.emf.common.notify.Notification notification)
read notifications
.
notification
- the notification to send to resource set listenersTransactionFilter#READ
,
ResourceSetListener
,
FilterManager.selectUnbatched(java.util.List, NotificationFilter)
public java.util.Map getUndoRedoOptions()
public void startPrivileged(PrivilegedRunnable runnable)
runnable
- the runnable whose thread is to borrow mepublic void endPrivileged(PrivilegedRunnable runnable)
runnable
- the runnable whose thread had borrowed me
|
Copyright 2002, 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |