Package java.security

Examples of java.security.PrivilegedAction


    }

    private static Package defineSystemPackage(final String iname,
                 final String fn)
    {
  return (Package) AccessController.doPrivileged(new PrivilegedAction() {
      public Object run() {
    String name = iname;
    // Get the cached code source url for the file name
    URL url = (URL)urls.get(fn);
    if (url == null) {
View Full Code Here


                             * Event processing is done inside doPrivileged block so that
                             * it wouldn't matter even if user code is on the stack
                             * Fix for BugId 6300270
                             */

                             AccessController.doPrivileged(new PrivilegedAction() {
                                     public Object run() {
                                        pumpEventsForFilter.run();
                                        return null;
                                     }
                             });
View Full Code Here

     * override security-sensitive non-final methods.  Returns true if the
     * subclass overrides any of the methods, false otherwise.
     */
    private static boolean auditSubclass(final Class subcl) {
  Boolean result = (Boolean) AccessController.doPrivileged(
      new PrivilegedAction() {
    public Object run() {
        for (Class cl = subcl;
       cl != Thread.class;
       cl = cl.getSuperclass())
        {
View Full Code Here

     * @return the result of applying the action to the target
     *
     * @see EventHandler
     */
    public Object invoke(final Object proxy, final Method method, final Object[] arguments) {
  return AccessController.doPrivileged(new PrivilegedAction() {
      public Object run() {
          return invokeInternal(proxy, method, arguments);
      }
  }, acc);
    }
View Full Code Here

  final SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
      final String name = cls.getName();
            final int i = name.lastIndexOf('.');
      if (i != -1) {
                AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run() {
            sm.checkPackageAccess(name.substring(0, i));
            return null;
                    }
                }, new AccessControlContext(new ProtectionDomain[] {pd}));
View Full Code Here

        throw new UnsatisfiedLinkError("no " + name + " in java.library.path");
    }

    private static boolean loadLibrary0(Class fromClass, final File file) {
  Boolean exists = (Boolean)
      AccessController.doPrivileged(new PrivilegedAction() {
    public Object run() {
        return new Boolean(file.exists());
    }
      });
  if (!exists.booleanValue()) {
View Full Code Here

        final Class interfaceClass = mxbeanInterface;
        // Only allow MXBean interfaces from rt.jar loaded by the
        // bootstrap class loader
        final ClassLoader loader = (ClassLoader)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return interfaceClass.getClassLoader();
                }
            });
        if (loader != null) {
View Full Code Here

    private static PropertyDescriptor[] getPropertyDescriptors(final Class secJavaType)
    {
        return (
            PropertyDescriptor[]) AccessController
                .doPrivileged(new PrivilegedAction()
        {
            public Object run()
            {
                PropertyDescriptor[] result = null;
                // START FIX http://nagoya.apache.org/bugzilla/showattachment.cgi?attach_id=4937
View Full Code Here

            for (final Field field : klass.getDeclaredFields()) {
                if ((field.getModifiers() & Modifier.STATIC) == 0) {
                    if (groovyObject && field.getName().equals("metaClass")) {
                        continue;
                    }
                    AccessController.doPrivileged(new PrivilegedAction() {
                        public Object run() {
                            field.setAccessible(true);
                            return null;
                        }
                    });
View Full Code Here

        //  code in a privileged action so it is not necessary for the calling code
        //  to have the same privileges as the wrapper jar.
        // This is safe because this method can only be called once and that one call
        //  will presumably be made on JVM startup.
        AccessController.doPrivileged(
            new PrivilegedAction() {
                public Object run() {
                    privilegedStart( listener, args );
                    return null;
                }
            }
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.