|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.logging.LogObject | +--com.ibm.logging.Gate | +--com.ibm.logging.Handler | +--com.ibm.able.AbleJTextAreaHandler
AbleJTextAreaHandler
extends Handler
and writes to
a Swing JTextArea
.
This handler creates its own JTextArea
when constructed.
Use the getTextArea
method to get a reference to the
text area if it is necessary to change the text area parameters.
Fields inherited from class com.ibm.logging.Handler |
---|
DEFAULT_QUEUE_CAPACITY, DEFAULT_RETRY_COUNT, DEFAULT_RETRY_INTERVAL, deviceFailures, deviceLock, deviceOpen, formatters, myThread, pWriter, queueEmptyLock, queueFullLock, retryTimer |
Fields inherited from class com.ibm.logging.Gate |
---|
isLogging, loggedRecordCount |
Fields inherited from interface com.ibm.logging.IConstants |
---|
KEY_BACKUP_CAPACITY, KEY_CLASS_NAME, KEY_CLIENT, KEY_COMPONENT, KEY_DATE_FORMAT, KEY_DEFAULT_MESSAGE_LOGGER, KEY_DEFAULT_TRACE_LOGGER, KEY_DESCRIPTION, KEY_ENCODING, KEY_FILE_NAME, KEY_FILTER_NAMES, KEY_FORMATTER_NAMES, KEY_GROUP, KEY_HANDLER_NAMES, KEY_HEX_DATA, KEY_IS_BACKUP_ENABLED, KEY_IS_CIRCULAR, KEY_IS_LOGGING, KEY_IS_SYNC, KEY_LOGGING_CLASS, KEY_LOGGING_METHOD, KEY_MASK, KEY_MAX_FILE_SIZE, KEY_MAX_FILES, KEY_MAX_MSG_CATS, KEY_MAX_RETRIES, KEY_MESSAGE_FILE, KEY_NAME, KEY_OBJECT_TYPE, KEY_ORGANIZATION, KEY_PARENT, KEY_PRODUCT, KEY_QUEUE_CAPACITY, KEY_RECORD_CLASSES, KEY_RETRY_INTERVAL, KEY_SEPARATOR, KEY_SERVER, KEY_SOCKET_PORT, KEY_SOCKET_SERVER, KEY_SUPPRESSED_KEYS, KEY_THREAD_ID, KEY_THROWABLE, KEY_THROWABLE_TRACE, KEY_TIME_FORMAT, LOG_VERSION, OBJ_TYPE_FILTER, OBJ_TYPE_FORMATTER, OBJ_TYPE_HANDLER, OBJ_TYPE_LOGGER, OBJ_TYPE_MESSAGE_LOGGER, OBJ_TYPE_TRACE_LOGGER, VALUE_LOCALIZED_DATE_TIME |
Constructor Summary | |
---|---|
AbleJTextAreaHandler()
Creates a AbleJTextAreaHandler . |
|
AbleJTextAreaHandler(java.lang.String name)
Creates a AbleJTextAreaHandler . |
|
AbleJTextAreaHandler(java.lang.String name,
java.lang.String desc)
Creates a TextAreaHandler . |
|
AbleJTextAreaHandler(java.lang.String name,
java.lang.String desc,
javax.swing.JTextArea textArea)
Creates a TextAreaHandler . |
Method Summary | |
---|---|
void |
closeDevice()
Closes the device to which the handler is sending its log entries and sets the deviceOpen flag to false . |
javax.swing.JTextArea |
getTextArea()
Gets the JTextArea used by this handler. |
void |
init()
Initializes this object to a default state. |
void |
openDevice()
Opens the device to which the handler will send its log entries. |
void |
setTextArea(javax.swing.JTextArea textArea)
Sets the name of the text area used by this handler. |
protected void |
writeRecord(com.ibm.logging.ILogRecord record)
Passes a log record synchronously from a logger to a handler. |
Methods inherited from class com.ibm.logging.Handler |
---|
addFormatter, dumpQueue, findFormatter, getBackupCapacity, getConfig, getFormatters, getMaxRetries, getQueueCapacity, getQueueCount, getRetryInterval, getThread, isBackupEnabled, isCircular, logRecord, newQueue, removeFormatter, run, setBackupCapacity, setBackupEnabled, setCircular, setConfig, setMaxRetries, setQueueCapacity, setRetryInterval, start, stop, toString |
Methods inherited from class com.ibm.logging.Gate |
---|
addFilter, getFilters, isLoggable, isLogging, removeAllFilters, removeFilter, setLogging |
Methods inherited from class com.ibm.logging.LogObject |
---|
addRecordClass, clone, getDescription, getGroup, getName, getRecordClasses, getType, isManaged, maskLongValue, maskToString, removeRecordClass, setDescription, setGroup, setManaged, setName, setType |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ibm.logging.IGate |
---|
addFilter, getFilters, isLoggable, isLogging, removeAllFilters, removeFilter, setLogging |
Methods inherited from interface com.ibm.logging.ILogObject |
---|
addRecordClass, getRecordClasses, maskLongValue, maskToString, removeRecordClass |
Methods inherited from interface com.ibm.logging.mgr.IManageable |
---|
getDescription, getGroup, getName, getType, isManaged, setDescription, setGroup, setManaged, setName, setType |
Constructor Detail |
public AbleJTextAreaHandler()
AbleJTextAreaHandler
. The name and
description of this object are empty strings.public AbleJTextAreaHandler(java.lang.String name)
AbleJTextAreaHandler
. The description
of this object is an empty string.name
- The name of this object.public AbleJTextAreaHandler(java.lang.String name, java.lang.String desc)
TextAreaHandler
.name
- The name of this object.desc
- The description of this object.public AbleJTextAreaHandler(java.lang.String name, java.lang.String desc, javax.swing.JTextArea textArea)
TextAreaHandler
.name
- The name of this object.desc
- The description of this object.textArea
- The JTextArea
to which this handler will
write.Method Detail |
public void init()
com.ibm.logging.mgr.LogManager
to initialize a
log object.init
in class com.ibm.logging.Handler
public void openDevice()
deviceOpen
flag is set
to true
. If not, the handler sets deviceOpen
to false
and writes a message to System.err
.
If the device is already open, it will be closed and then reopened.
Note: It is not necessary for an application to call
openDevice
. TextAreaHandler
will do this
automatically before attempting to write a log entry.
openDevice
in class com.ibm.logging.Handler
public void closeDevice()
deviceOpen
flag to false
.closeDevice
in class com.ibm.logging.Handler
protected void writeRecord(com.ibm.logging.ILogRecord record)
format
method of the configured formatter and then the
println
method of the configured print writer.
The logger must compare the record type against the handler's message
or trace mask before calling this method. If the log record
is null
, this method does nothing.
If an error occurs (as reported by the PrintWriter.checkError
method), the deviceOpen
flag is set false
and
the print writer is released.
writeRecord
in class com.ibm.logging.Handler
record
- A log record.public javax.swing.JTextArea getTextArea()
JTextArea
used by this handler.null
is returned.public void setTextArea(javax.swing.JTextArea textArea)
textArea
- The text area.
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |