Package de.hybris.platform.commons.jalo
Class CommonsManager.ItemMethodInterceptor
java.lang.Object
de.hybris.platform.commons.jalo.CommonsManager.ItemMethodInterceptor
- All Implemented Interfaces:
JaloObjectCreator,net.sf.cglib.proxy.Callback,net.sf.cglib.proxy.CallbackFilter,net.sf.cglib.proxy.MethodInterceptor
- Enclosing class:
- CommonsManager
public static class CommonsManager.ItemMethodInterceptor
extends Object
implements net.sf.cglib.proxy.MethodInterceptor, JaloObjectCreator, net.sf.cglib.proxy.CallbackFilter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintTo keep the generated class light enough we define which methods we'd like to intercept here.protected ObjectCalled after the actual method call.protected Object[]Called before the actual method call.protected ObjectcreateInstance(Tenant tenant, BridgeInterface impl) Here we're creating a jalo item instance.final ObjectIntercepts all target method calls and wraps the actual call intobefore(Item, Method, Object[])andafter(Item, Method, Object[], Object[], Object).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.cglib.proxy.CallbackFilter
equals
-
Constructor Details
-
ItemMethodInterceptor
-
-
Method Details
-
intercept
public final Object intercept(Object obj, Method method, Object[] args, net.sf.cglib.proxy.MethodProxy methodproxy) throws Throwable Intercepts all target method calls and wraps the actual call intobefore(Item, Method, Object[])andafter(Item, Method, Object[], Object[], Object).- Specified by:
interceptin interfacenet.sf.cglib.proxy.MethodInterceptor- Throws:
Throwable
-
before
Called before the actual method call. It is possible to return different arguments here. By default this method simply returns the original arguments.- Parameters:
m- the methodargs- the original arguments- Returns:
- the arguments to be used for calling the actual method
-
after
Called after the actual method call. By default this method simply passes on the original result.- Parameters:
i- the itemm- the methodoriginalArgs- the original arguments before the callargs- the arguments used for the actual callreturned- the result of the actual call- Returns:
- the result to be returned as method call result
-
call
protected Object call(Item obj, Object[] args, net.sf.cglib.proxy.MethodProxy proxy) throws Throwable - Throws:
Throwable
-
createInstance
Here we're creating a jalo item instance. Later on it will be connected to its persistence delegate so don't try to invoke any business method here !- Specified by:
createInstancein interfaceJaloObjectCreator
-
accept
To keep the generated class light enough we define which methods we'd like to intercept here. This method maps untouched methods to 0 and all intercepted methods to 1 according to the configured callbacks inside ourEnhancer.- Specified by:
acceptin interfacenet.sf.cglib.proxy.CallbackFilter
-