Methods Summary |
---|
private static java.lang.String | formatMessage(java.lang.String a, java.lang.String b)
final StringBuffer sb = new StringBuffer("");
boolean isValidA = (null != a) && (a.length() > 0);
boolean isValidB = (null != b) && (b.length() > 0);
if (isValidA) { sb.append(a); }
if (isValidA && isValidB) { sb.append('("); }
if (isValidB) { sb.append(b); }
if (isValidA && isValidB) { sb.append(')"); }
return sb.toString();
|
public static java.lang.String | getMessage(java.lang.Throwable t, java.lang.String cause1)
if (null == t) { return cause1; }
final String cause = t.getMessage();
final Throwable x = (t instanceof MBeanException) ?
((MBeanException)t).getTargetException() : t.getCause();
final String s = getMessage(x, cause);
return formatMessage(cause1, s);
|
public static javax.management.MBeanException | toMBeanException(java.lang.Exception e, java.lang.String msg)This method returns an MBeanException instance with the message formatted
as msg(msg1(msg2...)). It also inits the cause of the MBeanException.
final String s = getMessage(e, msg);
final Exception cause = (e != null) ? e : new Exception(s);
MBeanException mbe = new MBeanException(cause, s);
mbe.initCause(cause);
return mbe;
|