public class DuckTypingInvoker extends Object implements Invoker
Example:
public class LegacyDuck // Does not implement interface! { public void quack() { // Quacking logic... } } public interface Duck { public void quack(); } ObjectProvider targetProvider = new ConstantProvider(new LegacyDuck()); // Always returns a "legacy" duck DuckTypingInvoker invoker = new DuckTypingInvoker(targetProvider); Duck duck = ( Duck )proxyFactory.createInvokerProxy( invoker, new Class[] { Duck.class } );
Constructor and Description |
---|
DuckTypingInvoker(ObjectProvider<?> targetProvider)
Create a new DuckTypingInvoker instance.
|
public DuckTypingInvoker(ObjectProvider<?> targetProvider)
targetProvider
- Copyright © 2005–2014 The Apache Software Foundation. All rights reserved.