Code example for UnresolvedPermission

0
            Constructor ctr = clazz.getConstructor(PARAMS);
            return (java.security.Permission) ctr.newInstance(new Object[] {
                    name, actions });
        } catch (Exception e) {
            // Let the UnresolvedPermission handle it. 
            return new UnresolvedPermission(permission.getClassName(),
                    permission.getName(), permission.getActions(), null);
        } 
    } 
 
    /** 
     * To be used by tasks that just finished executing the parts subject to these permissions. 
     */ 
    public synchronized void restoreSecurityManager() { 
        active = false;
        System.setSecurityManager(origSm);
    } 
 
    /** 
     * This inner class implements the actual SecurityManager that can be used by tasks 
     * supporting Permissions.