protected void appendDestroyMethod(ComponentDef componentDef, String methodName) { DestroyMethodDef destroyMethodDef = new DestroyMethodDefImpl(methodName); componentDef.addDestroyMethodDef(destroyMethodDef); } }
protected void appendDestroyMethod(ComponentDef componentDef, Method targetMethod) { DestroyMethodDef destroyMethodDef = new DestroyMethodDefImpl(targetMethod); componentDef.addDestroyMethodDef(destroyMethodDef); }
@Override public void appendDestroyMethodDef(AnnotationHandler annotationHandler, ComponentDef componentDef) { final Class<?> componentClass = componentDef.getComponentClass(); if (componentClass == null) { return; } for (final Method method : componentClass.getMethods()) { if (method.isBridge() || method.isSynthetic()) { continue; } final PreDestroy destroyMethod = method.getAnnotation(PreDestroy.class); if (destroyMethod == null) { continue; } if (method.getParameterTypes().length != 0) { throw new IllegalDestroyMethodAnnotationRuntimeException(componentClass, method.getName()); } if (!annotationHandler.isDestroyMethodRegisterable(componentDef, method.getName())) { continue; } componentDef.addDestroyMethodDef(newDestroyMethodDefImpl(method)); } }
@Override public void end(TagHandlerContext context, String body) { DestroyMethodDef methodDef = (DestroyMethodDef) context.pop(); processExpression(methodDef, body, "preDestroy", context); ComponentDef componentDef = (ComponentDef) context.peek(); componentDef.addDestroyMethodDef(methodDef); }
argDef = new ArgDefImpl(preparer); destroyMethodDef.addArgDef(argDef); componentDef.addDestroyMethodDef(destroyMethodDef);