com.sun.sgs.impl.kernel.logging
Class TransactionAwareLogManager

java.lang.Object
  extended by java.util.logging.LogManager
      extended by com.sun.sgs.impl.kernel.logging.TransactionAwareLogManager

public final class TransactionAwareLogManager
extends LogManager

A LogManager class that adds transactional semantics to Logger instances in the application's namespace. This class will either infer the application's name space from the package used by the main AppListener, or it can be specified manually by the following property:

Property: com.sun.sgs.logging.app.namespace
Default: the package named used in the com.sun.sgs.app.listener property.
This property specifies the root of the application namespace. All loggers under this root will be have transactional-semantics. If this property is left unset the system will use the namespace specified in the com.sun.sgs.app.listener property value.

In order to load this class as the default LogManager, applications must set the java.util.logging.manager system property to com.sun.sgs.impl.kernel.logging.TransactionAwareLogManager prior to JVM start up.

All Logger instances outside of the application's name space will retain their default, non-transactional semantics.

See Also:
TransactionalHandler

Field Summary
 
Fields inherited from class java.util.logging.LogManager
LOGGING_MXBEAN_NAME
 
Constructor Summary
TransactionAwareLogManager()
          Default constructor used by the JVM at startup.
 
Method Summary
 void configure(Properties properties, TransactionProxy txnProxy)
          Configures this LogManager with the provided properties and uses the TransactionProxy to add transactional semantics to any of the specified application Logger instances.
 Logger getLogger(String name)
          Returns the existing Logger for the provided name or creates a new instance if none is found.
 
Methods inherited from class java.util.logging.LogManager
addLogger, addPropertyChangeListener, checkAccess, getLoggerNames, getLoggingMXBean, getLogManager, getProperty, readConfiguration, readConfiguration, removePropertyChangeListener, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionAwareLogManager

public TransactionAwareLogManager()
Default constructor used by the JVM at startup.

Method Detail

configure

public void configure(Properties properties,
                      TransactionProxy txnProxy)
Configures this LogManager with the provided properties and uses the TransactionProxy to add transactional semantics to any of the specified application Logger instances.

Note that prior to this call, the application's namespace is not known so any Logger instances will be of type TransactionalLogger, but will be configured as non-transactional. After this call, any of these instances that were in the application's namespace will be transactional.

Parameters:
properties - the properties for configuring this component
txnProxy - the transaction proxy

getLogger

public Logger getLogger(String name)
Returns the existing Logger for the provided name or creates a new instance if none is found. Note that unlike the default LogManager implementation, this call will create a new Logger instance.

Overrides:
getLogger in class LogManager
Parameters:
name - the name of the logger
Returns:
the existing Logger for the provided name, or a new instance that was created by this call.

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved