Package org.alfresco.traitextender
Class AJProxyTrait
- java.lang.Object
-
- org.alfresco.traitextender.AJProxyTrait
-
- All Implemented Interfaces:
InvocationHandler
public class AJProxyTrait extends Object implements InvocationHandler
JavaProxyInvocationHandlerto be used in conjuction with asprctJ extended traits.
Method calls will be delegated to a givenExtensibleobject method having the same signature within anAJExtender.ExtensionBypasscontext.- Author:
- Bogdan Horje
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <M extends Trait>
Mcreate(Object extensibleInterface, Class<M> traitAPI)Objectinvoke(Object proxy, Method method, Object[] args)StringtoString()
-
-
-
Method Detail
-
create
public static <M extends Trait> M create(Object extensibleInterface, Class<M> traitAPI)
- Parameters:
extensible- theExtensibleobject that defines the givenTraittraitAPI- the trait interface part that the givenExtensibleobject defines- Returns:
- a
Proxyobject for the given trait API interface with anAJProxyTraitattached. All method calls performed on the returned proxy will be delegated to a givenExtensibleobject method having the same signature within anAJExtender.ExtensionBypasscontext.
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
-