if(getWebBeansType().equals(WebBeansType.MANAGED) ||
getWebBeansType().equals(WebBeansType.DECORATOR))
{
if (WebBeansUtil.isContainsInterceptorMethod(getInterceptorStack(), InterceptionType.PRE_DESTROY))
{
InvocationContextImpl impl = new InvocationContextImpl(getWebBeansContext(), null, instance, null, null,
getWebBeansContext().getInterceptorUtil().getInterceptorMethods(getInterceptorStack(),
InterceptionType.PRE_DESTROY),
InterceptionType.PRE_DESTROY);
impl.setCreationalContext(creationalContext);
try
{
impl.proceed();
}
catch (Exception e)
{
getLogger().log(Level.SEVERE, WebBeansLoggerFacade.constructMessage(OWBLogConst.ERROR_0008, "@PreDestroy."), e);
throw new WebBeansException(e);