ca.sqlpower.wabit
Class AbstractWabitObject

java.lang.Object
  extended by ca.sqlpower.object.AbstractSPObject
      extended by ca.sqlpower.wabit.AbstractWabitObject
All Implemented Interfaces:
ca.sqlpower.object.SPObject, WabitObject
Direct Known Subclasses:
CellSetRenderer, Chart, ChartColumn, ChartRenderer, ColumnInfo, ContentBox, Guide, ImageRenderer, Label, Layout, OlapQuery, Page, QueryCache, ReportTask, ResultSetRenderer, WabitContainer, WabitDataSource, WabitImage, WabitItem, WabitJoin, WabitOlapAxis, WabitOlapDimension, WabitOlapSelection, WabitWorkspace

public abstract class AbstractWabitObject
extends ca.sqlpower.object.AbstractSPObject
implements WabitObject


Field Summary
 
Fields inherited from class ca.sqlpower.object.AbstractSPObject
uuid
 
Constructor Summary
AbstractWabitObject()
           
AbstractWabitObject(java.lang.String uuid)
          The uuid string passed in must be the toString representation of the UUID for this object.
 
Method Summary
 ca.sqlpower.object.CleanupExceptions cleanup()
          Default cleanup method that does nothing.
 void commit()
           
 boolean equals(java.lang.Object obj)
           
 void generateNewUUID()
           
 WabitObject getParent()
          Returns the parent of this WabitObject.
 WabitSession getSession()
          Helper method to find the session of a WabitObject.
protected  boolean isForegroundThread()
           
 boolean removeChild(ca.sqlpower.object.SPObject child)
           
 void rollback(java.lang.String message)
           
protected  void runInBackground(java.lang.Runnable runner)
          Calls the runInBackground method on the session this object is attached to if it exists.
protected  void runInForeground(java.lang.Runnable runner)
          Calls the runInForeground method on the session this object is attached to if it exists.
 java.lang.String toString()
           
 
Methods inherited from class ca.sqlpower.object.AbstractSPObject
addChild, addChildImpl, addSPListener, begin, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, getChildren, getName, getUUID, removeChildImpl, removeSPListener, setName, setParent, setUUID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ca.sqlpower.object.SPObject
addChild, addSPListener, allowsChildren, begin, childPositionOffset, getChildren, getChildren, getDependencies, getName, getUUID, removeDependency, removeSPListener, setName, setParent, setUUID
 

Constructor Detail

AbstractWabitObject

public AbstractWabitObject()

AbstractWabitObject

public AbstractWabitObject(java.lang.String uuid)
The uuid string passed in must be the toString representation of the UUID for this object. If the uuid string given is null then a new UUID will be automatically generated.

Method Detail

generateNewUUID

public void generateNewUUID()
Specified by:
generateNewUUID in interface ca.sqlpower.object.SPObject
Overrides:
generateNewUUID in class ca.sqlpower.object.AbstractSPObject

getParent

public WabitObject getParent()
Description copied from interface: WabitObject
Returns the parent of this WabitObject. This will be null when the object is first created until it is added as a child to another object. If this object is never added as a child to another object this will remain null and the object may be treated as the root node of a WabitObject tree.

Specified by:
getParent in interface ca.sqlpower.object.SPObject
Specified by:
getParent in interface WabitObject
Overrides:
getParent in class ca.sqlpower.object.AbstractSPObject
Returns:
The parent of this object.

removeChild

public final boolean removeChild(ca.sqlpower.object.SPObject child)
                          throws ca.sqlpower.object.ObjectDependentException
Specified by:
removeChild in interface ca.sqlpower.object.SPObject
Overrides:
removeChild in class ca.sqlpower.object.AbstractSPObject
Throws:
ca.sqlpower.object.ObjectDependentException

cleanup

public ca.sqlpower.object.CleanupExceptions cleanup()
Default cleanup method that does nothing. Override and implement this method if cleanup is necessary.

Specified by:
cleanup in interface ca.sqlpower.object.SPObject
Overrides:
cleanup in class ca.sqlpower.object.AbstractSPObject

getSession

public WabitSession getSession()
Helper method to find the session of a WabitObject. This will walk up the workspace tree to the WabitWorkspace and get its session. If the highest ancestor is not a WabitWorkspace or the workspace is not attached to a session this will throw a SessionNotFoundException.

Specified by:
getSession in interface ca.sqlpower.object.SPObject
Overrides:
getSession in class ca.sqlpower.object.AbstractSPObject

runInBackground

protected void runInBackground(java.lang.Runnable runner)
Calls the runInBackground method on the session this object is attached to if it exists. If this object is not attached to a session, which can occur when loading, copying, or creating a new object, the runner will be run on the current thread due to not being able to run elsewhere. Any WabitObject that wants to run a runnable in the background should call to this method instead of to the session.

Overrides:
runInBackground in class ca.sqlpower.object.AbstractSPObject
See Also:
SPSession.runInBackground(Runnable)

runInForeground

protected void runInForeground(java.lang.Runnable runner)
Calls the runInForeground method on the session this object is attached to if it exists. If this object is not attached to a session, which can occur when loading, copying, or creating a new object, the runner will be run on the current thread due to not being able to run elsewhere. Any WabitObject that wants to run a runnable in the foreground should call to this method instead of to the session.

Overrides:
runInForeground in class ca.sqlpower.object.AbstractSPObject
See Also:
SPSession.runInBackground(Runnable)

isForegroundThread

protected boolean isForegroundThread()
Overrides:
isForegroundThread in class ca.sqlpower.object.AbstractSPObject

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class ca.sqlpower.object.AbstractSPObject

commit

public void commit()
Specified by:
commit in interface ca.sqlpower.object.SPObject
Overrides:
commit in class ca.sqlpower.object.AbstractSPObject

rollback

public void rollback(java.lang.String message)
Specified by:
rollback in interface ca.sqlpower.object.SPObject
Overrides:
rollback in class ca.sqlpower.object.AbstractSPObject

toString

public java.lang.String toString()
Overrides:
toString in class ca.sqlpower.object.AbstractSPObject


Copyright © 2009. All Rights Reserved.