KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > easymock > internal > JavaProxyFactory


1 /*
2  * Copyright (c) 2001-2005 OFFIS. This program is made available under the terms of
3  * the MIT License.
4  */

5 package org.easymock.internal;
6
7 import java.lang.reflect.InvocationHandler JavaDoc;
8 import java.lang.reflect.Proxy JavaDoc;
9
10 public class JavaProxyFactory<T> implements IProxyFactory<T> {
11     public T createProxy(Class JavaDoc<T> toMock, InvocationHandler JavaDoc handler) {
12         return (T) Proxy.newProxyInstance(toMock.getClassLoader(),
13                 new Class JavaDoc[] { toMock }, handler);
14     }
15 }
16
Popular Tags