/** * Adds methods requiring special implementations rather than just * delegation. * * @param proxyClassType the Javassist class description for the proxy type */ protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) { try { // Add special methods for interceptors for (Method method : LifecycleMixin.class.getMethods()) { BeanLogger.LOG.addingMethodToProxy(method); MethodInformation methodInfo = new RuntimeMethodInformation(method); createInterceptorBody(proxyClassType.addMethod(method), methodInfo, false, staticConstructor); } Method getInstanceMethod = TargetInstanceProxy.class.getMethod("weld_getTargetInstance"); Method getInstanceClassMethod = TargetInstanceProxy.class.getMethod("weld_getTargetClass"); generateGetTargetInstanceBody(proxyClassType.addMethod(getInstanceMethod)); generateGetTargetClassBody(proxyClassType.addMethod(getInstanceClassMethod)); Method setMethodHandlerMethod = ProxyObject.class.getMethod("weld_setHandler", MethodHandler.class); generateSetMethodHandlerBody(proxyClassType.addMethod(setMethodHandlerMethod)); Method getMethodHandlerMethod = ProxyObject.class.getMethod("weld_getHandler"); generateGetMethodHandlerBody(proxyClassType.addMethod(getMethodHandlerMethod)); } catch (Exception e) { throw new WeldException(e); } }
/** * Adds methods requiring special implementations rather than just * delegation. * * @param proxyClassType the Javassist class description for the proxy type */ protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) { try { // Add special methods for interceptors for (Method method : LifecycleMixin.class.getMethods()) { BeanLogger.LOG.addingMethodToProxy(method); MethodInformation methodInfo = new RuntimeMethodInformation(method); createInterceptorBody(proxyClassType.addMethod(method), methodInfo, false, staticConstructor); } Method getInstanceMethod = TargetInstanceProxy.class.getMethod("weld_getTargetInstance"); Method getInstanceClassMethod = TargetInstanceProxy.class.getMethod("weld_getTargetClass"); generateGetTargetInstanceBody(proxyClassType.addMethod(getInstanceMethod)); generateGetTargetClassBody(proxyClassType.addMethod(getInstanceClassMethod)); Method setMethodHandlerMethod = ProxyObject.class.getMethod("weld_setHandler", MethodHandler.class); generateSetMethodHandlerBody(proxyClassType.addMethod(setMethodHandlerMethod)); Method getMethodHandlerMethod = ProxyObject.class.getMethod("weld_getHandler"); generateGetMethodHandlerBody(proxyClassType.addMethod(getMethodHandlerMethod)); } catch (Exception e) { throw new WeldException(e); } }
/** * Adds methods requiring special implementations rather than just * delegation. * * @param proxyClassType the Javassist class description for the proxy type */ protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) { try { // Add special methods for interceptors for (Method method : LifecycleMixin.class.getMethods()) { BeanLogger.LOG.addingMethodToProxy(method); MethodInformation methodInfo = new RuntimeMethodInformation(method); createInterceptorBody(proxyClassType.addMethod(method), methodInfo, false, staticConstructor); } Method getInstanceMethod = TargetInstanceProxy.class.getMethod("weld_getTargetInstance"); Method getInstanceClassMethod = TargetInstanceProxy.class.getMethod("weld_getTargetClass"); generateGetTargetInstanceBody(proxyClassType.addMethod(getInstanceMethod)); generateGetTargetClassBody(proxyClassType.addMethod(getInstanceClassMethod)); Method setMethodHandlerMethod = ProxyObject.class.getMethod("weld_setHandler", MethodHandler.class); generateSetMethodHandlerBody(proxyClassType.addMethod(setMethodHandlerMethod)); Method getMethodHandlerMethod = ProxyObject.class.getMethod("weld_getHandler"); generateGetMethodHandlerBody(proxyClassType.addMethod(getMethodHandlerMethod)); } catch (Exception e) { throw new WeldException(e); } }
/** * Adds methods requiring special implementations rather than just * delegation. * * @param proxyClassType the Javassist class description for the proxy type */ protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) { try { // Add special methods for interceptors for (Method method : LifecycleMixin.class.getMethods()) { BeanLogger.LOG.addingMethodToProxy(method); MethodInformation methodInfo = new RuntimeMethodInformation(method); createInterceptorBody(proxyClassType.addMethod(method), methodInfo, false, staticConstructor); } Method getInstanceMethod = TargetInstanceProxy.class.getMethod("getTargetInstance"); Method getInstanceClassMethod = TargetInstanceProxy.class.getMethod("getTargetClass"); generateGetTargetInstanceBody(proxyClassType.addMethod(getInstanceMethod)); generateGetTargetClassBody(proxyClassType.addMethod(getInstanceClassMethod)); Method setMethodHandlerMethod = ProxyObject.class.getMethod("setHandler", MethodHandler.class); generateSetMethodHandlerBody(proxyClassType.addMethod(setMethodHandlerMethod)); Method getMethodHandlerMethod = ProxyObject.class.getMethod("getHandler"); generateGetMethodHandlerBody(proxyClassType.addMethod(getMethodHandlerMethod)); } catch (Exception e) { throw new WeldException(e); } }
/** * Adds methods requiring special implementations rather than just * delegation. * * @param proxyClassType the Javassist class description for the proxy type */ protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) { try { // Add special methods for interceptors for (Method method : LifecycleMixin.class.getMethods()) { BeanLogger.LOG.addingMethodToProxy(method); MethodInformation methodInfo = new RuntimeMethodInformation(method); createInterceptorBody(proxyClassType.addMethod(method), methodInfo, false, staticConstructor); } Method getInstanceMethod = TargetInstanceProxy.class.getMethod("weld_getTargetInstance"); Method getInstanceClassMethod = TargetInstanceProxy.class.getMethod("weld_getTargetClass"); generateGetTargetInstanceBody(proxyClassType.addMethod(getInstanceMethod)); generateGetTargetClassBody(proxyClassType.addMethod(getInstanceClassMethod)); Method setMethodHandlerMethod = ProxyObject.class.getMethod("weld_setHandler", MethodHandler.class); generateSetMethodHandlerBody(proxyClassType.addMethod(setMethodHandlerMethod)); Method getMethodHandlerMethod = ProxyObject.class.getMethod("weld_getHandler"); generateGetMethodHandlerBody(proxyClassType.addMethod(getMethodHandlerMethod)); } catch (Exception e) { throw new WeldException(e); } }
/** * Adds methods requiring special implementations rather than just * delegation. * * @param proxyClassType the Javassist class description for the proxy type */ protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) { try { // Add special methods for interceptors for (Method method : LifecycleMixin.class.getMethods()) { BeanLogger.LOG.addingMethodToProxy(method); MethodInformation methodInfo = new RuntimeMethodInformation(method); createInterceptorBody(proxyClassType.addMethod(method), methodInfo, false, staticConstructor); } Method getInstanceMethod = TargetInstanceProxy.class.getMethod("weld_getTargetInstance"); Method getInstanceClassMethod = TargetInstanceProxy.class.getMethod("weld_getTargetClass"); generateGetTargetInstanceBody(proxyClassType.addMethod(getInstanceMethod)); generateGetTargetClassBody(proxyClassType.addMethod(getInstanceClassMethod)); Method setMethodHandlerMethod = ProxyObject.class.getMethod("weld_setHandler", MethodHandler.class); generateSetMethodHandlerBody(proxyClassType.addMethod(setMethodHandlerMethod)); Method getMethodHandlerMethod = ProxyObject.class.getMethod("weld_getHandler"); generateGetMethodHandlerBody(proxyClassType.addMethod(getMethodHandlerMethod)); } catch (Exception e) { throw new WeldException(e); } }