Package org.graffiti.event
Class AbstractAttributeListener
java.lang.Object
org.graffiti.event.AbstractAttributeListener
- All Implemented Interfaces:
EventListener
,AttributeListener
,TransactionListener
public abstract class AbstractAttributeListener extends Object implements AttributeListener
An abstract adapter class for receiving attribute events. The methods in this
class are empty. This class exists as convenience for creating listener
objects.
Extend this class to create a AttributeEvent
listener and
override the methods for the events of interest. (If you implement the
AttributeListener
interface, you have to define all of the
methods in it. This abstract class defines null
methods for them
all, so you can only have to define methods for events you care about.)
Create a listener object using the extended class and then register it with a
component using the component's addAttributeEventListener
method. When an attribute is added, removed or changed or a transaction of
attribute changes is started or finished, the relevant method in the listener
object is invoked and the AttributeEvent
is passed to it.
- Version:
- $Revision: 1.4 $
- See Also:
ListenerManager
,AttributeEvent
-
Constructor Summary
Constructors Constructor Description AbstractAttributeListener()
-
Method Summary
Modifier and Type Method Description void
postAttributeAdded(AttributeEvent e)
Called after an attribute has been added.void
postAttributeChanged(AttributeEvent e)
Called after an attribute has been changed.void
postAttributeRemoved(AttributeEvent e)
Called after an attribute has been removed.void
preAttributeAdded(AttributeEvent e)
Called just before an attribute is added.void
preAttributeChanged(AttributeEvent e)
Called before a change of an attribute takes place.void
preAttributeRemoved(AttributeEvent e)
Called just before an attribute is removed.void
transactionFinished(TransactionEvent e)
Called after a transaction has been finished.void
transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)
Called when a transaction has stopped.void
transactionStarted(TransactionEvent e)
Called after a transaction has been started.
-
Constructor Details
-
AbstractAttributeListener
public AbstractAttributeListener()
-
-
Method Details
-
postAttributeAdded
Called after an attribute has been added.- Specified by:
postAttributeAdded
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
postAttributeChanged
Called after an attribute has been changed.- Specified by:
postAttributeChanged
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
postAttributeRemoved
Called after an attribute has been removed.- Specified by:
postAttributeRemoved
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
preAttributeAdded
Called just before an attribute is added.- Specified by:
preAttributeAdded
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
preAttributeChanged
Called before a change of an attribute takes place.- Specified by:
preAttributeChanged
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
preAttributeRemoved
Called just before an attribute is removed.- Specified by:
preAttributeRemoved
in interfaceAttributeListener
- Parameters:
e
- the AttributeEvent detailing the changes.
-
transactionFinished
Called after a transaction has been finished.- Parameters:
e
- gives details about the transaction.
-
transactionFinished
public void transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)Description copied from interface:TransactionListener
Called when a transaction has stopped.
The classTransactionHashMap
merges duplicateAttributeEvent
s. In case the Attribute path for the sameAttributable
is not equal, detailed information about Attribute path is lost. Instead a genericAttributeEvent
containing just theAttributable
is in the list of changed Objects (seeTransactionEvent
).
In case no detailed information about an Attribute change is available, your code should completely re-process the affectedAttributable
.- Specified by:
transactionFinished
in interfaceTransactionListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
transactionStarted
Called after a transaction has been started.- Specified by:
transactionStarted
in interfaceTransactionListener
- Parameters:
e
- gives details about the transaction.
-