1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.directwebremoting.guice;
17
18 import com.google.inject.Provider;
19
20 import java.lang.reflect.Method;
21
22 import org.directwebremoting.AjaxFilter;
23 import org.directwebremoting.AjaxFilterChain;
24 import org.directwebremoting.extend.AjaxFilterManager;
25
26 /**
27 * Specialized Ajax filter implementation that uses a Provider to
28 * look up instances to delegate to. This class is used by
29 * {@link InternalAjaxFilterManager}.
30 * @author Tim Peierls [tim at peierls dot net]
31 */
32 class InternalAjaxFilter implements AjaxFilter
33 {
34 InternalAjaxFilter(Provider<AjaxFilter> provider)
35 {
36 this.provider = provider;
37 }
38
39 public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain)
40 throws Exception
41 {
42 return provider.get().doFilter(obj, method, params, chain);
43 }
44
45 private final Provider<AjaxFilter> provider;
46 }