1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.onemind.commons.invoke;
21
22
23 /***
24 * Represents a function that can be invoked
25 * @author TiongHiang Lee (thlee@onemindsoft.org)
26 * @version $Id: InvocableFunction.java,v 1.4 2004/08/27 02:59:39 thlee Exp $ $Name: $
27 */
28 public interface InvocableFunction
29 {
30 /***
31 * Invoke the function on the target object with argument args
32 * @param target the target
33 * @param args the arguments
34 * @return application specific object
35 * @throws Exception if there's problem completing the invocation
36 */
37 public Object invoke(Object target, Object[] args)
38 throws Exception;
39
40 /***
41 * Get the name
42 * @return the name
43 */
44 public String getName();
45
46 /***
47 * Get the argument types
48 * @return the argument type
49 */
50 public Class[] getArgTypes();
51
52 /***
53 * Whether this method can be invoke on the given arguments
54 * @return true if can invoke on the arguments
55 */
56 public boolean canInvokeOn(Class args[]);
57
58 }