Search in sources :

Example 1 with UpdateAttributeCommand

use of com.ramussoft.common.journal.command.UpdateAttributeCommand in project ramus by Vitaliy-Yakovchuk.

the class JournaledEngine method updateAttribute.

@Override
public void updateAttribute(Attribute attribute) {
    Attribute old = getAttribute(attribute.getId());
    deligate.updateAttribute(attribute);
    synchronized (swithJournalLock) {
        journal.store(new UpdateAttributeCommand(this, old, attribute));
    }
    AttributeEvent event = new AttributeEvent(this, null, attribute, old, attribute);
    for (AttributeListener listener : attributeListeners) {
        listener.attributeUpdated(event);
    }
}
Also used : Attribute(com.ramussoft.common.Attribute) AttributeListener(com.ramussoft.common.event.AttributeListener) AttributeEvent(com.ramussoft.common.event.AttributeEvent) UpdateAttributeCommand(com.ramussoft.common.journal.command.UpdateAttributeCommand)

Aggregations

Attribute (com.ramussoft.common.Attribute)1 AttributeEvent (com.ramussoft.common.event.AttributeEvent)1 AttributeListener (com.ramussoft.common.event.AttributeListener)1 UpdateAttributeCommand (com.ramussoft.common.journal.command.UpdateAttributeCommand)1