com.sap.tc.logging

Class Configurator

java.lang.Object
  extended by com.sap.tc.logging.Configurator
Direct Known Subclasses:
PropertiesConfigurator

public abstract class Configurator
extends Object

Configures the Logging API according to its settings. The configuration is done on demand but it is possible to instruct the configurator to redo it with a specific periodicity.


Constructor Summary
protected Configurator()
           
protected Configurator(ClassLoader classLoader)
           
 
Method Summary
abstract  void configure()
          Configures tracing and logging according to the settings of the configurator.
 ClassLoader getClassLoader()
          Gets the class loader that is responsible for loading custom classes in this configurator.
 Exception getException()
          Fetches the last exception thrown
 int getPeriodicity()
          Gets the periodicity of this configurator in minutes.
protected  void handleException(Exception exc)
          Handles exception.
protected  void resetException()
          Resets exception.
 void setClassLoader(ClassLoader classLoader)
          Sets the class loader that is responsible for loading custom classes in this configurator.
 void setPeriodicity(int mins)
          Sets the periodicity of this configurator in minutes.
 void throwException()
          Rethrows the last exception thrown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configurator

protected Configurator()

Configurator

protected Configurator(ClassLoader classLoader)
Method Detail

configure

public abstract void configure()
Configures tracing and logging according to the settings of the configurator.


getClassLoader

public ClassLoader getClassLoader()
Gets the class loader that is responsible for loading custom classes in this configurator.

Returns:
Class loader used for loading custom classes
See Also:
setClassLoader(java.lang.ClassLoader)

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Sets the class loader that is responsible for loading custom classes in this configurator. Custom classes are explicit implementations of Logging API interfaces or classes provided in the application. A typical example is a class implementing the interface Filter.

Parameters:
classLoader - Class loader used for loading custom classes
See Also:
getClassLoader()

getPeriodicity

public int getPeriodicity()
Gets the periodicity of this configurator in minutes. A periodicity of 0 means that the configurator is not called automatically.

Returns:
Periodicity of configurator in minutes

setPeriodicity

public void setPeriodicity(int mins)
Sets the periodicity of this configurator in minutes. This means that configure() will be automatically called every mins. Setting the periodicity to 0 turns off that automatic call.

Parameters:
mins - Periodicity of configurator in minutes

getException

public Exception getException()
Fetches the last exception thrown

Returns:
Last exception thrown
See Also:
throwException()

throwException

public void throwException()
                    throws Exception
Rethrows the last exception thrown. This method is useful if an exception is supposed to be dealt with according to a hierarchy of handlers already declared in a context.

Throws:
Exception - Last exception thrown
See Also:
getException()

resetException

protected void resetException()
Resets exception.


handleException

protected void handleException(Exception exc)
Handles exception.

Parameters:
exc - Exception thrown
Access Rights

This class can be accessed from:


SC DC
[sap.com] FRAMEWORK [sap.com] tc/ddic/ddicruntime
[sap.com] ENGINEAPI [sap.com] tc/logging
[sap.com] ENGFACADE [sap.com] tc/bl/logging/api
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.lib
[sap.com] BRMS-FACADE [sap.com] tc/brms/facade


Copyright 2010 SAP AG Complete Copyright Notice