/** * Consult the classifier and find a delegate policy, and then use that to * determine the outcome. * * @param t the throwable to consider * @param skipCount the current skip count * @return true if the exception can be skipped * @throws SkipLimitExceededException if a limit is exceeded */ @Override public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException { return classifier.classify(t).shouldSkip(t, skipCount); }
@Override public Boolean classify(Throwable classifiable) { Boolean classified = super.classify(classifiable); if (!this.traverseCauses) { return classified; } /* * If the result is the default, we need to find out if it was by default * or so configured; if default, try the cause(es). */ if (classified.equals(this.getDefault())) { Throwable cause = classifiable; do { if (this.getClassified().containsKey(cause.getClass())) { return classified; // non-default classification } cause = cause.getCause(); classified = super.classify(cause); } while (cause != null && classified.equals(this.getDefault())); } return classified; }
private Object getPolicy(String stepName, ApplicationContext ctx, String componentName) throws Exception { @SuppressWarnings("unchecked") SubclassClassifier<Throwable, Object> classifier = (SubclassClassifier<Throwable, Object>) getNestedPathInStep( stepName, ctx, componentName); Object policy = classifier.classify(new Exception()); return policy; }
/** * Consult the classifier and find a delegate policy, and then use that to * determine the outcome. * * @param t the throwable to consider * @param skipCount the current skip count * @return true if the exception can be skipped * @throws SkipLimitExceededException if a limit is exceeded */ @Override public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException { return classifier.classify(t).shouldSkip(t, skipCount); }
/** * Consult the classifier and find a delegate policy, and then use that to * determine the outcome. * * @param t the throwable to consider * @param skipCount the current skip count * @return true if the exception can be skipped * @throws SkipLimitExceededException if a limit is exceeded */ @Override public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException { return classifier.classify(t).shouldSkip(t, skipCount); }
/** * Consult the classifier and find a delegate policy, and then use that to * determine the outcome. * * @param t the throwable to consider * @param skipCount the current skip count * @return true if the exception can be skipped * @throws SkipLimitExceededException if a limit is exceeded */ @Override public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException { return classifier.classify(t).shouldSkip(t, skipCount); }
@Override public Boolean classify(Throwable classifiable) { Boolean classified = super.classify(classifiable); if (!this.traverseCauses) { return classified; } /* * If the result is the default, we need to find out if it was by default * or so configured; if default, try the cause(es). */ if (classified.equals(this.getDefault())) { Throwable cause = classifiable; do { if (this.getClassified().containsKey(cause.getClass())) { return classified; // non-default classification } cause = cause.getCause(); classified = super.classify(cause); } while (cause != null && classified.equals(this.getDefault())); } return classified; }