Platform SDK Java 8.5 API Reference

com.genesyslab.platform.apptemplate.log4j2plugin
Class DefaultFileHeaderProvider

java.lang.Object
  extended by com.genesyslab.platform.apptemplate.log4j2plugin.DefaultFileHeaderProvider
All Implemented Interfaces:
FileHeaderProvider, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
GFileHeaderProvider

public class DefaultFileHeaderProvider
extends java.lang.Object
implements FileHeaderProvider

The default implementation of FileHeaderProvider.

See Also:
Serialized Form

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

isoDateFormat

protected static final java.text.SimpleDateFormat isoDateFormat

isoDateFormatUtc

protected static final java.text.SimpleDateFormat isoDateFormatUtc
Constructor Detail

DefaultFileHeaderProvider

public DefaultFileHeaderProvider()
Method Detail

getApplicationName

public java.lang.String getApplicationName()
The Application Name to be used in the file header.

Specified by:
getApplicationName in interface FileHeaderProvider

setApplicationName

protected void setApplicationName(java.lang.String name)

getApplicationHost

public java.lang.String getApplicationHost()
The Application Host to be used in the file header.

Specified by:
getApplicationHost in interface FileHeaderProvider

setApplicationHost

protected void setApplicationHost(java.lang.String name)

getApplicationType

public java.lang.String getApplicationType()
The Application Type to be used in the file header.

Specified by:
getApplicationType in interface FileHeaderProvider

setApplicationType

protected void setApplicationType(java.lang.String type)

getApplicationId

public java.lang.String getApplicationId()
The Application Id to be used in the file header.

Specified by:
getApplicationId in interface FileHeaderProvider

setApplicationId

protected void setApplicationId(java.lang.String id)

getCommandLine

public java.lang.String getCommandLine()
The Application Command Line value to be used in the file header.

Specified by:
getCommandLine in interface FileHeaderProvider

setCommandLine

protected void setCommandLine(java.lang.String cmdLine)

getFileName

public java.lang.String getFileName()
Gets the FileName attribute of the header.


setFileName

public void setFileName(java.lang.String fileName)
Sets the FileName attribute of the header.

Specified by:
setFileName in interface FileHeaderProvider
Parameters:
fileName - the file name attribute value.

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface: FileHeaderProvider
Sets custom application properties.

Specified by:
setProperties in interface FileHeaderProvider
Parameters:
properties - the application properties.

clone

public DefaultFileHeaderProvider clone()
Creates a new object that is a copy of the current instance.

Specified by:
clone in interface FileHeaderProvider
Overrides:
clone in class java.lang.Object
Returns:
A new object that is a copy of this instance.
See Also:
Cloneable

getFileHeader

public java.lang.String getFileHeader()
This method is called for obtaining the log file header.

Specified by:
getFileHeader in interface FileHeaderProvider
Returns:
The string which will be used as header for the log file or segment.

formatHeader

protected void formatHeader(java.lang.StringBuilder targetBuilder,
                            java.lang.String fileName)
This method is called from 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.

Parameters:
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.

writeAssemblyUseInfo

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. Override this method to change its behavior.

Parameters:
targetBuilder - The target StringBuilder.
lineFormat - The proposed formatting line. Current version: "%-35s %s".

writeProcessTimeSection

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. This method calls the code which requires the calling code to have FullTrust permission. If this is unacceptable - override this method in derived class.

Parameters:
targetBuilder - The target StringBuilder.
lineFormat - The proposed formatting line. Current version: "%-35s %s".

writeMemorySection

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. This method calls the code which requires the calling code to have FullTrust permission. If this is unacceptable - override this method in derived class.

Parameters:
targetBuilder - The target StringBuilder.
lineFormat - The proposed formatting line. Current version: "%-35s %s".

getSystemPropery

protected java.lang.String getSystemPropery(java.lang.String propertyName)

formatElapsedTime

protected java.lang.String formatElapsedTime(long milliSeconds)

formatElapsedTime2

protected java.lang.String formatElapsedTime2(long milliSeconds)

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.