Code example for AccessControlException

0
 
		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) {
		return threadManager.isSafeThread(c);
	} 
}