try {
if (applicationAssociate != null) {
BeanManager beanManager = applicationAssociate.getBeanManager();
if (beanManager != null && beanManager.isManaged(name)) {
beanManager.destroy(name, bean);
}
}
} catch (Exception exception) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, "Error calling @PreDestroy on bean with name: " + name, exception);