Skip to content

Instantly share code, notes, and snippets.

@aviramsegal
Created November 21, 2012 08:03
Show Gist options
  • Save aviramsegal/4123719 to your computer and use it in GitHub Desktop.
Save aviramsegal/4123719 to your computer and use it in GitHub Desktop.
WebSphere Portal Puma runUnrestricted
Context ctx = new InitialContext();
PortletServiceHome pumaService = (PortletServiceHome)ctx.lookup("portletservice/com.ibm.portal.um.portletservice.PumaHome");
PumaHome pumaHome = (PumaHome)pumaService.getPortletService(PumaHome.class);
PrivilegedExceptionAction<Void> action = new PrivilegedExceptionAction<Void>() {
@Override
public Void run() {
// do stuff unrestricted
return null;
}
};
try {
PumaEnvironment pumaEnv = pumaHome.getEnvironment();
pumaEnv.runUnrestricted(action);
} catch (PrivilegedActionException e) {
e.getException().printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment