EMF Transaction Resource Set Listeners

org.eclipse.emf.transaction.listeners

1.0

This extension point declares listeners that are automatically attached to the editing domains that they target, when those editing domains are initialized by the editor domain registry.

<!ELEMENT extension (listener+)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>

Registers ResourceSetListener with named editing domains.



<!ELEMENT listener (editingDomain*)>

<!ATTLIST listener

class CDATA #IMPLIED>

Registers a ResourceSetListener that is attached to the identified editing domain instance when it is added to or created by the editing domain registry. When (and if) the editing domain is unregistered, the listener is removed from it. If no editing domains are referenced by a listener extension, then the listener is attached to all registered. TransactionalEditingDomain instances. Unregistered editing domains are not affected.



<!ELEMENT editingDomain EMPTY>

<!ATTLIST editingDomain

id CDATA #REQUIRED>

Identifies one or more editing domains to attach the listener to.



This example shows an extension that declares a listener for an example editing domain, which applies triggers (a pre-commit listener) to ensure model integrity.

   

<extension point=

"org.eclipse.emf.transaction.listeners"

>

<listener namespaceUri=

"http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0"

class=

"com.example.transaction.listeners.EXTLibraryTriggerListener"

/>

<editingDomain id=

"com.example.my.editing.domain"

/>

</listener>

</extension>

The value of the <listener> element class attribute must be the fully qualified name of a class that implements the org.eclipse.emf.transaction.ResourceSetListener interface. It is instantiated using the default (no-argument) constructor.

A few convenient abstract classes are provided that you may extend instead of directly implementing the listener interface. These include: