/** * Remove & destroy all beans. if a response is provided, store the bean state. * * @param resp The state aware response */ protected void removeAll(StateAwareResponse resp) { for (Contextual<?> bean : beans.keySet()) { if (resp != null) { PortletSerializable thisBean = (PortletSerializable) beans.get(bean).instance; String[] vals = thisBean.serialize(); String pn = config.getParamName((Bean<?>) bean); resp.getRenderParameters().setValues(pn, vals); if (isTrace) { StringBuilder txt = new StringBuilder(128); txt.append("Stored parameter for portlet with namespace: "); txt.append(resp.getNamespace()); txt.append(", paramName: ").append(pn); txt.append(", Values: ").append(Arrays.toString(vals)); LOG.trace(txt.toString()); } } remove(bean); } } }