1
package hudson.remoting;
3
import java.util.concurrent.Callable;
6
* @author Kohsuke Kawaguchi
8
public class ChannelFilterTest extends RmiTestBase {
9
public void testFilter() throws Exception {
10
channel.addLocalExecutionInterceptor(new CallableFilter() {
11
public <V> V call(Callable<V> callable) throws Exception {
12
Object old = STORE.get();
15
return callable.call();
22
Callable<Object> t = new Callable<Object>() {
23
public Object call() throws Exception {
27
final Callable c = channel.export(Callable.class, t);
29
assertEquals("x", channel.call(new CallableCallable(c)));
32
private final ThreadLocal<Object> STORE = new ThreadLocal<Object>();
34
private static class CallableCallable implements hudson.remoting.Callable<Object, Exception> {
35
private final Callable c;
37
public CallableCallable(Callable c) {
41
public Object call() throws Exception {