@Override public <T> T get(Contextual<T> bean) { PortletRequestScopedBeanHolder holder = PortletRequestScopedBeanHolder.getBeanHolder(); if (holder == null) { throw new ContextNotActiveException("The portlet request context is not active."); } return holder.getBean(bean); }
@Override public <T> T get(Contextual<T> bean, CreationalContext<T> crco) { PortletRequestScopedBeanHolder holder = PortletRequestScopedBeanHolder.getBeanHolder(); if (holder == null) { throw new ContextNotActiveException("The portlet request context is not active."); } // The bean holder will return an existing bean instance or create a new one // if no existing instance is available. T inst = holder.getBean(bean, crco); return inst; }