{
// Get the context of the portlet that the client want to use
final PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
throw new InvocationException("No portlet context provided");
}
// Get the access mode
InstanceContext instanceCtx = invocation.getInstanceContext();
AccessMode access = instanceCtx.getAccessMode();