Package java.security

Examples of java.security.PrivilegedAction


                return pc;
            }
        } else {
            PasswordCredential pc =
            (PasswordCredential) AccessController.doPrivileged
                (new PrivilegedAction() {
                    public Object run() {
                        Set creds = subject.getPrivateCredentials
                            (PasswordCredential.class);
                        Iterator iter = creds.iterator();
                        while (iter.hasNext()) {
View Full Code Here


        return cl;
    }

    @SuppressWarnings("unchecked")
    public static ClassLoader getContextClassLoader() throws SecurityException {
        return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                ClassLoader cl = null;
                cl = Thread.currentThread().getContextClassLoader();
                if(cl == null) {
                    cl = ClassLoader.getSystemClassLoader();
View Full Code Here

                return pc;
            }
        } else {
            PasswordCredential pc =
            (PasswordCredential) AccessController.doPrivileged
                (new PrivilegedAction() {
                    public Object run() {
                        Set creds = subject.getPrivateCredentials
                            (PasswordCredential.class);
                        Iterator iter = creds.iterator();
                        while (iter.hasNext()) {
View Full Code Here

            // String cfile = System.getProperty("com.sun.org.apache.xml.internal.security.resource.config");
      // InputStream is =
      //     Class.forName("com.sun.org.apache.xml.internal.security.Init")
      //     .getResourceAsStream(cfile != null ? cfile : "resource/config.xml");
      InputStream is = (InputStream) AccessController.doPrivileged(
    new PrivilegedAction() {
        public Object run() {
      return getClass().getResourceAsStream
            ("resource/config.xml");
        }
    });
View Full Code Here

            throw new AlgorithmAlreadyRegisteredException(
               "algorithm.alreadyRegistered", exArgs);
         }

   ClassLoader cl = (ClassLoader) AccessController.doPrivileged(
             new PrivilegedAction() {
                 public Object run() {
                     return Thread.currentThread().getContextClassLoader();
                 }
             });
View Full Code Here

    static Field proxyActive;
    // Accessor to private field isProxyActive of KeyEvent
    private static boolean isProxyActiveImpl(KeyEvent e) {
        if (proxyActive == null) {
            proxyActive = (Field) AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        Field field = null;
                        try {
                            field = KeyEvent.class.getDeclaredField("isProxyActive");
                            if (field != null) {
View Full Code Here

*/
class SecuritySupport12 extends SecuritySupport {

    ClassLoader getContextClassLoader() {
        return (ClassLoader)
                AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                ClassLoader cl = null;
                try {
                    cl = Thread.currentThread().getContextClassLoader();
                } catch (SecurityException ex) { }
View Full Code Here

        });
    }

    ClassLoader getSystemClassLoader() {
        return (ClassLoader)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    ClassLoader cl = null;
                    try {
                        cl = ClassLoader.getSystemClassLoader();
                    } catch (SecurityException ex) {}
View Full Code Here

            });
    }

    ClassLoader getParentClassLoader(final ClassLoader cl) {
        return (ClassLoader)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    ClassLoader parent = null;
                    try {
                        parent = cl.getParent();
                    } catch (SecurityException ex) {}
View Full Code Here

            });
    }

    String getSystemProperty(final String propName) {
        return (String)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return System.getProperty(propName);
                }
            });
    }
View Full Code Here

TOP

Related Classes of java.security.PrivilegedAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.