List of usage examples for javax.naming NamingException addSuppressed
public final synchronized void addSuppressed(Throwable exception)
From source file:org.nuxeo.runtime.jtajca.NuxeoContainer.java
protected static void uninstall() throws NamingException { if (installContext == null) { throw new RuntimeException("Nuxeo container not installed"); }//w ww . j ava2 s .c om try { NamingException errors = new NamingException("Cannot shutdown connection managers"); for (ConnectionManagerWrapper cm : connectionManagers.values()) { try { cm.dispose(); } catch (RuntimeException cause) { errors.addSuppressed(cause); } } if (errors.getSuppressed().length > 0) { log.error("Cannot shutdown some pools", errors); throw errors; } } finally { log.trace("Uninstalling nuxeo container", installContext); installContext = null; rootContext = null; tm = null; tmRecoverable = null; tmSynchRegistry = null; ut = null; connectionManagers.clear(); } }