private final void stopWatching(@Observes @BeforeDestroyed(ApplicationScoped.class) @Priority(LIBRARY_BEFORE) final Object event) throws Exception { final Closeable watch = this.watch; if (watch != null) { KubernetesClientException closeException = this.closeException; try { watch.close(); } catch (final Exception everything) { if (closeException != null) { closeException.addSuppressed(everything); throw closeException; } else { throw everything; } } if (closeException != null) { throw closeException; } } }
public void destroy(@Observes @BeforeDestroyed(ApplicationScoped.class) ServletContext init) { log.info("Closing LDAP connection at server shutdown..."); LdapEntryManager ldapEntryManager = ldapEntryManagerInstance.get(); closeLdapEntryManager(ldapEntryManager); LdapEntryManager ldapCentralEntryManager = ldapCentralEntryManagerInstance.get(); if (ldapCentralEntryManager != null) { closeLdapEntryManager(ldapCentralEntryManager); } }
public void destroy(@BeforeDestroyed(ApplicationScoped.class) ServletContext init) { log.debug("Destroying custom scripts configurations"); if (this.customScriptConfigurations == null) { return; } // Destroy authentication methods for (Entry<String, CustomScriptConfiguration> customScriptConfigurationEntry : this.customScriptConfigurations.entrySet()) { destroyCustomScript(customScriptConfigurationEntry.getValue()); } }
public void destroy(@Observes @BeforeDestroyed(ApplicationScoped.class) ServletContext init) { log.info("Closing LDAP connection at server shutdown..."); LdapEntryManager ldapEntryManager = ldapEntryManagerInstance.get(); closeLdapEntryManager(ldapEntryManager); List<LdapEntryManager> ldapAuthEntryManagers = ldapAuthEntryManagerInstance.get(); closeLdapEntryManagers(ldapAuthEntryManagers); }