|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.gjsa.server.LoggerCenter
Global handler for free-floating-channel-assignments. Instantiated once per GJSA server. Gets information about all receivable loggers. Server threads can then attach themselves to those loggers. The Mutex cares for multiple-executor-aware handling of these attachments. The attachment of a ServerThreadBase to a Logger is only removed if all executors are removed that have asked for the attachment. Main data storage is the threadbases map. It contains a map for each registered ServerThreadBase (identified by its number). The per-ServerThreadBase maps contain the loggers as keys and a Set as value. The Set contains a list of all CommandExecutors which have attached themselved to this very logger. If all CommandExecutors detach from a logger, the ServerThreadBase is deregistered from it. Same happens if the ServerThreadBase itself closes. The main map, threadbases is synchronized. E.g. it can be accessed by all the handling threads at the same time. As every ServerThreadBase runs in its own thread (and either itself or any cleanup task is running at the same time), the per-ServerThreadBase maps and Sets do not need to be synchronized.
Field Summary | |
private java.util.Map |
loggers
|
Constructor Summary | |
LoggerCenter(GJSAServer myserverx)
|
Method Summary | |
Logger |
getLogger(java.lang.String name)
Returns a stored logger. |
void |
putLogger(java.lang.String name,
Logger logger)
Adds a new logger. |
boolean |
registerExecutor(java.lang.String loggername,
CommandExecutor exec)
Register an executor unconditionally and without transaction number The executor's ServerThreadBase is registered without conditions to the Logger. |
boolean |
registerExecutor(java.lang.String loggername,
CommandExecutor exec,
boolean updatereceiver)
Register an executor without transaction number or logical expression, but with the possibility to set update recevier flag. |
boolean |
registerExecutor(java.lang.String loggername,
CommandExecutor exec,
int transactionnumber)
Register an executor without logical expression |
boolean |
registerExecutor(java.lang.String loggername,
LogicExpr lex,
CommandExecutor exec)
Register an executor without transaction number |
protected boolean |
registerExecutor(java.lang.String loggername,
LogicExpr lex,
CommandExecutor exec,
int transactionnumber,
boolean updatereceiver)
Register an executor for logging. |
void |
removeLogger(java.lang.String name)
Removes a logger. |
boolean |
unregisterExecutor(java.lang.String loggername,
CommandExecutor exec)
Unregister an executor from listening to a logger. |
void |
unregisterServerThreadBase(ServerThreadBase stb)
Unregisters a ServerThreadBase directly. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Map loggers
Constructor Detail |
public LoggerCenter(GJSAServer myserverx)
Method Detail |
public void putLogger(java.lang.String name, Logger logger)
name
- Name of the loggerlogger
- The logger objectpublic Logger getLogger(java.lang.String name)
public void removeLogger(java.lang.String name)
protected boolean registerExecutor(java.lang.String loggername, LogicExpr lex, CommandExecutor exec, int transactionnumber, boolean updatereceiver)
loggername
- Name of a logger to register atlex
- logical expression to register asexec
- CommandExecutor which has requested registrationtransactionnumber
- last received number for this receiverupdatereceiver
- requests update of receiver if logger is UpdateableLogger
public boolean registerExecutor(java.lang.String loggername, CommandExecutor exec, boolean updatereceiver)
loggername
- Name of a logger to register atexec
- CommandExecutor which has requested registrationupdatereceiver
- requests update of receiver if logger is UpdateableLogger
public boolean registerExecutor(java.lang.String loggername, LogicExpr lex, CommandExecutor exec)
loggername
- Name of a logger to register atlex
- logical expression to register asexec
- CommandExecutor which has requested registration
public boolean registerExecutor(java.lang.String loggername, CommandExecutor exec, int transactionnumber)
loggername
- Name of a logger to register atexec
- CommandExecutor which has requested registrationtransactionnumber
- last received number for this receiver
public boolean registerExecutor(java.lang.String loggername, CommandExecutor exec)
loggername
- Name of a logger to register withexec
- CommandExecutor requesting the registration
public boolean unregisterExecutor(java.lang.String loggername, CommandExecutor exec)
loggername
- Logger to remove fromexec
- Executor asking for removal
public void unregisterServerThreadBase(ServerThreadBase stb)
stb
-
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |