|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.dao.session.WorkspacePersisterListener
public class WorkspacePersisterListener
An implementation of WabitListener used exclusively for listening to
a WabitWorkspace and its children. When an event is fired from an
object this listener will convert the event into persist calls. The persist
calls will be made on the target persister.
| Constructor Summary | |
|---|---|
WorkspacePersisterListener(WabitSession session,
WabitPersister targetPersister)
This listener should be added through the static method for attaching a listener to a session. |
|
WorkspacePersisterListener(WabitSession session,
WabitPersister targetPersister,
WabitSessionPersister eventSource)
This listener should be added through the static method for attaching a listener to a session. |
|
| Method Summary | |
|---|---|
static WorkspacePersisterListener |
attachListener(WabitSession session,
WabitPersister targetPersister,
WabitSessionPersister eventSource)
This will connect a new instance of this listener to the workspace and all of its descendants. |
protected void |
persistChild(WabitObject parent,
WabitObject child,
java.lang.Class<? extends WabitObject> childClassType,
int indexOfChild)
Calls WabitPersister.persistObject(String, String, String, int)
for the child object and
WabitPersister.persistProperty(String, String, DataType, Object)
for each property on the object. |
void |
persistObject(WabitObject wo)
Persists the given object and all of its descendants to the next persister. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
transactionEnded(ca.sqlpower.util.TransactionEvent e)
Signals a transaction has finished. |
void |
transactionRollback(ca.sqlpower.util.TransactionEvent e)
Signals a transaction has finished and the events that occurred during the transaction need to be reversed or not acted upon. |
void |
transactionStarted(ca.sqlpower.util.TransactionEvent e)
Called when a transaction has started. |
void |
wabitChildAdded(WabitChildEvent e)
Called when a child is added to an object this listener is attached to. |
void |
wabitChildRemoved(WabitChildEvent e)
Called when a child is removed from an object this listener is attached to. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WorkspacePersisterListener(WabitSession session,
WabitPersister targetPersister)
A new listener should only be created in testing. To properly add a
listener to a session see
#attachListener(WabitSession, WabitPersister).
session - The session whose workspace will be listened to.targetPersister - The persister that will have the events be forwarded to as
persist calls.
public WorkspacePersisterListener(WabitSession session,
WabitPersister targetPersister,
WabitSessionPersister eventSource)
A new listener should only be created in testing. To properly add a
listener to a session see
#attachListener(WabitSession, WabitPersister).
session - The session whose workspace will be listened to.targetPersister - The persister that will have the events be forwarded to as
persist calls.eventSource - A WabitPersister that this listener will consult in
order to perform 'echo-cancellation' of events.| Method Detail |
|---|
public static WorkspacePersisterListener attachListener(WabitSession session,
WabitPersister targetPersister,
WabitSessionPersister eventSource)
session - The session to listen to for lifecycle changes and its
workspace will be listened to by a new persister listener.targetPersister - This persister will have persist methods called on it when
events occur in the workspace in the given session.public void transactionEnded(ca.sqlpower.util.TransactionEvent e)
WabitListener
transactionEnded in interface WabitListenere - Contains the object that has finished a transaction.public void transactionRollback(ca.sqlpower.util.TransactionEvent e)
WabitListener
transactionRollback in interface WabitListenere - Contains the object that was rolled back and a message
describing why the transaction was rolled back.public void transactionStarted(ca.sqlpower.util.TransactionEvent e)
WabitListener
transactionStarted in interface WabitListenere - Contains what object started a transaction and a message
describing the transaction.public void wabitChildAdded(WabitChildEvent e)
WabitListener
wabitChildAdded in interface WabitListenere - An event describing the child added.public void persistObject(WabitObject wo)
wo - The root of the tree of objects that will be persisted. This
object and all of its children will be persisted.
protected void persistChild(WabitObject parent,
WabitObject child,
java.lang.Class<? extends WabitObject> childClassType,
int indexOfChild)
WabitPersister.persistObject(String, String, String, int)
for the child object and
WabitPersister.persistProperty(String, String, DataType, Object)
for each property on the object.
parent - The parent of the object being persisted as added to this
object.child - The child object that was added to its parent.childClassType - The object type of the child added.indexOfChild - The index of the child in the child list of the parent.public void wabitChildRemoved(WabitChildEvent e)
WabitListener
wabitChildRemoved in interface WabitListenere - An event describing the child removed.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||