Java 类javax.enterprise.context.BeforeDestroyed 实例源码

项目:microbean-kubernetes-client-cdi    文件:KubernetesClientExtension.java   
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;
    }
  }
}
项目:oxTrust    文件:AppInitializer.java   
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);
    }
}
项目:oxCore    文件:CustomScriptManager.java   
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());
    }
}
项目:oxAuth    文件:AppInitializer.java   
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);
}