public abstract class AbstractServerModel<S extends ServerContext> extends AbstractServerObject<S> implements LastAccessed, CloseableComponent, Initializable
Constructor and Description |
---|
AbstractServerModel(S serverCtx) |
AbstractServerModel(S serverCtx,
java.lang.String modelName) |
Modifier and Type | Method and Description |
---|---|
void |
checkInitialized()
Checks whether initialization has yet been done and throws
an
NotInitializedException if not. |
void |
close()
Is called on model when the
ServerContext is closed. |
java.sql.Timestamp |
getCreatedTs() |
java.sql.Timestamp |
getLastAccessedTs()
Returns the timestamp of last client access
|
SessionId |
getLastAccessorId()
Tells which client has last accessed the model
|
java.lang.String |
getModelName()
Returns a name for identification
|
void |
init()
Is called on model after the
ServerContext has been constructed successfully. |
boolean |
isInitialized()
Tells whether initialization has yet been done.
|
protected void |
sendChangeEvent(NetEvent event)
This method should be called for any change on the model in order to notify all clients.
|
protected void |
setInitialized() |
void |
setLastAccessorId(SessionId sessId)
Sets the sessionId of the client who has last accessed the model
|
checkPermission, getServerConfig, getServerContext, getStatisticManager, toString
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString
public AbstractServerModel(S serverCtx)
public AbstractServerModel(S serverCtx, java.lang.String modelName)
public final java.lang.String getModelName()
public void init() throws java.lang.Exception
ServerContext
has been constructed successfully.
This default implementation just logs that the model has been initialized.init
in interface Initializable
java.lang.Exception
protected final void setInitialized()
public final boolean isInitialized()
Initializable
isInitialized
in interface Initializable
public final void checkInitialized() throws NotInitializedException
Initializable
NotInitializedException
if not.checkInitialized
in interface Initializable
NotInitializedException
public void close()
ServerContext
is closed.
This default implementation just logs that the model has been destroyed.close
in interface java.lang.AutoCloseable
public final java.sql.Timestamp getCreatedTs()
public final java.sql.Timestamp getLastAccessedTs()
LastAccessed
getLastAccessedTs
in interface LastAccessed
public final SessionId getLastAccessorId()
LastAccessed
getLastAccessorId
in interface LastAccessed
public final void setLastAccessorId(SessionId sessId)
LastAccessed
setLastAccessorId
in interface LastAccessed
protected void sendChangeEvent(NetEvent event)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.