@Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); if (instance == null) { throw BeanLogger.LOG.cannotDestroyNullBean(this); } if (!(instance instanceof EnterpriseBeanInstance)) { throw BeanLogger.LOG.cannotDestroyEnterpriseBeanNotCreated(instance); } EnterpriseBeanInstance enterpriseBeanInstance = (EnterpriseBeanInstance) instance; enterpriseBeanInstance.destroy(Marker.INSTANCE, this, creationalContext); creationalContext.release(); }
@Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); if (instance == null) { throw BeanLogger.LOG.cannotDestroyNullBean(this); } if (!(instance instanceof EnterpriseBeanInstance)) { throw BeanLogger.LOG.cannotDestroyEnterpriseBeanNotCreated(instance); } EnterpriseBeanInstance enterpriseBeanInstance = (EnterpriseBeanInstance) instance; enterpriseBeanInstance.destroy(Marker.INSTANCE, this, creationalContext); creationalContext.release(); }
/** * Destroys an instance of the bean * * @param instance The instance */ @Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); try { getProducer().preDestroy(instance); // WELD-1010 hack? if (creationalContext instanceof CreationalContextImpl) { ((CreationalContextImpl<T>) creationalContext).release(this, instance); } else { creationalContext.release(); } } catch (Exception e) { BeanLogger.LOG.errorDestroying(instance, this); BeanLogger.LOG.catchingDebug(e); } }
/** * Destroys an instance of the bean * * @param instance The instance */ @Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); try { getProducer().preDestroy(instance); // WELD-1010 hack? if (creationalContext instanceof CreationalContextImpl) { ((CreationalContextImpl<T>) creationalContext).release(this, instance); } else { creationalContext.release(); } } catch (Exception e) { BeanLogger.LOG.errorDestroying(instance, this); BeanLogger.LOG.catchingDebug(e); } }
/** * Destroys an instance of the bean * * @param instance The instance */ @Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); try { getProducer().preDestroy(instance); // WELD-1010 hack? if (creationalContext instanceof CreationalContextImpl) { ((CreationalContextImpl<T>) creationalContext).release(this, instance); } else { creationalContext.release(); } } catch (Exception e) { BeanLogger.LOG.errorDestroying(instance, this); BeanLogger.LOG.catchingDebug(e); } }
/** * Destroys an instance of the bean * * @param instance The instance */ @Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); try { getProducer().preDestroy(instance); // WELD-1010 hack? if (creationalContext instanceof CreationalContextImpl) { ((CreationalContextImpl<T>) creationalContext).release(this, instance); } else { creationalContext.release(); } } catch (Exception e) { BeanLogger.LOG.errorDestroying(instance, this); BeanLogger.LOG.catchingDebug(e); } }
/** * Destroys an instance of the bean * * @param instance The instance */ @Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); try { getProducer().preDestroy(instance); // WELD-1010 hack? if (creationalContext instanceof CreationalContextImpl) { ((CreationalContextImpl<T>) creationalContext).release(this, instance); } else { creationalContext.release(); } } catch (Exception e) { BeanLogger.LOG.errorDestroying(instance, this); BeanLogger.LOG.catchingDebug(e); } }
/** * Destroys an instance of the bean * * @param instance The instance */ @Override public void destroy(T instance, CreationalContext<T> creationalContext) { super.destroy(instance, creationalContext); try { getProducer().preDestroy(instance); // WELD-1010 hack? if (creationalContext instanceof CreationalContextImpl) { ((CreationalContextImpl<T>) creationalContext).release(this, instance); } else { creationalContext.release(); } } catch (Exception e) { BeanLogger.LOG.errorDestroying(instance, this); BeanLogger.LOG.catchingDebug(e); } }