|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.util.Logger biz.chitec.quarterback.gjsa.TransactionLogger
Logger with history. TransactionLogger stores its logged objects. Receivers get the objects together with a counter and can therefore store themselves which objects have been received and which not.
With this information, a TransactionLoggingReceiver can connect with its last received number. The transaction logger then retransmits all objects that have been logged between that last object and now. It takes care for right order and that no object is missed.
TransactionLogger needs a database to store the logged objects in. To do this, it needs JDBC and the GJSA object parsers.
The logger needs a database and a table in it which looks like this (MySQL syntax):
CREATE TABLE translogtable ( nr int NOT NULL default '0', inserted timestamp NOT NULL, content blob NOT NULL, PRIMARY KEY (nr) );Each TransactionLogger used in a program needs its own table!
Nested Class Summary |
Nested classes inherited from class biz.chitec.quarterback.util.Logger |
Logger.ChainElem |
Field Summary | |
private java.sql.Connection |
conn
|
private java.sql.Statement |
htstmt
Statement used in handling thread |
private java.lang.String |
lockname
The name of the rowlock variable |
private java.lang.String |
name
name of the table in the database and of the sequence counter in the sequencertable |
Fields inherited from class biz.chitec.quarterback.util.Logger |
first, handleloophandler, receiverexpr, receivers, sleeping, worked |
Constructor Summary | |
TransactionLogger()
Open without table name and without database connection. |
|
TransactionLogger(java.sql.Connection connx,
java.lang.String namex)
Init with a database connection and a table name. |
|
TransactionLogger(java.lang.String namex)
Open without database connection (but with the table name). |
Method Summary | |
boolean |
addReceiver(LoggingReceiver lr,
int oldnum)
Adds a receiver together with its stored last logged-object-counter-value. |
protected void |
handleLogObject(java.lang.Object o,
LoggingReceiver sender,
long ts,
boolean tosenderonly)
logging handler. |
protected void |
handleNewReceiver(LoggingReceiver lr,
int oldnum)
Internally used method for sending older data to new receiver. |
boolean |
removeReceiver(LoggingReceiver lr,
java.lang.Object reference)
Override super implementation to ignore given reference. |
protected int |
sendNewToReceiver(java.sql.Statement dbstmt,
LoggingReceiver lr,
int oldnum)
sends old data to new receiver. |
void |
setDBConnection(java.sql.Connection connx)
Sets or resets the database connection. |
Methods inherited from class biz.chitec.quarterback.util.Logger |
addReceiver, addReceiver, containsReceiver, continueHandleLogObject, doSendInHandleLoop, doSendToReceiver, emergencyRemoveReceiver, handleloop, logObject, logObject, logObject, logObjectToSenderOnly, nothingToHandle, removeReceiver |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.sql.Connection conn
private java.sql.Statement htstmt
private java.lang.String name
private java.lang.String lockname
Constructor Detail |
public TransactionLogger(java.sql.Connection connx, java.lang.String namex)
connx
- Description of the Parameternamex
- Description of the Parameterpublic TransactionLogger(java.lang.String namex)
namex
- Description of the Parameterpublic TransactionLogger()
Method Detail |
public void setDBConnection(java.sql.Connection connx)
connx
- The new dBConnection valuepublic boolean addReceiver(LoggingReceiver lr, int oldnum)
lr
- The feature to be added to the Receiver attributeoldnum
- The feature to be added to the Receiver attributeprotected void handleNewReceiver(LoggingReceiver lr, int oldnum)
lr
- Description of the Parameteroldnum
- Description of the Parameterprotected int sendNewToReceiver(java.sql.Statement dbstmt, LoggingReceiver lr, int oldnum) throws java.sql.SQLException
dbstmt
- Description of the Parameterlr
- Description of the Parameteroldnum
- Description of the Parameter
java.sql.SQLException
- Description of the Exceptionpublic boolean removeReceiver(LoggingReceiver lr, java.lang.Object reference)
removeReceiver
in class Logger
lr
- reference
-
protected void handleLogObject(java.lang.Object o, LoggingReceiver sender, long ts, boolean tosenderonly)
handleLogObject
in class Logger
o
- Description of the Parametersender
- Description of the Parameterts
- Description of the Parametertosenderonly
- Description of the Parameter
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |