|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.commons.log.AbstractLogEnabled
com.genesyslab.platform.logging.DefaultFileHeaderProvider
public class DefaultFileHeaderProvider
The default implementation of FileHeaderProvider.
Constructor Summary | |
---|---|
|
DefaultFileHeaderProvider()
Default constructor. |
protected |
DefaultFileHeaderProvider(DefaultFileHeaderProvider arg)
Copy constructor. |
|
DefaultFileHeaderProvider(java.lang.String theApplicationName,
java.lang.String theApplicationHost,
int theApplicationId,
int theApplicationType,
ILogger logger)
Constructor. |
Method Summary | |
---|---|
void |
applyConfiguration(LogConfiguration configuration)
This method is called on the copy of class, during the procedure of configuring logger. |
DefaultFileHeaderProvider |
clone()
Creates a new object that is a copy of the current instance. |
protected java.lang.String |
formatElapsedTime(long milliSeconds)
|
protected java.lang.String |
formatElapsedTime2(long milliSeconds)
|
protected void |
formatHeader(java.lang.StringBuilder targetBuilder,
java.lang.String fileName)
This method is called from GetFileHeader method. |
protected java.lang.String |
getApplicationHost()
The Application Host to be used in the file header. |
protected int |
getApplicationId()
The Application Id to be used in the file header. |
protected java.lang.String |
getApplicationName()
The Application Name to be used in the file header. |
protected int |
getApplicationType()
The Application Type to be used in the file header. |
java.lang.String |
getFileHeader(java.lang.String fileName)
This method is called for obtaining the log file header. |
protected java.lang.String |
getSystemPropery(java.lang.String propertyName)
|
protected void |
onEnableLogging(ILogger logger)
Overrides AbstractLogEnabled.onEnableLogging . |
protected void |
setApplicationHost(java.lang.String name)
|
protected void |
setApplicationId(int id)
|
protected void |
setApplicationName(java.lang.String name)
|
protected void |
setApplicationType(int type)
|
protected void |
writeAssemblyUseInfo(java.lang.StringBuilder targetBuilder,
java.lang.String lineFormat)
This method is used for writing version info about loaded PSDK jars to file header. |
protected void |
writeMemorySection(java.lang.StringBuilder targetBuilder,
java.lang.String lineFormat)
This method writes the section to StringBuilder which appends the strings
which describe Memory Usage. |
protected void |
writeProcessTimeSection(java.lang.StringBuilder targetBuilder,
java.lang.String lineFormat)
This method writes the section to StringBuilder
which appends the strings which describe Process Start Time and Process
Run Time. |
Methods inherited from class com.genesyslab.platform.commons.log.AbstractLogEnabled |
---|
enableLogging, getLogger |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFileHeaderProvider()
NullLogger
.
public DefaultFileHeaderProvider(java.lang.String theApplicationName, java.lang.String theApplicationHost, int theApplicationId, int theApplicationType, ILogger logger)
theApplicationName
- The Application Name to be used in file headertheApplicationHost
- The Application Host to be used in file headertheApplicationId
- The Application Id to be used in file headertheApplicationType
- The Application Id to be used in file headerlogger
- Internal logger. Used for initialization of
AbstractLogEnabled.Loggerprotected DefaultFileHeaderProvider(DefaultFileHeaderProvider arg)
arg
- argument to copyMethod Detail |
---|
protected java.lang.String getApplicationName()
protected void setApplicationName(java.lang.String name)
protected java.lang.String getApplicationHost()
protected void setApplicationHost(java.lang.String name)
protected int getApplicationType()
protected void setApplicationType(int type)
protected int getApplicationId()
protected void setApplicationId(int id)
protected void onEnableLogging(ILogger logger)
AbstractLogEnabled.onEnableLogging
.
onEnableLogging
in class AbstractLogEnabled
logger
- ILogger
to be usedpublic DefaultFileHeaderProvider clone()
clone
in interface FileHeaderProvider
clone
in class java.lang.Object
Cloneable
public void applyConfiguration(LogConfiguration configuration)
applyConfiguration
in interface FileHeaderProvider
configuration
- The configuration to applypublic java.lang.String getFileHeader(java.lang.String fileName)
getFileHeader
in interface FileHeaderProvider
fileName
- The name of file to be written
protected void formatHeader(java.lang.StringBuilder targetBuilder, java.lang.String fileName)
GetFileHeader
method.
The default implementation writes the standard log file header. This
method relies on WriteProcessTimeSection
and WriteMemorySection
for filling such
properties as Memory Usage, Process Start Time and Process Run time.
targetBuilder
- The StringBuilder
where all info is
being appended. The result header will be
targetBuilder.toString() value.fileName
- The name of file the header for which is being constructed.protected void writeAssemblyUseInfo(java.lang.StringBuilder targetBuilder, java.lang.String lineFormat)
targetBuilder
- The target StringBuilder
lineFormat
- The proposed formatting line. Current version: "{0,-35}{1}"protected void writeProcessTimeSection(java.lang.StringBuilder targetBuilder, java.lang.String lineFormat)
StringBuilder
which appends the strings which describe Process Start Time and Process
Run Time. This method calls the code which requires the calling code to
have FullTrust permission. If this is unacceptable - override this method
in derived class.
targetBuilder
- The target StringBuilder
lineFormat
- the proposed format for line being appended. This line is
supposed to contain 2 parts: header (index - 0) and body
(index - 1).protected void writeMemorySection(java.lang.StringBuilder targetBuilder, java.lang.String lineFormat)
StringBuilder
which appends the strings
which describe Memory Usage. This method calls the code which requires
the calling code to have FullTrust permission. If this is unacceptable -
override this method in derived class.
targetBuilder
- The target StringBuilder
lineFormat
- the proposed format for line being appended. This line is
supposed to contain 2 parts: header (index - 0) and body
(index - 1).protected java.lang.String getSystemPropery(java.lang.String propertyName)
protected java.lang.String formatElapsedTime(long milliSeconds)
protected java.lang.String formatElapsedTime2(long milliSeconds)
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |