Search in sources :

Example 1 with RealObject

use of com.sjh.thinkinginjava.classTest.proxy1.RealObject in project Java by Everything1sPossible.

the class SimpleDynamicProxy method main.

public static void main(String[] args) {
    RealObject realObject = new RealObject();
    consumer(realObject);
    Interface proxy = (Interface) Proxy.newProxyInstance(Interface.class.getClassLoader(), new Class[] { Interface.class }, new DynamicProxyHandler(realObject));
    consumer(proxy);
}
Also used : RealObject(com.sjh.thinkinginjava.classTest.proxy1.RealObject) Interface(com.sjh.thinkinginjava.classTest.proxy1.Interface)

Aggregations

Interface (com.sjh.thinkinginjava.classTest.proxy1.Interface)1 RealObject (com.sjh.thinkinginjava.classTest.proxy1.RealObject)1