code: public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
          if (thisMethod == null) {
              BeanLogger.LOG.methodHandlerProcessingReturningBeanInstance(self.getClass());
              if (beanInstance == null) {
                  throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
              }
              return beanInstance.getInstance();
          }
          BeanLogger.LOG.methodHandlerProcessingCall(thisMethod, self.getClass());
          if (thisMethod.getDeclaringClass().equals(TargetInstanceProxy.class)) {
              if (beanInstance == null) {
                  throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
              }
              if (thisMethod.getName().equals("weld_getTargetInstance")) {
                  return beanInstance.getInstance();
              } else if (thisMethod.getName().equals("weld_getTargetClass")) {
                  return beanInstance.getInstanceType();
              } else {
                  return null;
              }
          } else if (thisMethod.getName().equals("_initMH")) {
              BeanLogger.LOG.settingNewMethodHandler(args[0], self.getClass());
              return new ProxyMethodHandler(contextId, new TargetBeanInstance(args[0]), getBean());
          } else {
              if (beanInstance == null) {
                  throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
              }
              Object instance = beanInstance.getInstance();
              Object result = beanInstance.invoke(instance, thisMethod, args);
              // if the method returns this and the return type matches the proxy type, return the proxy instead
              // to prevent the bean instance escaping
              if (result != null && result == instance && (thisMethod.getReturnType().isAssignableFrom(self.getClass()))) {
                  return self;
              }
              return result;
          }
      }
docs: /* (non-Javadoc)
  @see javassist.util.proxy.MethodHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.reflect.Method, java.lang.Object[])