private Method getPreDestroyMethod(InjectionInfo injInfo, Class resourceClass) throws InjectionException { Method m = injInfo.getPreDestroyMethod(); if( m == null ) { String preDestroyMethodName = injInfo.getPreDestroyMethodName(); // Check for the method within the resourceClass only. // This does not include super-classses. for(Method next : resourceClass.getDeclaredMethods()) { // InjectionManager only handles injection into PreDestroy // methods with no arguments. if( next.getName().equals(preDestroyMethodName) && (next.getParameterTypes().length == 0) ) { m = next; injInfo.setPreDestroyMethod(m); break; } } } if( m == null ) { throw new InjectionException(localStrings.getLocalString( "injection-manager.predestroy-not-found", "InjectionManager exception. PreDestroy method: {0} not found in class: {1}", injInfo.getPreDestroyMethodName(), injInfo.getClassName())); } return m; }
envDescriptor.getInjectionInfoByClass(nextClass); if( injInfo.getPreDestroyMethodName() != null ) {
private Method getPreDestroyMethod(InjectionInfo injInfo, Class resourceClass) throws InjectionException { Method m = injInfo.getPreDestroyMethod(); if( m == null ) { String preDestroyMethodName = injInfo.getPreDestroyMethodName(); // Check for the method within the resourceClass only. // This does not include super-classses. for(Method next : resourceClass.getDeclaredMethods()) { // InjectionManager only handles injection into PreDestroy // methods with no arguments. if( next.getName().equals(preDestroyMethodName) && (next.getParameterTypes().length == 0) ) { m = next; injInfo.setPreDestroyMethod(m); break; } } } if( m == null ) { throw new InjectionException(localStrings.getLocalString( "injection-manager.predestroy-not-found", "InjectionManager exception. PreDestroy method: {0} not found in class: {1}", injInfo.getPreDestroyMethodName(), injInfo.getClassName())); } return m; }
envDescriptor.getInjectionInfoByClass(nextClass); if( injInfo.getPreDestroyMethodName() != null ) {