org.objectweb.howl.log

Class Configuration

Implemented Interfaces:
ConfigurationMBean

public class Configuration
extends java.lang.Object
implements ConfigurationMBean

Provides configuration information for a Logger instance.

Author:
girouxm

Constructor Summary

Configuration()
Construct a Configuration object with default values.
Configuration(File propertyFile)
Construct a Configuration object using a Properties file specified by the caller.
Configuration(Properties prop)
Construct a Configuration object using a Properties object supplied by the caller.

Method Summary

String
getBufferClassName()
int
getBufferSize()
Returns the size of buffers specified as a number of 1K blocks.
int
getFlushSleepTime()
String
getLogFileDir()
String
getLogFileExt()
String
getLogFileMode()
String
getLogFileName()
int
getMaxBlocksPerFile()
int
getMaxBuffers()
int
getMaxLogFiles()
int
getMinBuffers()
int
getThreadsWaitingForceThreshold()
boolean
isChecksumEnabled()
void
setBufferClassName(String bufferClassName)
void
setBufferSize(int bufferSize)
void
setChecksumEnabled(boolean checksumOption)
void
setFlushSleepTime(int flushSleepTime)
void
setLogFileDir(String logFileDir)
void
setLogFileExt(String logFileExt)
void
setLogFileMode(String logFileMode)
void
setLogFileName(String logFileName)
void
setMaxBlocksPerFile(int maxBlocksPerFile)
void
setMaxBuffers(int maxBuffers)
void
setMaxLogFiles(int maxLogFiles)
void
setMinBuffers(int minBuffers)
void
setThreadsWaitingForceThreshold(int threadsWaitingForceThreshold)
void
store(OutputStream out)
Stores configuration properties to OutputStream.

Constructor Details

Configuration

public Configuration()
Construct a Configuration object with default values.

Caller will use setter methods to change the defaults.


Configuration

public Configuration(File propertyFile)
            throws LogConfigurationException
Construct a Configuration object using a Properties file specified by the caller.

Parameters:
propertyFile - File object describing a properties file


Configuration

public Configuration(Properties prop)
            throws LogConfigurationException
Construct a Configuration object using a Properties object supplied by the caller.

Parameters:
prop - Properties object containing default settings

Method Details

getBufferClassName

public String getBufferClassName()

Returns:
Returns the bufferClassName.


getBufferSize

public int getBufferSize()
Returns the size of buffers specified as a number of 1K blocks.

As an example, if buffers are 4096 bytes large, getBufferSize() returns 4.

Returns:
Returns the bufferSize as a number of 1K blocks.


getFlushSleepTime

public int getFlushSleepTime()

Returns:
Returns the flushSleepTime.


getLogFileDir

public String getLogFileDir()

Returns:
Returns the logDir.


getLogFileExt

public String getLogFileExt()

Returns:
Returns the logFileExt.


getLogFileMode

public String getLogFileMode()

Returns:
Returns the logFileMode.


getLogFileName

public String getLogFileName()

Returns:
Returns the logFileName.


getMaxBlocksPerFile

public int getMaxBlocksPerFile()

Returns:
Returns the maxBlocksPerFile.


getMaxBuffers

public int getMaxBuffers()

Returns:
Returns the maxBuffers.


getMaxLogFiles

public int getMaxLogFiles()

Returns:
Returns the maxLogFiles.


getMinBuffers

public int getMinBuffers()

Returns:
Returns the minBuffers.


getThreadsWaitingForceThreshold

public int getThreadsWaitingForceThreshold()

Returns:
Returns the threadsWaitingForceThreshold.


isChecksumEnabled

public boolean isChecksumEnabled()

Returns:
Returns the checksumEnabled option.


setBufferClassName

public void setBufferClassName(String bufferClassName)

Parameters:
bufferClassName - The bufferClassName to set.


setBufferSize

public void setBufferSize(int bufferSize)
            throws LogConfigurationException

Parameters:
bufferSize - The size of a log buffer specified as a number of 1024 byte blocks.

The value specified by bufferSize is multiplied by 1024 to establish the actual buffer size used by the logger.


setChecksumEnabled

public void setChecksumEnabled(boolean checksumOption)

Parameters:
checksumOption - The checksumOption to set.


setFlushSleepTime

public void setFlushSleepTime(int flushSleepTime)

Parameters:
flushSleepTime - The amount of time (specified in milli-seconds) the FlushManager should sleep.


setLogFileDir

public void setLogFileDir(String logFileDir)

Parameters:
logFileDir - The logFileDir to set.


setLogFileExt

public void setLogFileExt(String logFileExt)

Parameters:
logFileExt - The logFileExt to set.


setLogFileMode

public void setLogFileMode(String logFileMode)
            throws LogConfigurationException

Parameters:
logFileMode - The logFileMode to set.


setLogFileName

public void setLogFileName(String logFileName)

Parameters:
logFileName - The logFileName to set.


setMaxBlocksPerFile

public void setMaxBlocksPerFile(int maxBlocksPerFile)

Parameters:
maxBlocksPerFile - The maxBlocksPerFile to set.


setMaxBuffers

public void setMaxBuffers(int maxBuffers)
            throws LogConfigurationException

Parameters:
maxBuffers - The maxBuffers to set.


setMaxLogFiles

public void setMaxLogFiles(int maxLogFiles)

Parameters:
maxLogFiles - The maxLogFiles to set.


setMinBuffers

public void setMinBuffers(int minBuffers)
            throws LogConfigurationException

Parameters:
minBuffers - The minBuffers to set.


setThreadsWaitingForceThreshold

public void setThreadsWaitingForceThreshold(int threadsWaitingForceThreshold)

Parameters:
threadsWaitingForceThreshold - The threadsWaitingForceThreshold to set.


store

public void store(OutputStream out)
            throws IOException
Stores configuration properties to OutputStream.

See Also:
java.util.Properties.store(java.io.OutputStream, java.lang.String)