injInfo.getPostConstructMethodName(); throw new InjectionException ("InjectionManager exception. PostConstruct method " + injInfo.getPostConstructMethodName() + " could not be found in class " + injInfo.getClassName());
/** * <p>This is based off of code in <code>InjectionManagerImpl</code>.</p> * * @param instance managed bean instance * @param envDescriptor JNDI environment * @throws InjectionException if an error occurs */ private void invokePostConstruct(Object instance, JndiNameEnvironment envDescriptor) throws InjectionException { LinkedList<Method> postConstructMethods = new LinkedList<Method>(); Class<? extends Object> nextClass = instance.getClass(); // Process each class in the inheritance hierarchy, starting with // the most derived class and ignoring java.lang.Object. while ((!Object.class.equals(nextClass)) && (nextClass != null)) { InjectionInfo injInfo = envDescriptor.getInjectionInfoByClass(nextClass); if (injInfo.getPostConstructMethodName() != null) { Method postConstructMethod = getPostConstructMethod (injInfo, nextClass); // Invoke the preDestroy methods starting from // the least-derived class downward. postConstructMethods.addFirst(postConstructMethod); } nextClass = nextClass.getSuperclass(); } for (Method postConstructMethod : postConstructMethods) { invokeLifecycleMethod(postConstructMethod, instance); } }
if (injInfo.getPostConstructMethodName() != null) {
injInfo.getPostConstructMethodName(); throw new InjectionException ("InjectionManager exception. PostConstruct method " + injInfo.getPostConstructMethodName() + " could not be found in class " + injInfo.getClassName());
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; }
envDescriptor.getInjectionInfoByClass(nextClass); if (injInfo.getPostConstructMethodName() != null) {
envDescriptor.getInjectionInfoByClass(nextClass); if (injInfo.getPostConstructMethodName() != null) {
if( injInfo.getPostConstructMethodName() != null ) {
if( injInfo.getPostConstructMethodName() != null ) {