/** * Sets the bean instance for all annotated methods for a given portlet that are members of * a configured portlet class to ensure that all annotated methods of the portlet class use * the same bean instance. * * @param portletName The portlet name * @param cls The class * @param beanInstance The instance to use */ public void setPortletClassInstance(String portletName, Class<?> cls, Object beanInstance) { for (MethodIdentifier mi : getMethodIDsForPortlet(portletName)) { List<AnnotatedMethod> list = methods.get(mi); for (AnnotatedMethod am : list) { if (am.getBeanClass().equals(cls)) { am.setPortletClassInstance(beanInstance); } } } }