/** * Returns an instance for the contextual type, or null if none available. * * @param bean * Contextual type (Bean) for which an instance is desired * @return The instance, or null if none exists */ public <T> T getBean(Contextual<T> bean) { String id = null; if (config.isPortletScoped(bean)) { id = windowId; } return beans.getBeanInstance(id, bean); }
/** * Adds a bean instance with associated creational context to the store for the given contextual object (bean). * * @param bean * The bean type * @param crco * The creational context * @param instance * The bean instance */ public <T> void putBeanInstance(Contextual<T> bean, CreationalContext<T> crco, T instance) { String id = null; if (config.isPortletScoped(bean)) { id = windowId; } beans.putBeanInstance(id, bean, crco, instance); } }