Created
November 21, 2012 08:03
-
-
Save aviramsegal/4123719 to your computer and use it in GitHub Desktop.
WebSphere Portal Puma runUnrestricted
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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