Class RollingFileOutputWriter

java.lang.Object
org.jmxtrans.agent.AbstractOutputWriter
org.jmxtrans.agent.RollingFileOutputWriter
All Implemented Interfaces:
OutputWriter

public class RollingFileOutputWriter
extends AbstractOutputWriter
  • 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_MAX_FILE_SIZE

      public static final java.lang.String SETTING_MAX_FILE_SIZE
      See Also:
      Constant Field Values
    • SETTING_MAX_FILE_SIZE_DEFAULT_VALUE

      public static final long SETTING_MAX_FILE_SIZE_DEFAULT_VALUE
      See Also:
      Constant Field Values
    • SETTING_MAX_BACKUP_INDEX

      public static final java.lang.String SETTING_MAX_BACKUP_INDEX
      See Also:
      Constant Field Values
    • SETTING_MAX_BACKUP_INDEX_DEFAULT_VALUE

      public static final int SETTING_MAX_BACKUP_INDEX_DEFAULT_VALUE
      See Also:
      Constant Field Values
    • SETTING_SINGLE_LINE

      public static final java.lang.String SETTING_SINGLE_LINE
      See Also:
      Constant Field Values
    • SETTING_SINGLE_LINE_DEFAULT_VALUE

      public static final boolean SETTING_SINGLE_LINE_DEFAULT_VALUE
      See Also:
      Constant Field Values
    • temporaryFileWriter

      protected java.io.Writer temporaryFileWriter
    • temporaryFile

      protected java.io.File temporaryFile
    • file

      protected java.io.File file
    • maxFileSize

      protected long maxFileSize
    • maxBackupIndex

      protected int maxBackupIndex
    • singleLine

      protected boolean singleLine
    • firstResult

      protected boolean firstResult
  • Constructor Details

    • RollingFileOutputWriter

      public RollingFileOutputWriter()
  • Method Details

    • postConstruct

      public void postConstruct​(java.util.Map<java.lang.String,​java.lang.String> settings)
      Specified by:
      postConstruct in interface OutputWriter
      Overrides:
      postConstruct in class AbstractOutputWriter
    • 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:
      writeInvocationResult in interface OutputWriter
      Specified by:
      writeInvocationResult in class AbstractOutputWriter
      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:
      writeQueryResult in interface OutputWriter
      Specified by:
      writeQueryResult in class AbstractOutputWriter
      type - see Query.type
      Throws:
      java.io.IOException
    • releaseTemporaryWriter

      protected void releaseTemporaryWriter()
    • preCollect

      public void preCollect() throws java.io.IOException
      Description copied from interface: OutputWriter
      Called before metrics collection starts
      Specified by:
      preCollect in interface OutputWriter
      Overrides:
      preCollect in class AbstractOutputWriter
      Throws:
      java.io.IOException
    • postCollect

      public void postCollect() throws java.io.IOException
      Description copied from interface: OutputWriter

      called after a serie of writes, typically at the end of a collection.

      Useful with batch writers.

      Specified by:
      postCollect in interface OutputWriter
      Overrides:
      postCollect in class AbstractOutputWriter
      Throws:
      java.io.IOException