Package java.lang.reflect

Examples of java.lang.reflect.ReflectPermission


      AccessibleObject class_constructor =
  Class.class.getDeclaredConstructors()[0];

      Permission[] suppressAccessChecks = new Permission[] {
   new ReflectPermission("suppressAccessChecks")};

      TestSecurityManager sm = new TestSecurityManager(harness);
      try {
  sm.install();
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

    permissions.add(new RuntimePermission("getClassLoader"));
    permissions.add(new RuntimePermission("setContextClassLoader"));
    permissions.add(new RuntimePermission("createClassLoader"));
    permissions.add(new RuntimePermission("getProtectionDomain"));
    permissions.add(new RuntimePermission("accessDeclaredMembers"));
    permissions.add(new ReflectPermission("suppressAccessChecks"));
    permissions.add(new LoggingPermission("control", ""));
    permissions.add(new RuntimePermission("getStackTrace"));
    permissions.add(new RuntimePermission("getenv.*"));
    permissions.add(new RuntimePermission("setIO"));
    permissions.add(new PropertyPermission("*", "read,write"));
View Full Code Here

        sm.addPermission(source, new PropertyPermission("java.security.debug", "read"));
        sm.addPermission(source, new PropertyPermission("javax.xml.datatype.DatatypeFactory", "read"));
        sm.addPermission(source, new PropertyPermission("jaxp.debug", "read"));
        sm.addPermission(source, new PropertyPermission("sun.boot.class.path", "read"));
        sm.addPermission(source, new PropertyPermission("sun.timezone.ids.oldmapping", "read"));
        sm.addPermission(source, new ReflectPermission("suppressAccessChecks"));
        sm.addPermission(source, new NetPermission("specifyStreamHandler"));
        sm.setReadOnly();
        System.setSecurityManager(sm);

        // uses implicit Sun14ReflectionProvider in JDK >= 1.4, since it has the appropriate
View Full Code Here

        sm.addPermission(source, new PropertyPermission("java.security.debug", "read"));
        sm.addPermission(source, new PropertyPermission("javax.xml.datatype.DatatypeFactory", "read"));
        sm.addPermission(source, new PropertyPermission("jaxp.debug", "read"));
        sm.addPermission(source, new PropertyPermission("sun.boot.class.path", "read"));
        sm.addPermission(source, new PropertyPermission("sun.timezone.ids.oldmapping", "read"));
        sm.addPermission(source, new ReflectPermission("suppressAccessChecks"));
        sm.addPermission(source, new NetPermission("specifyStreamHandler"));
        sm.setReadOnly();
        System.setSecurityManager(sm);

        xstream = new XStream(new PureJavaReflectionProvider());
View Full Code Here

        sm.addPermission(source, new PropertyPermission("jaxp.debug", "read"));
        sm.addPermission(source, new PropertyPermission("maxOccurLimit", "read"));
        sm.addPermission(source, new PropertyPermission("sun.boot.class.path", "read"));
        sm.addPermission(source, new PropertyPermission("sun.timezone.ids.oldmapping", "read"));
        sm.addPermission(source, new NetPermission("specifyStreamHandler"));
        sm.addPermission(source, new ReflectPermission("suppressAccessChecks"));
        sm.setReadOnly();
        System.setSecurityManager(sm);

        xstream = new XStream(new PureJavaReflectionProvider(), new DomDriver());
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 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

        }

        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(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

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.