jrunx.logger
Class ThreadedLogEventHandler
jrunx.kernel.ServiceAdapter
|
+--jrunx.kernel.ServicePartition
|
+--jrunx.kernel.ConfigurableServicePartition
|
+--jrunx.logger.LogEventHandler
|
+--jrunx.logger.ThreadedLogEventHandler
- All Implemented Interfaces:
- ConfigurableServicePartitionMBean, LogEventHandlerMBean, javax.naming.Referenceable, java.lang.Runnable, java.io.Serializable, Service, ServiceMBean, ServicePartitionMBean, ThreadedLogEventHandlerMBean
- public class ThreadedLogEventHandler
- extends LogEventHandler
- implements ThreadedLogEventHandlerMBean, java.lang.Runnable
Maintains a queue of log events and processes them in a background
thread (via the Scheduler). This allows callers to post log events
and not have to wait for them to be delivered.
- Author:
- Karl Moss
- See Also:
- Serialized Form
| Fields inherited from class jrunx.kernel.ServiceAdapter |
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER |
| Methods inherited from class jrunx.kernel.ServiceAdapter |
bind, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, toString, unbind, unscheduleRunnable, updateStatus |
| Methods inherited from interface jrunx.kernel.ServiceMBean |
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind |
queue
protected java.util.Vector queue
queuePointer
protected int queuePointer
flushing
protected boolean flushing
lockObject
protected java.lang.Object lockObject
handlers
protected java.util.ArrayList handlers
ThreadedLogEventHandler
public ThreadedLogEventHandler()
addLogEventHandler
public void addLogEventHandler(LogEventHandler handler)
start
public void start()
- Description copied from class:
ServiceAdapter
- Every service other than mere data collections should start
- Specified by:
start in interface Service- Overrides:
start in class ConfigurableServicePartition
stop
public void stop()
throws java.lang.Exception
- Description copied from class:
ServiceAdapter
- Every service other than mere data collections should stop
- Specified by:
stop in interface Service- Overrides:
stop in class ConfigurableServicePartition
flush
public void flush()
- Description copied from interface:
LogEventHandlerMBean
- Flushes all messages to the underlying destination
- Specified by:
flush in interface LogEventHandlerMBean- Overrides:
flush in class LogEventHandler
logEvent
public boolean logEvent(LogEvent event)
- Overrides:
logEvent in class LogEventHandler
run
public void run()
- Specified by:
run in interface java.lang.Runnable
processNextInQueue
protected boolean processNextInQueue()
- Process the next entry in the queue.
- Returns:
- true if there are more entires in the queue
Copyright � 2002 Macromedia Corporation. All Rights Reserved.