public String getDetailedMessage () { StringBuffer sb = new StringBuffer (getMessage()); if (detail != null) { sb.append (" ("); sb.append (detail); sb.append (')'); } return sb.toString(); } public void dump (PrintStream p, String indent) {
public void dump (PrintStream p, String indent) { String inner = indent + " "; p.println (indent + "<bl-exception>"); p.println (inner + "<message>" + getMessage() + "</message>"); if (detail != null) p.println (inner + "<detail>" + detail + "</detail>"); if (nested != null) { if (nested instanceof Loggeable) ((Loggeable)nested).dump (p, inner); else { p.println (inner + "<nested-exception>"); p.print (inner); nested.printStackTrace (p); p.println (inner + "</nested-exception>"); } } p.print (inner); printStackTrace (p); p.println (indent + "</bl-exception>"); } public String toString() {
public int prepare (long id, Serializable o) { Context ctx = (Context) o; try { return doPrepare (id, ctx); } catch (BLException e) { setResultCode (ctx, e.getMessage(), e.getDetail()); } catch (Throwable t) { ctx.log ("prepare exception in " + this.getClass().getName()); ctx.log (t); setResultCode (ctx, t.getMessage()); } finally { checkPoint (ctx); } return ABORTED; }
public int prepareForAbort (long id, Serializable o) { // TxnSupport does not implement AbortParticipant on purpose, // but participants willing to implement it will benefit from // this method. Context ctx = (Context) o; try { return doPrepareForAbort (id, ctx); } catch (BLException e) { setResultCode (ctx, e.getMessage(), e.getDetail()); } catch (Throwable t) { ctx.log ("prepare exception in " + this.getClass().getName()); ctx.log (t); setResultCode (ctx, t.getMessage()); } finally { checkPoint (ctx); } return ABORTED; }