public abstract class AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject> extends AccessibleServerObject<C,S> implements AliveBusinessObject<C,S,I>
AliveBusinessObject
s (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
ABOChangeEvent s
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, setLastAccessorId
checkOnClient, checkOnServer, getClientContext, getLogChannel, getServerContext, isLogDebug, isLogVerbose, isOnClient, isOnServer, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setClientContext, setLogChannel, setServerContext
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
createEditDialog, instantiateOnServer
isOnClient, isOnServer, setClientContext, setServerContext
getClientContext
getServerContext
toDumpString, toString
getLastAccessedTs, getLastAccessorId, setLastAccessorId
public AbstractABO(C clientCtx)
public AbstractABO(S serverCtx)
public PermissionDefinition getPermissionDefinition()
PermissionControlled
PermissionControlled
object with a unique name
and provides a list of supported assignable permissions.getPermissionDefinition
in interface PermissionControlled
protected PermissionDefinition createPermissionDefinition()
public PrimaryKey getPrimaryKey()
AliveBusinessObject
getPrimaryKey
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
public java.lang.String getResourceName()
RemoteLockable
ResourceLock
getResourceName
in interface RemoteLockable
public ResourceType getResourceType()
RemoteLockable
ResourceLock
getResourceType
in interface RemoteLockable
protected abstract PrimaryKey createPrimaryKey()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
protected boolean isbeingAccessed()
public boolean isOnline()
AliveBusinessObject
AliveBusinessObject.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()
AliveBusinessObject
ABOServerCache
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()
AliveBusinessObject
isVisibleInClientMonitor
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
public final void update() throws java.lang.Exception
AliveBusinessObject
update
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
java.lang.Exception
AliveBusinessObject.update(boolean)
public final void update(boolean isResetOnFailure) throws java.lang.Exception
AliveBusinessObject
update
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
isResetOnFailure
- tells whether a reset should happen on update failurejava.lang.Exception
protected void updateOnServer() throws java.lang.Exception
java.lang.Exception
public boolean delete() throws java.lang.Exception
AliveBusinessObject
AbstractPersistentABO
, then it is removed totally from the database.delete
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
java.lang.Exception
protected boolean deleteOnServer() throws java.lang.Exception
java.lang.Exception
public I create() throws java.lang.Exception
AliveBusinessObject
create
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
java.lang.Exception
protected I createOnServer() throws java.lang.Exception
java.lang.Exception
public I[] findCachedABOs(ABOFilter filter) throws java.lang.Exception
AliveBusinessObject
findCachedABOs
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
java.lang.Exception
public I fetch(boolean withLock, java.lang.Object... pkValues) throws java.lang.Exception
AliveBusinessObject
fetch
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
java.lang.Exception
public void refetch() throws java.lang.Exception
AliveBusinessObject
refetch
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
java.lang.Exception
public void drop()
AliveBusinessObject
ABOChangeEvent
s 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 RemoteLockable
public void setLocked(boolean doLock) throws java.lang.Exception
RemoteLockable
setLocked
in interface RemoteLockable
java.lang.Exception
public final void copyABOValues(I inst)
AliveBusinessObject
copyABOValues
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 Renderable
public java.lang.String getRenderText()
getRenderText
in interface Renderable
public java.awt.Color getRenderColor()
getRenderColor
in interface Renderable
public int getUpdateCount()
AliveBusinessObject
getUpdateCount
in interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
public <T> T deepClone()
DeepCloneable
deepClone
in interface DeepCloneable
deepClone
in class TransferableObject
public I clone()
clone
in class TransferableObject
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void addChangeListener(ABOChangeEvent.Listener l)
AliveBusinessObject
addChangeListener
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)
Dumpable
toString
in interface Dumpable
toString
in class DumpableObject
public DumpString toDumpString(DumpString s)
Dumpable
toDumpString
in interface Dumpable
toDumpString
in class DumpableObject
protected void receivedUpdateEvent(ABOChangeEvent e)
ABOChangeEvent
s
that were received for this ABO.public SimpleGate createChangeGate()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.