observerMethod.invoke(object, args);
}
else
{
BeanManagerImpl manager = bean.getWebBeansContext().getBeanManagerImpl();
Context context;
try
{
context = manager.getContext(component.getScope());
}
catch (ContextNotActiveException cnae)
{
// this may happen if we try to e.g. send an event to a @ConversationScoped bean from a ServletListener
logger.log(Level.INFO, OWBLogConst.INFO_0010, bean);
return;
}
// on Reception.IF_EXISTS: ignore this bean if a the contextual instance doesn't already exist
object = context.get(component);
if (ifExist && object == null)
{
return;
}
creationalContext = manager.createCreationalContext(component);
if (isPrivateMethod)
{
// since private methods cannot be intercepted, we can just call them directly
// so we get the contextual instance directly from the context because we do not
// proxy private methods (thus the invocation on the contextual reference would fail)
if (object == null)
{
object = context.get(component, creationalContext);
}
}
else
{
// on Reception.ALWAYS we must get a contextual reference if we didn't find the contextual instance