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, toStringgetApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannelconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toStringpublic 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 Initializablejava.lang.Exceptionprotected final void setInitialized()
public final boolean isInitialized()
InitializableisInitialized in interface Initializablepublic final void checkInitialized()
throws NotInitializedException
InitializableNotInitializedException if not.checkInitialized in interface InitializableNotInitializedExceptionpublic void close()
ServerContext is closed.
This default implementation just logs that the model has been destroyed.close in interface java.lang.AutoCloseablepublic final java.sql.Timestamp getCreatedTs()
public final java.sql.Timestamp getLastAccessedTs()
LastAccessedgetLastAccessedTs in interface LastAccessedpublic final SessionId getLastAccessorId()
LastAccessedgetLastAccessorId in interface LastAccessedpublic final void setLastAccessorId(SessionId sessId)
LastAccessedsetLastAccessorId in interface LastAccessedprotected void sendChangeEvent(NetEvent event)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.