Package java.lang.reflect

Examples of java.lang.reflect.ReflectPermission


   public void testCoreJavaMethodsNotMadeAccessible(final Method testMethod) {
      // a nice mock is required because plenty of other checks will be made
      SecurityManager mockSecurityManager = createNiceMock(SecurityManager.class);
      // clunky way of failing if the following method is ever called
      mockSecurityManager.checkPermission(new ReflectPermission("suppressAccessChecks"));
      expectLastCall().andStubAnswer(new IAnswer<Void>() {
            @Override
            public Void answer() throws Throwable {
               try {
                  // generate a stacktrace
View Full Code Here


        }

        private static void setInstance(ServiceIteratorProvider sip) throws SecurityException {
            SecurityManager security = System.getSecurityManager();
            if (security != null) {
                ReflectPermission rp = new ReflectPermission("suppressAccessChecks");
                security.checkPermission(rp);
            }
            synchronized (sipLock) {
                ServiceIteratorProvider.sip = sip;
            }
View Full Code Here

        }

        private static void setInstance(ServiceIteratorProvider sip) throws SecurityException {
            SecurityManager security = System.getSecurityManager();
            if (security != null) {
                ReflectPermission rp = new ReflectPermission("suppressAccessChecks");
                security.checkPermission(rp);
            }
            synchronized (sipLock) {
                ServiceIteratorProvider.sip = sip;
            }
View Full Code Here

                permissions.add(new RuntimePermission("createClassLoader"));
                permissions.add(new RuntimePermission("closeClassLoader"));
                permissions.add(new RuntimePermission("modifyThreadGroup"));
                permissions.add(new RuntimePermission("getStackTrace"));
                permissions.add(new ManagementPermission("monitor"));
                permissions.add(new ReflectPermission("suppressAccessChecks"));
                permissions.add(new PropertyPermission("*", "read"));
                permissions.add(new FilePermission(temporaryDirectory("JavaREPL").getAbsolutePath() + "/-", "read, write, delete"));
                permissions.add(new FilePermission("<<ALL FILES>>", "read"));
            }

View Full Code Here

        }

        private static void setInstance(ResourcesProvider provider) throws SecurityException {
            SecurityManager security = System.getSecurityManager();
            if (security != null) {
                ReflectPermission rp = new ReflectPermission("suppressAccessChecks");
                security.checkPermission(rp);
            }
            synchronized (ResourcesProvider.class) {
                ResourcesProvider.provider = provider;
            }
View Full Code Here

                result.add(new TcPermission("http://example.org/read/graph", "read"));
                result.add(new TcPermission("http://example.org/area/allowed/*", "readwrite"));
                result.add(new TcPermission("urn:x-localinstance:/graph-access.graph", "readwrite"));
                //result.add(new AllPermission());
                result.add(new RuntimePermission("*"));
                result.add(new ReflectPermission("suppressAccessChecks"));
                result.add(new PropertyPermission("*", "read"));
                //(java.util.PropertyPermission line.separator read)
                result.add(new FilePermission("/-", "read,write"));
                return result;
            }
View Full Code Here

    perms.add(new ServicePermission("*", ServicePermission.GET));
    perms.add(new PropertyPermission("org.springframework.osgi.*", "read"));
    perms.add(new PropertyPermission("org.springframework.osgi.iandt.*", "write"));
    // required by Spring
    perms.add(new RuntimePermission("*", "accessDeclaredMembers"));
    perms.add(new ReflectPermission("*", "suppressAccessChecks"));
    return perms;
  }
View Full Code Here

    perms.add(new ServicePermission("*", ServicePermission.GET));
    perms.add(new PropertyPermission("*", "read,write"));

    // required by Spring
    perms.add(new RuntimePermission("*", "accessDeclaredMembers"));
    perms.add(new ReflectPermission("*", "suppressAccessChecks"));

    return perms;
  }
View Full Code Here

   public void testCoreJavaMethodsNotMadeAccessible(final Method testMethod) {
      // a nice mock is required because plenty of other checks will be made
      SecurityManager mockSecurityManager = createNiceMock(SecurityManager.class);
      // clunky way of failing if the following method is ever called
      mockSecurityManager.checkPermission(new ReflectPermission("suppressAccessChecks"));
      expectLastCall().andStubAnswer(new IAnswer<Void>() {
            @Override
            public Void answer() throws Throwable {
               try {
                  // generate a stacktrace
View Full Code Here

    }

    private static AccessControlContext createSecurityContext() {
        PermissionCollection perms = new Permissions();
        perms.add(new RuntimePermission("accessClassInPackage.com" + ".sun.xml.internal.ws.runtime.config")); // avoid repackaging
        perms.add(new ReflectPermission("suppressAccessChecks"));
        return new AccessControlContext(
                new ProtectionDomain[]{
                        new ProtectionDomain(null, perms),
                });
    }
View Full Code Here

TOP

Related Classes of java.lang.reflect.ReflectPermission

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.