org.apache.sis.util.logging.Logging.recoverableException()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中org.apache.sis.util.logging.Logging.recoverableException()方法的一些代码示例,展示了Logging.recoverableException()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logging.recoverableException()方法的具体详情如下:
包路径:org.apache.sis.util.logging.Logging
类名称:Logging
方法名:recoverableException

Logging.recoverableException介绍

[英]Invoked when a recoverable error occurred. This method is similar to #unexpectedException(Logger,Class,String,Throwable)except that it does not log the stack trace and uses a lower logging level.
[中]发生可恢复错误时调用。此方法与#unexpectedException(Logger、Class、String、Throwable)类似,只是它不记录堆栈跟踪并使用较低的记录级别。

代码示例

代码示例来源:origin: org.apache.sis.core/sis-referencing

/**
   * Logs a warning about a failure to compute the Bursa-Wolf parameters.
   */
  private static void log(final String logger, final String method, final Exception e) {
    Logging.recoverableException(Logging.getLogger(logger), GeocentricAffine.class, method, e);
  }
}

代码示例来源:origin: apache/sis

/**
 * Logs a warning for a non-critical error. The callers should have a fallback.
 */
private static void warning(final String method, final Exception e) {
  Logging.recoverableException(Logging.getLogger(Modules.REFERENCING), IdentifiedObjects.class, method, e);
}

代码示例来源:origin: apache/sis

/**
   * Invoked for reporting exceptions that may be normal behavior. This method logs
   * the exception at {@link java.util.logging.Level#FINE} without stack trace.
   */
  private static void recoverableException(final Exception warning) {
    Logging.recoverableException(Logging.getLogger(Modules.STORAGE), ChannelFactory.class, "prepare", warning);
  }
}

代码示例来源:origin: org.apache.sis.core/sis-referencing

/**
 * Logs a warning for a non-critical error. The callers should have a fallback.
 */
private static void warning(final String method, final Exception e) {
  Logging.recoverableException(Logging.getLogger(Modules.REFERENCING), IdentifiedObjects.class, method, e);
}

代码示例来源:origin: org.apache.sis.core/sis-referencing

/**
 * Invoked when a recoverable exception occurred. Those exceptions must be minor enough
 * that they can be silently ignored in most cases.
 */
static void recoverableException(final Class<? extends Static> caller, final TransformException exception) {
  Logging.recoverableException(Logging.getLogger(Loggers.GEOMETRY), caller, "transform", exception);
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
   * Logs a recoverable exception that happened (directly or indirectly) in the {@link #configuration()} method.
   */
  private static void recoverableException(final String logger, final Exception e) {
    Logging.recoverableException(Logging.getLogger(logger), About.class, "configuration", e);
  }
}

代码示例来源:origin: org.apache.sis.storage/sis-storage

/**
   * Invoked for reporting exceptions that may be normal behavior. This method logs
   * the exception at {@link java.util.logging.Level#FINE} without stack trace.
   */
  private static void recoverableException(final Exception warning) {
    Logging.recoverableException(Logging.getLogger(Modules.STORAGE), ChannelFactory.class, "prepare", warning);
  }
}

代码示例来源:origin: apache/sis

/**
   * Reports the given exception as an ignorable one. We consider {@link FactoryException} or
   * {@link TransformException} as ignorable exceptions only if they occurred while computing
   * whether a point is inside the domain of validity. Failure to answer that question is
   * considered as an indication that the point is outside the domain of validity.
   */
  private static void warning(final Exception e) {
    Logging.recoverableException(Logging.getLogger("org.apache.sis.console"), TransformCommand.class, "run", e);
  }
}

代码示例来源:origin: apache/sis

/**
 * Invoked when a recoverable exception occurred. Those exceptions must be minor enough
 * that they can be silently ignored in most cases.
 *
 * @param  exception  the exception that occurred.
 */
static void recoverableException(final Exception exception) {
  Logging.recoverableException(Logging.getLogger(Modules.RASTER), GridGeometry.class, "<init>", exception);
}

代码示例来源:origin: apache/sis

/**
   * Logs a recoverable exception that happened (directly or indirectly) in the {@link #configuration()} method.
   */
  private static void recoverableException(final String logger, final Exception e) {
    Logging.recoverableException(Logging.getLogger(logger), About.class, "configuration", e);
  }
}

代码示例来源:origin: apache/sis

/**
   * Logs a warning about a failure to compute the Bursa-Wolf parameters.
   */
  private static void log(final String logger, final String method, final Exception e) {
    Logging.recoverableException(Logging.getLogger(logger), GeocentricAffine.class, method, e);
  }
}

代码示例来源:origin: Geomatys/geotoolkit

public GMLOrDefaultFactory() {
  TemporalFactory delegate;
  try {
    delegate = (TemporalFactory) Class.forName("org.geotoolkit.gml.GMLTemporalFactory").newInstance();
  } catch (Exception e) {
    Logging.recoverableException(null, GMLOrDefaultFactory.class, "<init>", e);
    delegate = new DefaultTemporalFactory();
  }
  this.delegate = delegate;
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Logs a warning about an exception that can be safely ignored.
 */
final void warning(final String method, final RuntimeException e) {
  Logging.recoverableException(Logging.getLogger(Loggers.MATH), Vector.class, method, e);
}

代码示例来源:origin: apache/sis

/**
 * Invoked when a recoverable exception occurred. Those exceptions must be minor enough
 * that they can be silently ignored in most cases.
 */
static void recoverableException(final Class<? extends Static> caller, final TransformException exception) {
  Logging.recoverableException(Logging.getLogger(Loggers.GEOMETRY), caller, "transform", exception);
}

代码示例来源:origin: apache/sis

/**
 * Logs a warning about an exception that can be safely ignored.
 */
final void warning(final String method, final RuntimeException e) {
  Logging.recoverableException(Logging.getLogger(Loggers.MATH), Vector.class, method, e);
}

代码示例来源:origin: Geomatys/geotoolkit

/**
 * Implementation of {@link #before(String, boolean)} and {@link #after(String, boolean)}.
 * The {@code before} boolean argument tells which method is invoking this one.
 */
private void setOrdering(final String type, final boolean subclasses, final boolean before) {
  final Class<?> c;
  try {
    c = Class.forName(type);
  } catch (ClassNotFoundException e) {
    Logging.recoverableException(null, Organizer.class, before ? "before" : "after", e);
    return;
  }
  setOrdering(c, subclasses, before);
}

代码示例来源:origin: org.apache.sis.core/sis-referencing

/**
 * Rewrites the given code in a canonical format.
 * If the code can not be reformatted, then this method returns {@code null}.
 */
static String reformat(final String code) {
  try {
    return format(Integer.parseInt(code.substring(skipNamespace(code) & ~LEGACY_MASK)));
  } catch (NoSuchAuthorityCodeException | NumberFormatException e) {
    Logging.recoverableException(Logging.getLogger(Loggers.CRS_FACTORY), CommonAuthorityFactory.class, "reformat", e);
    return null;
  }
}

代码示例来源:origin: apache/sis

/**
 * Rewrites the given code in a canonical format.
 * If the code can not be reformatted, then this method returns {@code null}.
 */
static String reformat(final String code) {
  try {
    return format(Integer.parseInt(code.substring(skipNamespace(code) & ~LEGACY_MASK)));
  } catch (NoSuchAuthorityCodeException | NumberFormatException e) {
    Logging.recoverableException(Logging.getLogger(Loggers.CRS_FACTORY), CommonAuthorityFactory.class, "reformat", e);
    return null;
  }
}

代码示例来源:origin: apache/sis

/**
 * Returns the description for the given locale, or fallback on a default description
 * if no resources exist for that locale.
 */
@Override
public final String toString(final Locale locale) {
  try {
    return super.toString(locale);
  } catch (MissingResourceException e) {
    Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), ResourceInternationalString.class, "toString", e);
    return fallback();
  }
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Returns the description for the given locale, or fallback on a default description
 * if no resources exist for that locale.
 */
@Override
public final String toString(final Locale locale) {
  try {
    return super.toString(locale);
  } catch (MissingResourceException e) {
    Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), ResourceInternationalString.class, "toString", e);
    return fallback();
  }
}

相关文章