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 Details

    • ItemMethodInterceptor

      public ItemMethodInterceptor(Class<? extends Item> itemClass, Method... methods)
  • 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 into before(Item, Method, Object[]) and after(Item, Method, Object[], Object[], Object).
      Specified by:
      intercept in interface net.sf.cglib.proxy.MethodInterceptor
      Throws:
      Throwable
    • before

      protected Object[] before(Item p, Method m, Object[] args)
      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 method
      args - the original arguments
      Returns:
      the arguments to be used for calling the actual method
    • after

      protected Object after(Item i, Method m, Object[] originalArgs, Object[] args, Object returned)
      Called after the actual method call. By default this method simply passes on the original result.
      Parameters:
      i - the item
      m - the method
      originalArgs - the original arguments before the call
      args - the arguments used for the actual call
      returned - 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

      public BridgeAbstraction createInstance(Tenant tenant, BridgeInterface impl)
      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:
      createInstance in interface JaloObjectCreator
    • accept

      public int accept(Method method)
      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 our Enhancer.
      Specified by:
      accept in interface net.sf.cglib.proxy.CallbackFilter