/** * Construct a handler. * * @param handler The handler to copy properties from. * @param formatter The formatter to use. * @throws UnsupportedEncodingException if the encoding is not valid. */ public Stdout(final Handler handler, final Formatter formatter) throws UnsupportedEncodingException { super(System.out, formatter); setErrorManager(handler.getErrorManager()); setFilter(handler.getFilter()); setLevel(handler.getLevel()); setEncoding(handler.getEncoding()); }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (final RuntimeException ignore) { em = null; } catch (final LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * {@inheritDoc} */ public ErrorManager getErrorManager() { return handler.getErrorManager(); }
/** * {@inheritDoc} */ public ErrorManager getErrorManager() { return handler.getErrorManager(); }
/** * {@inheritDoc} */ public ErrorManager getErrorManager() { return handler.getErrorManager(); }
public ErrorManager getErrorManager(T handler) { return handler.getErrorManager(); }
@Override public ErrorManager getErrorManager() { return this.delegate != null ? this.delegate.getErrorManager() : null; }
/** * {@inheritDoc} */ public void reportError(String msg, Exception ex, int code) { // NOTE: we can't call report error on the handler directly // because it has protected access, so we emulate the code in // Hander.java directly here, including the catch block try { handler.getErrorManager().error(msg, ex, code); } catch (Exception ex2) { System.err.println("TransactionalHandler.reportError() caught:"); ex2.printStackTrace(); } }
/** * {@inheritDoc} */ public void reportError(String msg, Exception ex, int code) { // NOTE: we can't call report error on the handler directly // because it has protected access, so we emulate the code in // Hander.java directly here, including the catch block try { handler.getErrorManager().error(msg, ex, code); } catch (Exception ex2) { System.err.println("TransactionalHandler.reportError() caught:"); ex2.printStackTrace(); } }
/** * {@inheritDoc} */ public void reportError(String msg, Exception ex, int code) { // NOTE: we can't call report error on the handler directly // because it has protected access, so we emulate the code in // Hander.java directly here, including the catch block try { handler.getErrorManager().error(msg, ex, code); } catch (Exception ex2) { System.err.println("TransactionalHandler.reportError() caught:"); ex2.printStackTrace(); } }
@Nullable @Override public ErrorManager getErrorManager() { return this.delegate != null ? this.delegate.getErrorManager() : null; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
return (Number) f.get(out); } catch (ReflectiveOperationException roe) { h.getErrorManager().error(null, roe, ErrorManager.FORMAT_FAILURE);
h.setFilter(null); h.setFormatter(getFormatter()); h.setErrorManager(getErrorManager()); h.publish(r); } finally {
h.setFilter(getFilter()); h.setFormatter(getFormatter()); h.setErrorManager(getErrorManager()); h.publish(r); } finally {
/** * Constructs a handler. * * @param handler The handler to copy properties from. * @param formatter The formatter to use. */ public Stdout(final Handler handler, final Formatter formatter) throws UnsupportedEncodingException { super(System.out, formatter); setErrorManager(handler.getErrorManager()); setFilter (handler.getFilter ()); setLevel (handler.getLevel ()); setEncoding (handler.getEncoding ()); }