palio
Class PalioSecurity

java.lang.Object
  extended by palio.PalioSecurity

public class PalioSecurity
extends java.lang.Object

Author:
Szymon Kuklewicz

Method Summary
static java.util.List<java.lang.String> canExecuteJavaByteCode(java.io.File javaBytecode, InstanceType instanceType)
          This method checks if compiled java bytecode does not contain references to restricted classes.
static boolean canReferenceToClass(java.lang.String name, InstanceType instanceType)
          This method is called by: - groovy engine during compilation, - java blocks after compilation (canExecuteJavaCode).
static void checkAccess(InstanceType required)
          This method should be called from each API (package palio.api) method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkAccess

public static void checkAccess(InstanceType required)
This method should be called from each API (package palio.api) method.

Parameters:
required - access
Throws:
java.lang.SecurityException - if no access granted

canReferenceToClass

public static boolean canReferenceToClass(java.lang.String name,
                                          InstanceType instanceType)
This method is called by: - groovy engine during compilation, - java blocks after compilation (canExecuteJavaCode).


canExecuteJavaByteCode

public static java.util.List<java.lang.String> canExecuteJavaByteCode(java.io.File javaBytecode,
                                                                      InstanceType instanceType)
                                                               throws java.io.IOException
This method checks if compiled java bytecode does not contain references to restricted classes. It calls canReferenceToClass for every seen reference.

Returns:
List of security error messages or null if security check passed.
Throws:
java.io.IOException