|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.kernel.log.impl.AbstractLoggingMechanism
public abstract class AbstractLoggingMechanism
AbstractLoggingMechanism is an abstract class which serves to define a hierarchy of different logging mechanisms. Subclasses of this class will implement the different mechanisms defined herein. The main responsibility of this class hierarchy is to offload the implementation work for differences in logging streams for different mechanisms. For example, the standard error stream is a very different implementation than a shared local output file.
| Field Summary | |
|---|---|
static String |
OPEN_DATE_FORMAT
|
| Constructor Summary | |
|---|---|
AbstractLoggingMechanism()
|
|
| Method Summary | |
|---|---|
boolean |
acceptsNotificationLogs()
Checks if the mechanisms accepts notification logs. |
boolean |
acceptsPerformanceLogs()
Checks if the mechanisms accepts performance logs. |
boolean |
acceptsStandardLogs()
Checks if the mechanisms accepts standard logs. |
boolean |
acceptsStatisticLogs()
Checks if the mechanisms accepts statistics logs. |
protected void |
close()
This method closes the particular logging mechanism so that messages no longer get logged to the mechanism. |
protected LogFormatter |
createFormatter(String logName,
LogProperties logProperties)
Create a new log event formatter. |
LogEvent |
createNotificationEvent(Log log,
String summary,
String detail)
Creates a notification log event. |
List |
getActiveEntities()
Returns a list of all active (in use) log entities that are available by the file logging mechanisms controlled by this logger |
protected Date |
getDateOpend()
The date this mechanism was openend. |
protected LogFormatter |
getFormatter()
Returns the log event formatter. |
protected Vector |
getLoggers()
The loggers that use this mechanism |
String |
getName()
Return the name of the mechanism. |
List |
getReadableEntities()
Returns a list of all readable log entities that are available by the file logging mechanisms controlled by this logger |
LogEntityReader |
getReader(LogEntity entity)
Returns an entity reader for given log entity |
List |
getRemoveableEntities()
Returns a list of all removeable log entities that are available by the file logging mechanisms controlled by this logger |
protected boolean |
isOpen()
Returns true if the mechanism is open |
protected boolean |
isSharedLog()
Mechanisms can be shared or unique. |
protected abstract void |
logEvent(Log log,
LogEvent event)
Logs a string to printStream, complete with a descriptive prefix so viewers of the log can interpret who logged which strings and how important they were. |
protected void |
notifyLogClosed(Log log)
Log a message that a logger was closed on this mechanism |
protected void |
notifyLoggingLevelChange(Log log,
int loggingLevel)
Log a log level change |
protected void |
notifyLoggingPerformanceChange(Log log,
boolean state)
Log a performance change |
protected void |
notifyLoggingStatisticsChange(Log log,
boolean state)
Put out a nice message that a log changed its statistics state |
protected void |
notifyLogOpened(Log log,
int loggingLevel)
Log a message that a logger was openend on this mechanism |
protected void |
open(Log log)
This method opens the particular logging mechanism so that messages can be output. |
void |
removeEntity(LogEntity entity)
Remove a log entity |
protected void |
setFormatter(LogFormatter formatter)
Sets a new log event formatter. |
protected void |
setNotification(boolean newMode)
Sets a new notification mode |
String |
toString()
Return a nice debug string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String OPEN_DATE_FORMAT
| Constructor Detail |
|---|
public AbstractLoggingMechanism()
| Method Detail |
|---|
protected void open(Log log)
protected void close()
protected void notifyLogOpened(Log log,
int loggingLevel)
log - A loggerstate - An initial log levelprotected void notifyLogClosed(Log log)
log - A logger
protected void notifyLoggingLevelChange(Log log,
int loggingLevel)
log - A loggerstate - A new log level
protected void notifyLoggingPerformanceChange(Log log,
boolean state)
log - A loggerstate - A new performance logging state
protected void notifyLoggingStatisticsChange(Log log,
boolean state)
log - A loggerstate - A new state to be logged as notification
protected abstract void logEvent(Log log,
LogEvent event)
log - A loggerevent - A log eventprotected boolean isSharedLog()
The default is shared (true).
protected void setNotification(boolean newMode)
newMode - A new notification mode for the mechanismprotected boolean isOpen()
protected Vector getLoggers()
protected Date getDateOpend()
protected LogFormatter createFormatter(String logName,
LogProperties logProperties)
logName - the logger's namelogProperties - the log propertiesprotected LogFormatter getFormatter()
protected void setFormatter(LogFormatter formatter)
a - log event formatterpublic boolean acceptsStandardLogs()
public boolean acceptsStatisticLogs()
public boolean acceptsPerformanceLogs()
public boolean acceptsNotificationLogs()
public String getName()
public String toString()
toString in class Objectpublic List getActiveEntities()
getActiveEntities in interface ManageableMechanismLogEntity objectspublic List getReadableEntities()
getReadableEntities in interface ManageableMechanismpublic List getRemoveableEntities()
getRemoveableEntities in interface ManageableMechanismpublic void removeEntity(LogEntity entity)
removeEntity in interface ManageableMechanismString - an entity namepublic LogEntityReader getReader(LogEntity entity)
getReader in interface ManageableMechanismString - an entity name
public final LogEvent createNotificationEvent(Log log,
String summary,
String detail)
log - A loggersummary - A notification summary (E.g. "Log closed")detail - A notification detail
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||