org.openmdx.kernel.log.impl
Class PluggableLoggingMechanismProxy

java.lang.Object
  extended by org.openmdx.kernel.log.impl.AbstractLoggingMechanism
      extended by org.openmdx.kernel.log.impl.PluggableLoggingMechanismProxy
All Implemented Interfaces:
ManageableMechanism

public class PluggableLoggingMechanismProxy
extends AbstractLoggingMechanism
implements ManageableMechanism

This is the proxy mechanism for pluggable logging mechanisms. It decouples PluggableLoggingMechanism from the logging framework.

Author:
Juerg Lang

Field Summary
 
Fields inherited from class org.openmdx.kernel.log.impl.AbstractLoggingMechanism
OPEN_DATE_FORMAT
 
Constructor Summary
PluggableLoggingMechanismProxy(String logName, PluggableLoggingMechanism mechanism)
           
 
Method Summary
 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.
 String getName()
          Return the name of the mechanism.
protected  void logEvent(Log log, LogEvent event)
          Logs a log event
protected  void notifyLogClosed(Log log)
          Puts out a message that a log was closed on this mechanism
protected  void notifyLoggingLevelChange(Log log, int loggingLevel)
          Puts out a message that a log changed its logging level
protected  void notifyLoggingPerformanceChange(Log log, boolean state)
          Puts out a message that a log changed its performance level
protected  void notifyLoggingStatisticsChange(Log log, boolean state)
          Puts out a message that a log changed its statistics level
protected  void notifyLogOpened(Log log, int loggingLevel)
          Puts out a message that a log was opened on this mechanism
 
Methods inherited from class org.openmdx.kernel.log.impl.AbstractLoggingMechanism
acceptsNotificationLogs, close, createFormatter, createNotificationEvent, getActiveEntities, getDateOpend, getFormatter, getLoggers, getReadableEntities, getReader, getRemoveableEntities, isOpen, isSharedLog, open, removeEntity, setFormatter, setNotification, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmdx.kernel.log.ManageableMechanism
getActiveEntities, getReadableEntities, getReader, getRemoveableEntities, removeEntity
 

Constructor Detail

PluggableLoggingMechanismProxy

public PluggableLoggingMechanismProxy(String logName,
                                      PluggableLoggingMechanism mechanism)
Method Detail

logEvent

protected void logEvent(Log log,
                        LogEvent event)
Logs a log event

Specified by:
logEvent in class AbstractLoggingMechanism
Parameters:
log - the log object
event - the log event

getName

public String getName()
Return the name of the mechanism.

Overrides:
getName in class AbstractLoggingMechanism
Returns:
a string

notifyLogOpened

protected void notifyLogOpened(Log log,
                               int loggingLevel)
Puts out a message that a log was opened on this mechanism

Overrides:
notifyLogOpened in class AbstractLoggingMechanism
Parameters:
log - a log object
loggingLevel - a logging level

notifyLogClosed

protected void notifyLogClosed(Log log)
Puts out a message that a log was closed on this mechanism

Overrides:
notifyLogClosed in class AbstractLoggingMechanism
Parameters:
log - a log object

notifyLoggingLevelChange

protected void notifyLoggingLevelChange(Log log,
                                        int loggingLevel)
Puts out a message that a log changed its logging level

Overrides:
notifyLoggingLevelChange in class AbstractLoggingMechanism
Parameters:
log - - a log object
loggingLevel - - a logging level

notifyLoggingPerformanceChange

protected void notifyLoggingPerformanceChange(Log log,
                                              boolean state)
Puts out a message that a log changed its performance level

Overrides:
notifyLoggingPerformanceChange in class AbstractLoggingMechanism
Parameters:
log - - a log object
state - - the new state

notifyLoggingStatisticsChange

protected void notifyLoggingStatisticsChange(Log log,
                                             boolean state)
Puts out a message that a log changed its statistics level

Overrides:
notifyLoggingStatisticsChange in class AbstractLoggingMechanism
Parameters:
log - - a log object
state - - the new state

acceptsStandardLogs

public boolean acceptsStandardLogs()
Checks if the mechanisms accepts standard logs. CRITICAL_ERROR ... TRACE level The default is to accept standard logs (true).

Overrides:
acceptsStandardLogs in class AbstractLoggingMechanism
Returns:
true if log accepts standard records

acceptsStatisticLogs

public boolean acceptsStatisticLogs()
Checks if the mechanisms accepts statistics logs. The default is to reject statistics (false).

Overrides:
acceptsStatisticLogs in class AbstractLoggingMechanism
Returns:
true if log accepts statistic records

acceptsPerformanceLogs

public boolean acceptsPerformanceLogs()
Checks if the mechanisms accepts performance logs. The default is to accept perfromance logs (true).

Overrides:
acceptsPerformanceLogs in class AbstractLoggingMechanism
Returns:
true if log accepts performance records


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.