01: /*
02: * To change this template, choose Tools | Templates
03: * and open the template in the editor.
04: */
05: package it.biobytes.ammentos.util;
06:
07: import it.biobytes.ammentos.PersistenceException;
08: import java.lang.reflect.Method;
09: import java.util.List;
10:
11: /**
12: *
13: * @author davide
14: */
15: public class Invoker {
16:
17: public static void invokeHandlers(List<Method> handlers, Object obj)
18: throws PersistenceException {
19: if (handlers != null) {
20: try {
21: for (Method m : handlers) {
22: synchronized (m) {
23: m.setAccessible(true);
24: }
25: m.invoke(obj);
26: }
27: } catch (Exception ex) {
28: throw new PersistenceException(ex);
29: }
30: }
31: }
32: }
|