예제 #1
0
파일: Rule.java 프로젝트: damc-dev/byteman
 public int addAccessibleMethod(Method method) {
   if (accessibleMethods == null) {
     accessibleMethods = new ArrayList<Method>();
   }
   int index = accessibleMethods.size();
   accessibleMethods.add(method);
   return index;
 }
예제 #2
0
파일: Rule.java 프로젝트: damc-dev/byteman
 public int addAccessibleField(Field field) {
   if (accessibleFields == null) {
     accessibleFields = new ArrayList<Field>();
   }
   int index = accessibleFields.size();
   accessibleFields.add(field);
   return index;
 }
예제 #3
0
파일: Rule.java 프로젝트: damc-dev/byteman
 public Object invokeAccessibleMethod(Object target, Object[] args, int methodIndex) {
   try {
     Method method = accessibleMethods.get(methodIndex);
     return method.invoke(target, args);
   } catch (Exception e) {
     throw new ExecuteException(
         "Rule.invokeAccessibleMethod : unexpected error invoking non-public method in rule "
             + getName(),
         e);
   }
 }
예제 #4
0
파일: Rule.java 프로젝트: damc-dev/byteman
 public Object getAccessibleField(Object owner, int fieldIndex) throws ExecuteException {
   try {
     Field field = accessibleFields.get(fieldIndex);
     return field.get(owner);
   } catch (Exception e) {
     throw new ExecuteException(
         "Rule.getAccessibleField : unexpected error getting non-public field in rule "
             + getName(),
         e);
   }
 }
예제 #5
0
파일: Rule.java 프로젝트: damc-dev/byteman
 public void setAccessibleField(Object owner, Object value, int fieldIndex)
     throws ExecuteException {
   try {
     Field field = accessibleFields.get(fieldIndex);
     field.set(owner, value);
   } catch (Exception e) {
     throw new ExecuteException(
         "Rule.setAccessibleField : unexpected error setting non-public field in rule "
             + getName(),
         e);
   }
 }