Interface LoadErrorHandler


  • public interface LoadErrorHandler
    Interface for error handling strategies in service class loading. You can implement this interface for a custom error handling mechanism, or use one of the predefined strategies.
    Since:
    Apache Tika 0.9
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static LoadErrorHandler IGNORE
      Strategy that simply ignores all problems.
      static LoadErrorHandler THROW
      Strategy that throws a RuntimeException with the given throwable as the root cause, thus interrupting the entire service loading operation.
      static LoadErrorHandler WARN
      Strategy that logs warnings of all problems using a Logger created using the given class name.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void handleLoadError​(java.lang.String classname, java.lang.Throwable throwable)
      Handles a problem encountered when trying to load the specified service class.
    • Field Detail

      • IGNORE

        static final LoadErrorHandler IGNORE
        Strategy that simply ignores all problems.
      • WARN

        static final LoadErrorHandler WARN
        Strategy that logs warnings of all problems using a Logger created using the given class name.
      • THROW

        static final LoadErrorHandler THROW
        Strategy that throws a RuntimeException with the given throwable as the root cause, thus interrupting the entire service loading operation.
    • Method Detail

      • handleLoadError

        void handleLoadError​(java.lang.String classname,
                             java.lang.Throwable throwable)
        Handles a problem encountered when trying to load the specified service class. The implementation can log or otherwise process the given error information. If the method returns normally, then the service loader simply skips this class and continues with the next one.
        Parameters:
        classname - name of the service class
        throwable - the encountered problem