Package net.jini.security

Examples of net.jini.security.SecurityContext.wrap()


    final Thread t = (Thread) AccessController.doPrivileged(
        new NewThreadAction(new Runnable() {
      public void run() {
          SecurityContext securityContext =
        target.getSecurityContext();
          AccessController.doPrivileged(securityContext.wrap(
        new PrivilegedAction() {
            public Object run() {
          obj.unreferenced();
          return null;
            }
View Full Code Here


  };
  PrivilegedExceptionAction pea = new PrivilegedExceptionAction() {
      public Object run() { return null; }
  };
  SecurityContext ctx = Security.getContext();
  if (ctx.wrap(pa) != pa || ctx.wrap(pea) != pea) {
      throw new Error("default context should not wrap actions");
  }

  TestSecurityManager tsm = new TestSecurityManager();
  System.setSecurityManager(tsm);
View Full Code Here

  };
  PrivilegedExceptionAction pea = new PrivilegedExceptionAction() {
      public Object run() { return null; }
  };
  SecurityContext ctx = Security.getContext();
  if (ctx.wrap(pa) != pa || ctx.wrap(pea) != pea) {
      throw new Error("default context should not wrap actions");
  }

  TestSecurityManager tsm = new TestSecurityManager();
  System.setSecurityManager(tsm);
View Full Code Here

    final Thread t = (Thread) AccessController.doPrivileged(
        new NewThreadAction(new Runnable() {
      public void run() {
          SecurityContext securityContext =
        target.getSecurityContext();
          AccessController.doPrivileged(securityContext.wrap(
        new PrivilegedAction() {
            public Object run() {
          obj.unreferenced();
          return null;
            }
View Full Code Here

        logger.fine("Security manager and policy provider are not "
                + "instances of SecurityContextSource.");
        logger.fine("Calling 'Security.getContext()' method.");
        SecurityContext sc = Security.getContext();

        if (sc.wrap(testPA) != testPA) {
            // FAIL
            throw new TestException(
                    "Returned SecurityContext's 'wrap(PrivilegedAction)' "
                    + "method returned " + sc.wrap(testPA) + " while "
                    + testPA + " was expected.");
View Full Code Here

        if (sc.wrap(testPA) != testPA) {
            // FAIL
            throw new TestException(
                    "Returned SecurityContext's 'wrap(PrivilegedAction)' "
                    + "method returned " + sc.wrap(testPA) + " while "
                    + testPA + " was expected.");
        }

        if (sc.wrap(testPEA) != testPEA) {
            // FAIL
View Full Code Here

                    "Returned SecurityContext's 'wrap(PrivilegedAction)' "
                    + "method returned " + sc.wrap(testPA) + " while "
                    + testPA + " was expected.");
        }

        if (sc.wrap(testPEA) != testPEA) {
            // FAIL
            throw new TestException(
                    "Returned SecurityContext's "
                    + "'wrap(PrivilegedExceptionAction)' method returned "
                    + sc.wrap(testPEA) + " while " + testPEA
View Full Code Here

        if (sc.wrap(testPEA) != testPEA) {
            // FAIL
            throw new TestException(
                    "Returned SecurityContext's "
                    + "'wrap(PrivilegedExceptionAction)' method returned "
                    + sc.wrap(testPEA) + " while " + testPEA
                    + " was expected.");
        }

        // PASS
        logger.fine("Method returned correct SecurityContext instance.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.