// new Instrumentor(String address, int port, int rmiPort)
// default to connect at localhost:9091, rmi at 1099
org.jboss.byteman.contrib.dtest.Instrumentor instrumentor = new Instrumentor();
instrumentor.injectOnMethod(FileInputStream.class.getName(), "<init>(String)",
"$1.contains(\"andrew\")", "throw new FileNotFoundException(\"ha ha\")", "ENTRY");
RuleConstructor rule = RuleConstructor
.createRule("disallow reading from file")
.onInterface(FileInputStream.class)
.inMethod("<init>(String)")
.atEntry()
.helper(org.jboss.byteman.rule.helper.Helper.class)
.ifCondition("$1.contains(\"andrew\")")
.doAction("throw new FileNotFoundException(\"ha ha\")");
instrumentor.installRule(rule);