protected void checkMethodAnnotation(Method method, Object instance) throws NamingException, IllegalAccessException, InvocationTargetException { if (method.isAnnotationPresent(Resource.class)) { Resource annotation = method.getAnnotation(Resource.class); lookupMethodResource(context, instance, method, annotation.name()); } }