Package org.jmxtrans.agent
Class FileOverwriterOutputWriter
java.lang.Object
org.jmxtrans.agent.AbstractOutputWriter
org.jmxtrans.agent.FileOverwriterOutputWriter
- All Implemented Interfaces:
OutputWriter
public class FileOverwriterOutputWriter extends AbstractOutputWriter
- Author:
- Cyrille Le Clerc
-
Field Summary
Fields Modifier and Type Field Description protected java.io.Filefilestatic java.lang.StringSETTING_FILE_NAMEstatic java.lang.StringSETTING_FILE_NAME_DEFAULT_VALUEstatic java.lang.StringSETTING_SHOW_TIMESTAMPstatic java.lang.BooleanSETTING_SHOW_TIMESTAMP_DEFAULTprotected java.lang.BooleanshowTimeStampprotected java.io.FiletemporaryFileprotected java.io.WritertemporaryFileWriterFields inherited from class org.jmxtrans.agent.AbstractOutputWriter
logger, SETTING_LOG_LEVEL, SETTING_LOG_LEVEL_DEFAULT_VALUE -
Constructor Summary
Constructors Constructor Description FileOverwriterOutputWriter() -
Method Summary
Modifier and Type Method Description protected java.io.WritergetTemporaryFileWriter()voidpostCollect()called after a serie of writes, typically at the end of a collection.voidpostConstruct(java.util.Map<java.lang.String,java.lang.String> settings)protected voidreleaseTemporaryWriter()voidwriteInvocationResult(java.lang.String invocationName, java.lang.Object value)voidwriteQueryResult(java.lang.String name, java.lang.String type, java.lang.Object value)Methods inherited from class org.jmxtrans.agent.AbstractOutputWriter
getDebugLevel, getInfoLevel, getTraceLevel, preCollect, preDestroyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
SETTING_FILE_NAME
public static final java.lang.String SETTING_FILE_NAME- See Also:
- Constant Field Values
-
SETTING_FILE_NAME_DEFAULT_VALUE
public static final java.lang.String SETTING_FILE_NAME_DEFAULT_VALUE- See Also:
- Constant Field Values
-
SETTING_SHOW_TIMESTAMP
public static final java.lang.String SETTING_SHOW_TIMESTAMP- See Also:
- Constant Field Values
-
SETTING_SHOW_TIMESTAMP_DEFAULT
public static final java.lang.Boolean SETTING_SHOW_TIMESTAMP_DEFAULT -
temporaryFileWriter
protected java.io.Writer temporaryFileWriter -
temporaryFile
protected java.io.File temporaryFile -
file
protected java.io.File file -
showTimeStamp
protected java.lang.Boolean showTimeStamp
-
-
Constructor Details
-
FileOverwriterOutputWriter
public FileOverwriterOutputWriter()
-
-
Method Details
-
postConstruct
public void postConstruct(java.util.Map<java.lang.String,java.lang.String> settings)- Specified by:
postConstructin interfaceOutputWriter- Overrides:
postConstructin classAbstractOutputWriter
-
getTemporaryFileWriter
protected java.io.Writer getTemporaryFileWriter() throws java.io.IOException- Throws:
java.io.IOException
-
writeInvocationResult
public void writeInvocationResult(java.lang.String invocationName, java.lang.Object value) throws java.io.IOException- Specified by:
writeInvocationResultin interfaceOutputWriter- Specified by:
writeInvocationResultin classAbstractOutputWriter- Throws:
java.io.IOException
-
writeQueryResult
public void writeQueryResult(@Nonnull java.lang.String name, @Nullable java.lang.String type, @Nullable java.lang.Object value) throws java.io.IOException- Specified by:
writeQueryResultin interfaceOutputWriter- Specified by:
writeQueryResultin classAbstractOutputWritertype- seeQuery.type- Throws:
java.io.IOException
-
releaseTemporaryWriter
protected void releaseTemporaryWriter() -
postCollect
public void postCollect() throws java.io.IOExceptionDescription copied from interface:OutputWritercalled after a serie of writes, typically at the end of a collection.
Useful with batch writers.
- Specified by:
postCollectin interfaceOutputWriter- Overrides:
postCollectin classAbstractOutputWriter- Throws:
java.io.IOException
-