@Override public <T> T get(Contextual<T> bean) { PortletStateScopedBeanHolder holder = PortletStateScopedBeanHolder.getBeanHolder(); if (holder == null) { throw new ContextNotActiveException("The render state context is not active."); } return holder.getBean(bean); }
@Override public <T> T get(Contextual<T> bean, CreationalContext<T> crco) { PortletStateScopedBeanHolder holder = PortletStateScopedBeanHolder.getBeanHolder(); if (holder == null) { throw new ContextNotActiveException("The render state context is not active."); } // The bean hoder 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; }