|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.servlet.debug.DebugManager
Servlet debug manager for monitoring servlet I/O. An instance of this object monitors a single servlet instance. A fixed-sized queue of servlet transaction records is maintained. As a transaction is completed by the servlet, a record is added to the end of the queue. If the queue has reached its maximum size, an element is removed from the head of the queue. Applications wishing to monitor servlet transactions registers with this object and is called when objects are added or removed from the queue. Calling on removal is necessary as one of the main goals of this class is to support presentations that display a list of transaction records. A unique id number is associated with each transaction record. The transaction record ids are sequencially allocated, one with a large number occured after one with a smaller number.
Field Summary | |
protected ServletRecordQueue |
recordQueue
Queue of transaction records. |
Constructor Summary | |
DebugManager(java.lang.String servletId,
int queueSize,
boolean saveResponseData)
Construct an new servlet debug manager and associate it with a servlet. |
Method Summary | |
void |
addTransactionCallback(ServletRecordCallback callback,
boolean catchUp)
Registered to be called when a servlet transaction is queued. |
protected void |
addTransactionRecord(ServletTransactionRecord transactionRecord)
Add a servlet transaction to the end of the queue. |
void |
clearRecordQueue()
Clear all records from the queue. |
void |
disable()
Disable recording servlet transactions. |
void |
enable()
Enable recording servlet transactions. |
java.lang.String |
getServlet()
Get the servlet associated with this object. |
ServletTransactionRecord |
getTransactionRecord(int transactionId)
Find a servlet transaction record by id. |
boolean |
isEnabled()
Determine if servlets monitoring is enabled. |
void |
removeTranactionCallback(ServletRecordCallback callback)
Remove transaction callback that was created with addTransactionCallback . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ServletRecordQueue recordQueue
Constructor Detail |
public DebugManager(java.lang.String servletId, int queueSize, boolean saveResponseData)
servletId
- symbolic servlet identifier of the servlet to manage.queueSize
- maximum number of servlet transaction records that
can be queued at a given time.saveResponseData
- Should we save a copy of the data written
to the socket for each transaction? Could use up alot of memory.Method Detail |
public void enable() throws ConnectionMethodException
ConnectionMethodException
- If there is an error getting
the connection methods and channels, or adding the filter.public void disable() throws ConnectionMethodException
ConnectionMethodException
- If there is an error getting
the connection methods and channels, or adding the filter.public boolean isEnabled()
true
if enabled, false
if disabled.public java.lang.String getServlet()
public void addTransactionCallback(ServletRecordCallback callback, boolean catchUp)
callback
- The object to invoke when a transaction object
is available.catchUp
- Pass in true if you want an initial series of
transactionRecordAddEvent()
calls, reflecting the
current set of transactions stored in the queue.
Wanring: if this is set to true, and there are transactions in the
queue, then transactionRecordAddEvent()
will be
called before this function returns.public void removeTranactionCallback(ServletRecordCallback callback)
addTransactionCallback
.
callback
- object to delete from callback list.public ServletTransactionRecord getTransactionRecord(int transactionId)
transactionId
- unique number identifying the desired transaction
record.
null
if the transaction
is no longer in the queue.protected void addTransactionRecord(ServletTransactionRecord transactionRecord)
transactionRecord
- the record to add to the queue.public void clearRecordQueue()
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |