throws InjectionException { Method m = injInfo.getPostConstructMethod();
throws InjectionException { Method m = injInfo.getPostConstructMethod();
private Method getPostConstructMethod(InjectionInfo injInfo, Class resourceClass) throws InjectionException { Method m = injInfo.getPostConstructMethod(); if( m == null ) { String postConstructMethodName = injInfo.getPostConstructMethodName(); // Check for the method within the resourceClass only. // This does not include super-classes. for(Method next : resourceClass.getDeclaredMethods()) { // InjectionManager only handles injection into PostConstruct // methods with no arguments. if( next.getName().equals(postConstructMethodName) && (next.getParameterTypes().length == 0) ) { m = next; injInfo.setPostConstructMethod(m); break; } } } if( m == null ) { throw new InjectionException(localStrings.getLocalString( "injection-manager.postconstruct-not-found", "InjectionManager exception. PostConstruct method: {0} not found in class: {1}", injInfo.getPostConstructMethodName(), injInfo.getClassName())); } return m; }
private Method getPostConstructMethod(InjectionInfo injInfo, Class resourceClass) throws InjectionException { Method m = injInfo.getPostConstructMethod(); if( m == null ) { String postConstructMethodName = injInfo.getPostConstructMethodName(); // Check for the method within the resourceClass only. // This does not include super-classes. for(Method next : resourceClass.getDeclaredMethods()) { // InjectionManager only handles injection into PostConstruct // methods with no arguments. if( next.getName().equals(postConstructMethodName) && (next.getParameterTypes().length == 0) ) { m = next; injInfo.setPostConstructMethod(m); break; } } } if( m == null ) { throw new InjectionException(localStrings.getLocalString( "injection-manager.postconstruct-not-found", "InjectionManager exception. PostConstruct method: {0} not found in class: {1}", injInfo.getPostConstructMethodName(), injInfo.getClassName())); } return m; }