|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.Adaptee org.norther.tammi.core.config.DefaultConfigurable org.norther.tammi.core.config.DefaultConfigurableFactory<Log> org.norther.tammi.core.logger.AbstractLogger org.norther.tammi.core.logger.AbstractThreadedLogger
public abstract class AbstractThreadedLogger
An abstract implementation of ThreadedLogger.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.norther.tammi.core.config.DefaultConfigurable |
---|
DefaultConfigurable.Modified |
Field Summary |
---|
Fields inherited from class org.norther.tammi.core.logger.AbstractLogger |
---|
traceOn |
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Fields inherited from interface org.norther.tammi.acorn.locale.Localizer |
---|
ANY_NAME |
Constructor Summary | |
---|---|
AbstractThreadedLogger()
Constructs a new logger. |
Method Summary | |
---|---|
void |
flush()
Flushes queued log entries. |
protected void |
flush(BlockingQueue<LogEntry> queue)
Flushes the log buffer. |
ObjectName |
getExecutorName()
Gets the the executor of this executable. |
boolean |
isStarted()
Checks whether the startable has been started. |
protected void |
push(LogEntry entry)
Pushes a log entry into a buffer. |
void |
run()
Polls the log entry queue and writes entries to the log. |
void |
setBufferSize(int size)
Sets the log buffer size. |
void |
setExecutorName(ObjectName executor)
Sets the executor of this executable. |
void |
start()
Starts the MBean. |
void |
stop()
Stops the MBean. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
protected abstract void |
write(LogEntry entry)
Writes the log entry to the log. |
Methods inherited from class org.norther.tammi.core.config.DefaultConfigurableFactory |
---|
getInstance, getInstance, getInstance |
Methods inherited from class org.norther.tammi.core.base.Adaptee |
---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.norther.tammi.core.logger.Logger |
---|
addAppender, addFilter, clearAppenders, clearFilters, getAdditivity, getAppenderNames, getBufferSize, getFilters, getLevel, getLevel, getLocalizedMessage, getLocalizedMessage, getLogClassName, getLogEntryEncoding, getLoggerClassName, getLoggerName, getPollingInterval, getTimeZoneId, isDefaultLogFactory, isLogEnabled, isLogEnabled, isStackTrace, isStaticTrace, isSystemErrLogged, isSystemOutLogged, log, log, log, log, log, log, log, log, log, log, release, removeAppender, removeFilter, setAdditivity, setDefaultLogFactory, setFilters, setLevel, setLevel, setLevelAsString, setLevelAsString, setLogClassName, setLogEntryEncoding, setLoggerName, setPollingInterval, setStackTrace, setStaticTrace, setSystemErrLogged, setSystemOutLogged, setTimeZoneId |
Methods inherited from interface org.norther.tammi.core.base.ObjectFactory |
---|
getInstance, getInstance, getInstance, getInstance, isLoaderSupported |
Methods inherited from interface org.norther.tammi.core.config.Configurable |
---|
addProperty, addProperty, addPropertyFilePath, addPropertyFilePath, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, getPropertyFilePaths, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, removePropertyFilePath, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, setPropertyFilePaths, setPropertyFilePaths, storeProperties |
Methods inherited from interface org.norther.tammi.core.locale.ResourceMap |
---|
addResourceBundleName, addResourceBundleNames, clearResourceBundleNames, clearResourceBundleNames, getDefaultBaseName, getFallbackResourcesName, getPlugInBaseName, getResourceBundleNames, getResourceFinderName, qualifierSet, removeResourceBundleName, resolveResourceBundle, resolveResourceBundleName, setDefaultBaseName, setFallbackResourcesName, setResourceBundleName, setResourceBundleNames, setResourceFinderName |
Methods inherited from interface org.norther.tammi.acorn.locale.Localizer |
---|
resolveLocalizedObject, resolveLocalizedResource, resolveLocalizedString, resolveLocalizedStrings |
Methods inherited from interface org.norther.tammi.core.cache.CacheClient |
---|
clearCached, expireCached, expireFraction, getCache, getSharedCacheName, isCachingDisabled, removeCache, setCachingDisabled, setSharedCacheName |
Methods inherited from interface org.norther.tammi.core.base.Refreshable |
---|
getRefreshed, refresh |
Constructor Detail |
---|
public AbstractThreadedLogger()
Method Detail |
---|
public void unmanaged() throws Exception
Manageable
unmanaged
in interface Manageable
unmanaged
in class AbstractLogger
Exception
- if the adaptee refused to be unmanaged.public ObjectName getExecutorName()
Executable
getExecutorName
in interface Executable
public void setExecutorName(ObjectName executor)
Executable
Note that it will be taken into use after next start.
setExecutorName
in interface Executable
executor
- the object name of the executor or a query.public boolean isStarted()
Startable
isStarted
in interface Startable
public void start() throws Exception
Startable
start
in interface Startable
Exception
- if start fails.public void stop()
Startable
stop
in interface Startable
public void run()
run
in interface Runnable
public void setBufferSize(int size)
Logger
setBufferSize
in interface Logger
setBufferSize
in class AbstractLogger
size
- the buffer size as a number of log entries.public void flush()
Logger
flush
in interface Logger
flush
in class AbstractLogger
protected void push(LogEntry entry)
push
in class AbstractLogger
entry
- a log entry.protected void flush(BlockingQueue<LogEntry> queue)
queue
- the entry queue.protected abstract void write(LogEntry entry)
entry
- the log entry.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |