public abstract class AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject> extends AccessibleServerObject<C,S> implements AliveBusinessObject<C,S,I>
AliveBusinessObjects (ABOs)| Constructor and Description |
|---|
AbstractABO(C clientCtx) |
AbstractABO(S serverCtx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ABOChangeEvent.Listener l)
Note that each ABO is responsible for receiving and processing
its own change events from the server.
|
I |
clone() |
int |
compareTo(java.lang.Object o) |
void |
copyABOValues(I inst)
Updates the values of this instance from another one.
|
I |
create()
Initializes this instance with values.
|
SimpleGate |
createChangeGate() |
protected I |
createOnServer() |
protected PermissionDefinition |
createPermissionDefinition() |
protected abstract PrimaryKey |
createPrimaryKey()
The ABO class must create the PrimaryKey it will need by its own.
|
<T> T |
deepClone()
Returns a deep clone of this object
|
boolean |
delete()
Deletes this ABO instance on the server.
|
protected boolean |
deleteOnServer()
Is called on server side before the ABO is deleted and removed from the cache
|
void |
drop()
Deregisters the accessor from the access list.
|
protected void |
dropOnServer()
Is called on server side before the ABO is dropped from the cache
|
boolean |
equals(java.lang.Object obj) |
I |
fetch(boolean withLock,
java.lang.Object... pkValues)
Fetches a new ABO instance by primary key values.
|
I[] |
findCachedABOs(ABOFilter filter)
Returns all cached ABOs of this type that match the filter condition.
|
void |
fireABOInitialized() |
PermissionDefinition |
getPermissionDefinition()
Returns an object that identifies a
PermissionControlled object with a unique name
and provides a list of supported assignable permissions. |
PrimaryKey |
getPrimaryKey()
Returns the primary key of this instance.
|
java.awt.Color |
getRenderColor() |
javax.swing.Icon |
getRenderIcon() |
java.lang.String |
getRenderText() |
java.lang.String |
getResourceName()
Returns the resource name being used for a server side
ResourceLock |
ResourceType |
getResourceType()
Returns the resource type being used for a server side
ResourceLock |
int |
getUpdateCount()
Tells how many server side updates have yet been performed on this instance.
|
int |
hashCode() |
protected boolean |
isbeingAccessed() |
boolean |
isCacheResident()
This flag causes the ABO to remain in the
ABOServerCache even if the
last accessing client drops it. |
boolean |
isLockedByMe()
Tells whether this ABO is locked by this session.
|
boolean |
isNumb() |
boolean |
isOnline()
Tells whether this ABO is receiving events.
|
boolean |
isVisibleInClientMonitor()
Tells whether this ABO shows up in the clients ActivityMonitor
|
protected abstract void |
overtakeABOValues(I inst)
Must be implemented by subclasses to copy their instance values
|
protected void |
receivedUpdateEvent(ABOChangeEvent e)
May be overridden to react specifically on
ABOChangeEvents
that were received for this ABO. |
void |
refetch()
Re-fetches the values of this ABO instance and makes it online again.
|
void |
removeChangeListener(ABOChangeEvent.Listener l) |
void |
setLocked(boolean doLock)
Fetches an exclusive ResourceLock from the server
|
void |
setNumb(boolean isNumb)
In numb mode the ABO does not react on change events from the server
and thus does not fire any local change events.
|
DumpString |
toDumpString(DumpString s)
This method allows subclasses to add values to the existing DumpString of the superclass.
|
ToString |
toString(ToString s)
This method allows subclasses to add values to the existing ToString of the superclass.
|
void |
update()
Updates this instance with the current values.
|
void |
update(boolean isResetOnFailure)
Updates the ABO on the server.
|
protected void |
updateOnServer()
Needs only be overridden to ensure persistence before ABO is replaced in the cache.
|
getLastAccessedTs, getLastAccessorId, setLastAccessorIdcheckOnClient, checkOnServer, getClientContext, getLogChannel, getServerContext, isLogDebug, isLogVerbose, isOnClient, isOnServer, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setClientContext, setLogChannel, setServerContextconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcreateEditDialog, instantiateOnServerisOnClient, isOnServer, setClientContext, setServerContextgetClientContextgetServerContexttoDumpString, toStringgetLastAccessedTs, getLastAccessorId, setLastAccessorIdpublic AbstractABO(C clientCtx)
public AbstractABO(S serverCtx)
public PermissionDefinition getPermissionDefinition()
PermissionControlledPermissionControlled object with a unique name
and provides a list of supported assignable permissions.getPermissionDefinition in interface PermissionControlledprotected PermissionDefinition createPermissionDefinition()
public PrimaryKey getPrimaryKey()
AliveBusinessObjectgetPrimaryKey in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>public java.lang.String getResourceName()
RemoteLockableResourceLockgetResourceName in interface RemoteLockablepublic ResourceType getResourceType()
RemoteLockableResourceLockgetResourceType in interface RemoteLockableprotected abstract PrimaryKey createPrimaryKey()
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableprotected boolean isbeingAccessed()
public boolean isOnline()
AliveBusinessObjectAliveBusinessObject.drop() call the abo receives no
more update notifications from the server an thus is considered to be offline. A
AliveBusinessObject.refetch() call will bring it online again.isOnline in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>public boolean isCacheResident()
AliveBusinessObjectABOServerCache even if the
last accessing client drops it. Is false by default.isCacheResident in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>public boolean isVisibleInClientMonitor()
AliveBusinessObjectisVisibleInClientMonitor in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>public final void update()
throws java.lang.Exception
AliveBusinessObjectupdate in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>java.lang.ExceptionAliveBusinessObject.update(boolean)public final void update(boolean isResetOnFailure)
throws java.lang.Exception
AliveBusinessObjectupdate in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>isResetOnFailure - tells whether a reset should happen on update failurejava.lang.Exceptionprotected void updateOnServer()
throws java.lang.Exception
java.lang.Exceptionpublic boolean delete()
throws java.lang.Exception
AliveBusinessObjectAbstractPersistentABO, then it is removed totally from the database.delete in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>java.lang.Exceptionprotected boolean deleteOnServer()
throws java.lang.Exception
java.lang.Exceptionpublic I create() throws java.lang.Exception
AliveBusinessObjectcreate in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>java.lang.Exceptionprotected I createOnServer() throws java.lang.Exception
java.lang.Exceptionpublic I[] findCachedABOs(ABOFilter filter) throws java.lang.Exception
AliveBusinessObjectfindCachedABOs in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>java.lang.Exceptionpublic I fetch(boolean withLock, java.lang.Object... pkValues) throws java.lang.Exception
AliveBusinessObjectfetch in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>java.lang.Exceptionpublic void refetch()
throws java.lang.Exception
AliveBusinessObjectrefetch in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>java.lang.Exceptionpublic void drop()
AliveBusinessObjectABOChangeEvents any more.
If this was the last accessor and the ABO is not cache resistent it will be removed from the server cache.drop in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>protected void dropOnServer()
public boolean isLockedByMe()
ActiveLocksListModel for performance reason.
Foreign locks are not considered here.isLockedByMe in interface RemoteLockablepublic void setLocked(boolean doLock)
throws java.lang.Exception
RemoteLockablesetLocked in interface RemoteLockablejava.lang.Exceptionpublic final void copyABOValues(I inst)
AliveBusinessObjectcopyABOValues in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>protected abstract void overtakeABOValues(I inst)
public javax.swing.Icon getRenderIcon()
getRenderIcon in interface Renderablepublic java.lang.String getRenderText()
getRenderText in interface Renderablepublic java.awt.Color getRenderColor()
getRenderColor in interface Renderablepublic int getUpdateCount()
AliveBusinessObjectgetUpdateCount in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>public <T> T deepClone()
DeepCloneabledeepClone in interface DeepCloneabledeepClone in class TransferableObjectpublic I clone()
clone in class TransferableObjectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void addChangeListener(ABOChangeEvent.Listener l)
AliveBusinessObjectaddChangeListener in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>public void removeChangeListener(ABOChangeEvent.Listener l)
removeChangeListener in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>public void fireABOInitialized()
public void setNumb(boolean isNumb)
public boolean isNumb()
public ToString toString(ToString s)
DumpabletoString in interface DumpabletoString in class DumpableObjectpublic DumpString toDumpString(DumpString s)
DumpabletoDumpString in interface DumpabletoDumpString in class DumpableObjectprotected void receivedUpdateEvent(ABOChangeEvent e)
ABOChangeEvents
that were received for this ABO.public SimpleGate createChangeGate()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.