|
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.apptemplate.log4j2plugin.DefaultFileHeaderProvider
public class DefaultFileHeaderProvider
The default implementation of FileHeaderProvider.
Field Summary | |
---|---|
protected static java.text.SimpleDateFormat |
isoDateFormat
|
protected static java.text.SimpleDateFormat |
isoDateFormatUtc
|
Constructor Summary | |
---|---|
DefaultFileHeaderProvider()
|
Method Summary | |
---|---|
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. |
java.lang.String |
getApplicationHost()
The Application Host to be used in the file header. |
java.lang.String |
getApplicationId()
The Application Id to be used in the file header. |
java.lang.String |
getApplicationName()
The Application Name to be used in the file header. |
java.lang.String |
getApplicationType()
The Application Type to be used in the file header. |
java.lang.String |
getCommandLine()
The Application Command Line value to be used in the file header. |
java.lang.String |
getFileHeader()
This method is called for obtaining the log file header. |
java.lang.String |
getFileName()
Gets the FileName attribute of the header. |
protected java.lang.String |
getSystemPropery(java.lang.String propertyName)
|
protected void |
setApplicationHost(java.lang.String name)
|
protected void |
setApplicationId(java.lang.String id)
|
protected void |
setApplicationName(java.lang.String name)
|
protected void |
setApplicationType(java.lang.String type)
|
protected void |
setCommandLine(java.lang.String cmdLine)
|
void |
setFileName(java.lang.String fileName)
Sets the FileName attribute of the header. |
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Sets custom application properties. |
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 java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.text.SimpleDateFormat isoDateFormat
protected static final java.text.SimpleDateFormat isoDateFormatUtc
Constructor Detail |
---|
public DefaultFileHeaderProvider()
Method Detail |
---|
public java.lang.String getApplicationName()
getApplicationName
in interface FileHeaderProvider
protected void setApplicationName(java.lang.String name)
public java.lang.String getApplicationHost()
getApplicationHost
in interface FileHeaderProvider
protected void setApplicationHost(java.lang.String name)
public java.lang.String getApplicationType()
getApplicationType
in interface FileHeaderProvider
protected void setApplicationType(java.lang.String type)
public java.lang.String getApplicationId()
getApplicationId
in interface FileHeaderProvider
protected void setApplicationId(java.lang.String id)
public java.lang.String getCommandLine()
getCommandLine
in interface FileHeaderProvider
protected void setCommandLine(java.lang.String cmdLine)
public java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
setFileName
in interface FileHeaderProvider
fileName
- the file name attribute value.public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
FileHeaderProvider
setProperties
in interface FileHeaderProvider
properties
- the application properties.public DefaultFileHeaderProvider clone()
clone
in interface FileHeaderProvider
clone
in class java.lang.Object
Cloneable
public java.lang.String getFileHeader()
getFileHeader
in interface FileHeaderProvider
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: "%-35s %s
".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 formatting line. Current version: "%-35s %s
".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 formatting line. Current version: "%-35s %s
".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 |