-
Notifications
You must be signed in to change notification settings - Fork 0
/
Handler.java
54 lines (43 loc) · 1.1 KB
/
Handler.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.kn.processor;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author krishnanand
*
*/
public class Handler {
private Object handler;
private Method method;
public Handler() {
super();
}
/**
* @param handler
* @param method
*/
public Handler(Object handler, Method method) {
super();
this.handler = handler;
this.method = method;
}
public Object getHandler() {
return handler;
}
public void setHandler(Object handler) {
this.handler = handler;
}
public Method getMethod() {
return method;
}
public void setMethod(Method method) {
this.method = method;
}
public void invokeMethod(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
method.invoke(handler, request, response);
}
}