{
throw new NoSuchPortletException("Portlet " + context.getPortletContext() + " not found", context.getPortletId());
}
// Create prefs
AbstractPropertyContext prefs = new AbstractPropertyContext(
access,
context.isStateful() ? ((StatefulContext)context).getProperties() : null,
invocation instanceof RenderInvocation);
//
PortletInvocationResponse response;
try
{
invocation.setTarget(context.getPortletContext());
invocation.setAttribute(PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
// Invoke
response = super.invoke(invocation);
}
finally
{
invocation.setTarget(portletContext);
invocation.removeAttribute(PropertyContext.PREFERENCES_ATTRIBUTE);
}
//
int status = prefs.getStatus();
// Producer state management if the invocation was succesful
if ((invocation instanceof ActionInvocation || invocation instanceof ResourceInvocation || invocation instanceof EventInvocation) && status == AbstractPropertyContext.UPDATE_SUCCESSFUL)
{
// Get the potentially updated prefs
PropertyMap newPrefs = prefs.getPrefs();
//
switch(access)
{
case CLONE_BEFORE_WRITE: