org.eclipse.xtext.ui.editor.model
Class XtextDocument.XtextDocumentLocker

java.lang.Object
  extended by org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces<XtextResource>
      extended by org.eclipse.xtext.ui.editor.model.XtextDocument.XtextDocumentLocker
All Implemented Interfaces:
IXtextDocumentContentObserver.Processor, IReadAccess<XtextResource>
Enclosing class:
XtextDocument

protected class XtextDocument.XtextDocumentLocker
extends AbstractReadWriteAcces<XtextResource>
implements IXtextDocumentContentObserver.Processor

Author:
Sven Efftinge - Initial contribution and API

Field Summary
 
Fields inherited from class org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces
readLock, rwLock, writeLock
 
Constructor Summary
protected XtextDocument.XtextDocumentLocker()
           
 
Method Summary
protected  void afterModify(XtextResource res, java.lang.Object result, IUnitOfWork<?,XtextResource> work)
          is executed within the transaction right after the unit of work has been executed and delivered the result.
protected  void afterReadOnly(XtextResource res, java.lang.Object result, IUnitOfWork<?,XtextResource> work)
          is executed within the transaction right after the unit of work has been executed and delivered the result.
protected  void beforeModify(XtextResource state, IUnitOfWork<?,XtextResource> work)
          Is called before a write lock is obtained
protected  void beforeReadOnly(XtextResource res, IUnitOfWork<?,XtextResource> work)
          is called before a read lock is obtained
protected  XtextResource getState()
           
<T> T
modify(IUnitOfWork<T,XtextResource> work)
           
<T> T
process(IUnitOfWork<T,XtextResource> transaction)
           
 
Methods inherited from class org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces
readOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtextDocument.XtextDocumentLocker

protected XtextDocument.XtextDocumentLocker()
Method Detail

getState

protected XtextResource getState()
Specified by:
getState in class AbstractReadWriteAcces<XtextResource>

beforeReadOnly

protected void beforeReadOnly(XtextResource res,
                              IUnitOfWork<?,XtextResource> work)
Description copied from class: AbstractReadWriteAcces
is called before a read lock is obtained

Overrides:
beforeReadOnly in class AbstractReadWriteAcces<XtextResource>
work - - the unit of work to be processed

beforeModify

protected void beforeModify(XtextResource state,
                            IUnitOfWork<?,XtextResource> work)
Description copied from class: AbstractReadWriteAcces
Is called before a write lock is obtained

Overrides:
beforeModify in class AbstractReadWriteAcces<XtextResource>
work - - the unit of work to be processed

afterReadOnly

protected void afterReadOnly(XtextResource res,
                             java.lang.Object result,
                             IUnitOfWork<?,XtextResource> work)
Description copied from class: AbstractReadWriteAcces
is executed within the transaction right after the unit of work has been executed and delivered the result.

Overrides:
afterReadOnly in class AbstractReadWriteAcces<XtextResource>

afterModify

protected void afterModify(XtextResource res,
                           java.lang.Object result,
                           IUnitOfWork<?,XtextResource> work)
Description copied from class: AbstractReadWriteAcces
is executed within the transaction right after the unit of work has been executed and delivered the result.

Overrides:
afterModify in class AbstractReadWriteAcces<XtextResource>

modify

public <T> T modify(IUnitOfWork<T,XtextResource> work)
Overrides:
modify in class AbstractReadWriteAcces<XtextResource>

process

public <T> T process(IUnitOfWork<T,XtextResource> transaction)
Specified by:
process in interface IXtextDocumentContentObserver.Processor