Examples of punishSecurityViolation()


Examples of net.sf.robocode.host.IHostedThread.punishSecurityViolation()

    // Attempt to stop the window from displaying
    if (perm instanceof java.awt.AWTPermission) {
      final String message = "Preventing " + robotProxy.getStatics().getName() + " from access: " + perm;

      robotProxy.punishSecurityViolation(message);

      // this is hack, because security exception is not enough
      throw new ThreadDeath();
    }
View Full Code Here

Examples of net.sf.robocode.host.IHostedThread.punishSecurityViolation()

    }

    // Permission denied.
    final String message = "Preventing " + robotProxy.getStatics().getName() + " from access: " + perm;

    robotProxy.punishSecurityViolation(message);
    return false;
  }

  private boolean impliesRobotPackageAccess(IHostedThread robotProxy, String packageName) {
    if (packageName.startsWith("robocode.control") || packageName.startsWith("net.sf.robocode")) {
View Full Code Here

Examples of net.sf.robocode.host.IHostedThread.punishSecurityViolation()

    if (!found) {
      String message = "Preventing " + c.getName() + " from access to " + t.getName();
      IHostedThread robotProxy = threadManager.getLoadedOrLoadingRobotProxy(c);

      if (robotProxy != null) {
        robotProxy.punishSecurityViolation(message);
      }
      throw new AccessControlException(message);
    }
  }
View Full Code Here

Examples of net.sf.robocode.host.IHostedThread.punishSecurityViolation()

    }

    if (cg.activeCount() > 5) {
      String message = "Robots are only allowed to create up to 5 threads!";

      robotProxy.punishSecurityViolation(message);
      throw new AccessControlException(message);
    }
  }

  private boolean isSafeThread(Thread c) {
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.