Class ComponentBase

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int ERROR_COUNT_LIMIT
      Error count limit.
      private int errorCount
      Error count.
      private ULogger logger
      Logger.
      protected org.apache.log4j.spi.LoggerRepository repository
      Logger repository.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ComponentBase()
      Construct a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ULogger getLogger()
      Return an instance specific logger to be used by the component itself.
      protected org.apache.log4j.spi.LoggerRepository getLoggerRepository()
      Return the LoggerRepository to which this component is attached.
      protected ULogger getNonFloodingLogger()
      Frequently called methods in log4j components can invoke this method in order to avoid flooding the output when logging lasting error conditions.
      protected void resetErrorCount()
      Called by derived classes when they deem that the component has recovered from an erroneous state.
      void setLoggerRepository​(org.apache.log4j.spi.LoggerRepository repository)
      Set the owning repository.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ERROR_COUNT_LIMIT

        private static final int ERROR_COUNT_LIMIT
        Error count limit.
        See Also:
        Constant Field Values
      • repository

        protected org.apache.log4j.spi.LoggerRepository repository
        Logger repository.
      • logger

        private ULogger logger
        Logger.
      • errorCount

        private int errorCount
        Error count.
    • Constructor Detail

      • ComponentBase

        protected ComponentBase()
        Construct a new instance.
    • Method Detail

      • resetErrorCount

        protected void resetErrorCount()
        Called by derived classes when they deem that the component has recovered from an erroneous state.
      • setLoggerRepository

        public void setLoggerRepository​(org.apache.log4j.spi.LoggerRepository repository)
        Set the owning repository. The owning repository cannot be set more than once.
        Specified by:
        setLoggerRepository in interface Component
        Parameters:
        repository - repository
      • getLoggerRepository

        protected org.apache.log4j.spi.LoggerRepository getLoggerRepository()
        Return the LoggerRepository to which this component is attached.
        Returns:
        Owning LoggerRepository
      • getLogger

        protected ULogger getLogger()
        Return an instance specific logger to be used by the component itself. This logger is not intended to be accessed by the end-user, hence the protected keyword.

        In case the repository for this component is not set, this implementations returns a SimpleULogger instance.

        Returns:
        A ULogger instance.
      • getNonFloodingLogger

        protected ULogger getNonFloodingLogger()
        Frequently called methods in log4j components can invoke this method in order to avoid flooding the output when logging lasting error conditions.
        Returns:
        a regular logger, or a NOPLogger if called too frequently.