@Test public void invokesDestroyMethods() throws Exception { lifecycleMethodStrategy.invokeDestroyMethods(new WithLifeCycleAnnotation()); assertTrue(String.format("Only \"destroy\" and \"nonPublicDestroy\" methods are expected to be invoked but %s were invoked", callAssertion), callAssertion.size() == 2 && callAssertion.containsAll(newArrayList("destroy", "nonPublicDestroy"))); }
@Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } AnnotatedLifecycleMethodStrategy(); }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } AnnotatedLifecycleMethodStrategy(); @Override void invokeInitializeMethods(Object o); @Override void invokeDestroyMethods(Object o); }
AnnotatedLifecycleMethodStrategy implements LifecycleMethodStrategy { @Override public void invokeDestroyMethods(Object o) { final Class<?> aClass = o.getClass(); Method[] destroyMethods = null; try { destroyMethods = destroyMethodsCache.get(aClass); } catch (ExecutionException e) { Throwables.propagate(e); } if (destroyMethods != null && destroyMethods.length > 0) { doInvokeLifecycleMethods(o, destroyMethods); } } AnnotatedLifecycleMethodStrategy(); @Override void invokeInitializeMethods(Object o); @Override void invokeDestroyMethods(Object o);  }