private void populateLifeCycleMethods(Component c) { if (!c.methodsScanned) { c.methodsScanned = true; c.startMethods.clear(); c.stopMethods.clear(); List<Method> methods = getAllMethodsViaReflection(c.instance.getClass(), Start.class); for (Method m : methods) { PrioritizedMethod em = new PrioritizedMethod(); em.component = c; em.method = m; em.priority = m.getAnnotation(Start.class).priority(); c.startMethods.add(em); } methods = getAllMethodsViaReflection(c.instance.getClass(), Stop.class); for (Method m : methods) { PrioritizedMethod em = new PrioritizedMethod(); em.component = c; em.method = m; em.priority = m.getAnnotation(Stop.class).priority(); c.stopMethods.add(em); } } }