/** * Returns a map of the non-stanard information stored on the exception * * @param t the exception to extract the information from * @return a map of the non-stanard information stored on the exception */ public Map<?, ?> getInfo(Throwable t) { if (t instanceof NamingException) { NamingException e = (NamingException) t; Map<String, Object> info = new HashMap<String, Object>(); final Name remainingName = e.getRemainingName(); final Name resolvedName = e.getResolvedName(); info.put("Remaining Name", remainingName == null ? MISSING_NAME_DISPLAY_VALUE : remainingName.toString()); info.put("Resolved Name", resolvedName == null ? MISSING_NAME_DISPLAY_VALUE : resolvedName.toString()); return info; } else { return Collections.EMPTY_MAP; } } }
/** * Convenience method to get the leading portion of the resolved name * associated with this exception, if the root cause was an instance of * {@link javax.naming.NamingException}. * * @return a composite name describing the the leading portion of the name * that was resolved successfully if the root cause is an instance * of javax.naming.NamingException, or <code>null</code> if the * resolved name field has not been set */ public Name getResolvedName() { if (getCause() instanceof javax.naming.NamingException) { return ((javax.naming.NamingException) getCause()) .getResolvedName(); } return null; }
/** * Convenience method to get the leading portion of the resolved name * associated with this exception, if the root cause was an instance of * {@link javax.naming.NamingException}. * * @return a composite name describing the the leading portion of the name * that was resolved successfully if the root cause is an instance * of javax.naming.NamingException, or <code>null</code> if the * resolved name field has not been set */ public Name getResolvedName() { if (getCause() instanceof javax.naming.NamingException) { return ((javax.naming.NamingException) getCause()) .getResolvedName(); } return null; }
/** * Convenience method to get the leading portion of the resolved name * associated with this exception, if the root cause was an instance of * {@link javax.naming.NamingException}. * * @return a composite name describing the the leading portion of the name * that was resolved successfully if the root cause is an instance * of javax.naming.NamingException, or <code>null</code> if the * resolved name field has not been set */ public Name getResolvedName() { if (getCause() instanceof javax.naming.NamingException) { return ((javax.naming.NamingException) getCause()) .getResolvedName(); } return null; }
/** * Convenience method to get the leading portion of the resolved name * associated with this exception, if the root cause was an instance of * {@link javax.naming.NamingException}. * * @return a composite name describing the the leading portion of the name * that was resolved successfully if the root cause is an instance * of javax.naming.NamingException, or <code>null</code> if the * resolved name field has not been set */ public Name getResolvedName() { if (getCause() instanceof javax.naming.NamingException) { return ((javax.naming.NamingException) getCause()) .getResolvedName(); } return null; }