Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
.addBeanPostProcessor(new ReferenceAnnotationBeanPostProcessor(applicationContext,
sofaRuntimeContext, bindingAdapterFactory, bindingConverterFactory));

// work on all bean on the beginning, then reorder after all bean post processors being registered
RuntimeShutdownAwarePostProcessor runtimeShutdownAwarePostProcessor = new RuntimeShutdownAwarePostProcessor(
sofaRuntimeContext.getSofaRuntimeManager());
beanFactory.addBeanPostProcessor(runtimeShutdownAwarePostProcessor);
beanFactory.registerSingleton(RuntimeShutdownAwarePostProcessor.class.getCanonicalName(),
runtimeShutdownAwarePostProcessor);
beanFactory.registerSingleton(RuntimeShutdownAwarePostProcessor.class.getSimpleName(),
new RuntimeShutdownAwarePostProcessor(sofaRuntimeContext.getSofaRuntimeManager()));

if (beanFactory instanceof AbstractAutowireCapableBeanFactory) {
((AbstractAutowireCapableBeanFactory) beanFactory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ public void testSofaRuntimeContextInject() {
Assert.assertNotNull(highOrderBeanPostProcessor.getSofaRuntimeContext());
}

@Test
public void testShutDownHook() throws Exception {
List<RuntimeShutdownAware> applicationShutdownAwares = getApplicationShutdownAwares();
Assert.assertNotNull(applicationShutdownAwares);
Assert.assertTrue(applicationShutdownAwares.contains(highOrderBeanPostProcessor));
}

@Test
@SuppressWarnings("unchecked")
public void testShutDownHookReordered() throws Exception {
Expand Down