throw new InvocationException("No portlet context provided");
}
// Get the access mode
InstanceContext instanceCtx = invocation.getInstanceContext();
AccessMode access = instanceCtx.getAccessMode();
// Get a state contxt for the portlet context
InternalContext context = getStateContext(portletContext);
// If it is a producer offered portlet we consider read-write as read-only