當前位置: 首頁>>代碼示例>>Java>>正文


Java StaticApplicationContext.close方法代碼示例

本文整理匯總了Java中org.springframework.context.support.StaticApplicationContext.close方法的典型用法代碼示例。如果您正苦於以下問題:Java StaticApplicationContext.close方法的具體用法?Java StaticApplicationContext.close怎麽用?Java StaticApplicationContext.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.context.support.StaticApplicationContext的用法示例。


在下文中一共展示了StaticApplicationContext.close方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testGoodConnection

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testGoodConnection() throws MqttException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    Assert.assertTrue(service.start());
    Assert.assertTrue(service.isConnected());
    Assert.assertTrue(service.isStarted());
    Assert.assertEquals(1, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(0, clientLostConnectionCount.get());
    Assert.assertEquals(0, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:25,代碼來源:AutomaticReconnectTest.java

示例2: taskExecutorByBeanType

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void taskExecutorByBeanType() {
	StaticApplicationContext context = new StaticApplicationContext();

	BeanDefinition processorDefinition = new RootBeanDefinition(AsyncAnnotationBeanPostProcessor.class);
	context.registerBeanDefinition("postProcessor", processorDefinition);

	BeanDefinition executorDefinition = new RootBeanDefinition(ThreadPoolTaskExecutor.class);
	executorDefinition.getPropertyValues().add("threadNamePrefix", "testExecutor");
	context.registerBeanDefinition("myExecutor", executorDefinition);

	BeanDefinition targetDefinition =
			new RootBeanDefinition(AsyncAnnotationBeanPostProcessorTests.TestBean.class);
	context.registerBeanDefinition("target", targetDefinition);

	context.refresh();

	ITestBean testBean = context.getBean("target", ITestBean.class);
	testBean.test();
	testBean.await(3000);
	Thread asyncThread = testBean.getThread();
	assertTrue(asyncThread.getName().startsWith("testExecutor"));
	context.close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:25,代碼來源:AsyncAnnotationBeanPostProcessorTests.java

示例3: listenersInApplicationContextWithPayloadEvents

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void listenersInApplicationContextWithPayloadEvents() {
	StaticApplicationContext context = new StaticApplicationContext();
	context.registerBeanDefinition("listener", new RootBeanDefinition(MyPayloadListener.class));
	context.refresh();

	MyPayloadListener listener = context.getBean("listener", MyPayloadListener.class);
	context.publishEvent("event1");
	context.publishEvent("event2");
	context.publishEvent("event3");
	context.publishEvent("event4");
	assertTrue(listener.seenPayloads.contains("event1"));
	assertTrue(listener.seenPayloads.contains("event2"));
	assertTrue(listener.seenPayloads.contains("event3"));
	assertTrue(listener.seenPayloads.contains("event4"));

	AbstractApplicationEventMulticaster multicaster = context.getBean(AbstractApplicationEventMulticaster.class);
	assertEquals(2, multicaster.retrieverCache.size());

	context.close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:22,代碼來源:ApplicationContextEventTests.java

示例4: listenersInApplicationContextWithNestedChild

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void listenersInApplicationContextWithNestedChild() {
	StaticApplicationContext context = new StaticApplicationContext();
	RootBeanDefinition nestedChild = new RootBeanDefinition(StaticApplicationContext.class);
	nestedChild.getPropertyValues().add("parent", context);
	nestedChild.setInitMethodName("refresh");
	context.registerBeanDefinition("nestedChild", nestedChild);
	RootBeanDefinition listener1Def = new RootBeanDefinition(MyOrderedListener1.class);
	listener1Def.setDependsOn("nestedChild");
	context.registerBeanDefinition("listener1", listener1Def);
	context.refresh();

	MyOrderedListener1 listener1 = context.getBean("listener1", MyOrderedListener1.class);
	MyEvent event1 = new MyEvent(context);
	context.publishEvent(event1);
	assertTrue(listener1.seenEvents.contains(event1));

	SimpleApplicationEventMulticaster multicaster = context.getBean(
			AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME,
			SimpleApplicationEventMulticaster.class);
	assertFalse(multicaster.getApplicationListeners().isEmpty());

	context.close();
	assertTrue(multicaster.getApplicationListeners().isEmpty());
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:26,代碼來源:ApplicationContextEventTests.java

示例5: nonSingletonListenerInApplicationContext

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void nonSingletonListenerInApplicationContext() {
	StaticApplicationContext context = new StaticApplicationContext();
	RootBeanDefinition listener = new RootBeanDefinition(MyNonSingletonListener.class);
	listener.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
	context.registerBeanDefinition("listener", listener);
	context.refresh();

	MyEvent event1 = new MyEvent(context);
	context.publishEvent(event1);
	MyOtherEvent event2 = new MyOtherEvent(context);
	context.publishEvent(event2);
	MyEvent event3 = new MyEvent(context);
	context.publishEvent(event3);
	MyOtherEvent event4 = new MyOtherEvent(context);
	context.publishEvent(event4);
	assertTrue(MyNonSingletonListener.seenEvents.contains(event1));
	assertTrue(MyNonSingletonListener.seenEvents.contains(event2));
	assertTrue(MyNonSingletonListener.seenEvents.contains(event3));
	assertTrue(MyNonSingletonListener.seenEvents.contains(event4));
	MyNonSingletonListener.seenEvents.clear();

	context.close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:25,代碼來源:ApplicationContextEventTests.java

示例6: testMqttConnectOptionsAutomaticReconnectDefaultServerAvailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testMqttConnectOptionsAutomaticReconnectDefaultServerAvailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    Assert.assertTrue(service.start());
    Assert.assertTrue(service.isConnected());
    Assert.assertTrue(service.isStarted());
    // simulate a lost connection
    CRUSHER_PROXY.reopen();
    Assert.assertFalse(service.isStarted());
    Assert.assertFalse(service.isConnected());
    Thread.sleep(1000);
    Assert.assertFalse(service.isStarted());
    Assert.assertFalse(service.isConnected());
    Assert.assertEquals(1, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(1, clientLostConnectionCount.get());
    Assert.assertEquals(0, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:33,代碼來源:AutomaticReconnectTest.java

示例7: testMqttConnectOptionsAutomaticReconnectFalseServerAvailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testMqttConnectOptionsAutomaticReconnectFalseServerAvailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    service.getMqttConnectOptions().setAutomaticReconnect(false);
    Assert.assertTrue(service.start());
    Assert.assertTrue(service.isConnected());
    Assert.assertTrue(service.isStarted());
    // simulate a lost connection
    CRUSHER_PROXY.reopen();
    Assert.assertFalse(service.isStarted());
    Assert.assertFalse(service.isConnected());
    Thread.sleep(1000);
    Assert.assertFalse(service.isStarted());
    Assert.assertFalse(service.isConnected());
    Assert.assertEquals(1, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(1, clientLostConnectionCount.get());
    Assert.assertEquals(0, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:34,代碼來源:AutomaticReconnectTest.java

示例8: testMqttConnectOptionsAutomaticReconnectTrueServerAvailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testMqttConnectOptionsAutomaticReconnectTrueServerAvailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    service.getMqttConnectOptions().setAutomaticReconnect(true);
    Assert.assertTrue(service.start());
    Assert.assertTrue(service.isConnected());
    Assert.assertTrue(service.isStarted());
    // simulate a lost connection
    CRUSHER_PROXY.reopen();
    Assert.assertFalse(service.isStarted());
    Assert.assertFalse(service.isConnected());
    Thread.sleep(1100);
    Assert.assertTrue(service.isConnected());
    Assert.assertTrue(service.isStarted());
    Assert.assertEquals(2, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(1, clientLostConnectionCount.get());
    Assert.assertEquals(0, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:34,代碼來源:AutomaticReconnectTest.java

示例9: testMqttConnectOptionsAutomaticReconnectDefaultServerUnavailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testMqttConnectOptionsAutomaticReconnectDefaultServerUnavailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    CRUSHER_PROXY.close();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    Assert.assertFalse(service.start());
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Thread.sleep(1000);
    CRUSHER_PROXY.open();
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Thread.sleep(1100);
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Assert.assertEquals(0, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(0, clientLostConnectionCount.get());
    Assert.assertEquals(1, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:34,代碼來源:AutomaticReconnectTest.java

示例10: testMqttConnectOptionsAutomaticReconnectFalseServerUnavailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testMqttConnectOptionsAutomaticReconnectFalseServerUnavailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    CRUSHER_PROXY.close();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    service.getMqttConnectOptions().setAutomaticReconnect(false);
    Assert.assertFalse(service.start());
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Thread.sleep(1000);
    CRUSHER_PROXY.open();
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Thread.sleep(1100);
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Assert.assertEquals(0, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(0, clientLostConnectionCount.get());
    Assert.assertEquals(1, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:35,代碼來源:AutomaticReconnectTest.java

示例11: testMqttConnectOptionsAutomaticReconnectTrueServerUnavailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testMqttConnectOptionsAutomaticReconnectTrueServerUnavailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    CRUSHER_PROXY.close();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    service.getMqttConnectOptions().setAutomaticReconnect(true);
    Assert.assertFalse(service.start());
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Thread.sleep(1000);
    CRUSHER_PROXY.open();
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Thread.sleep(1100);
    Assert.assertFalse(service.isStarted());
    Assert.assertFalse(service.isConnected());
    Thread.sleep(1100);
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    Assert.assertEquals(0, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(0, clientLostConnectionCount.get());
    Assert.assertEquals(1, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:38,代碼來源:AutomaticReconnectTest.java

示例12: testReconnectDetailsSetServerAvailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testReconnectDetailsSetServerAvailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    TaskScheduler taskScheduler = new ConcurrentTaskScheduler();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    service.setReconnectDetails(new DefaultReconnectService(), taskScheduler);
    Assert.assertTrue(service.start());
    Assert.assertTrue(service.isConnected());
    Assert.assertTrue(service.isStarted());
    // simulate a lost connection
    CRUSHER_PROXY.reopen();
    Assert.assertFalse(service.isStarted());
    Assert.assertFalse(service.isConnected());
    Thread.sleep(1100);
    Assert.assertTrue(service.isStarted());
    Assert.assertTrue(service.isConnected());
    Assert.assertEquals(2, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(1, clientLostConnectionCount.get());
    Assert.assertEquals(0, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:35,代碼來源:AutomaticReconnectTest.java

示例13: testReconnectDetailsSetServerUnavailableAtStartup

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testReconnectDetailsSetServerUnavailableAtStartup()
    throws MqttException, InterruptedException
{
    StaticApplicationContext applicationContext = getStaticApplicationContext();
    CRUSHER_PROXY.close();
    TaskScheduler taskScheduler = new ConcurrentTaskScheduler();
    MessageChannel inboundMessageChannel = new ExecutorSubscribableChannel();
    PahoAsyncMqttClientService service = new PahoAsyncMqttClientService(
        BrokerHelper.getProxyUri(), BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB,
        null);
    service.setApplicationEventPublisher(applicationContext);
    service.setInboundMessageChannel(inboundMessageChannel);
    service.subscribe(String.format("client/%s", BrokerHelper.getClientId()),
        MqttQualityOfService.QOS_0);
    service.getMqttConnectOptions().setCleanSession(true);
    service.setReconnectDetails(new DefaultReconnectService(), taskScheduler);
    Assert.assertFalse(service.start());
    Assert.assertFalse(service.isConnected());
    Assert.assertFalse(service.isStarted());
    CRUSHER_PROXY.open();
    Thread.sleep(3100);
    Assert.assertTrue(service.isConnected());
    Assert.assertTrue(service.isStarted());
    Assert.assertEquals(1, clientConnectedCount.get());
    Assert.assertEquals(0, clientDisconnectedCount.get());
    Assert.assertEquals(0, clientLostConnectionCount.get());
    Assert.assertEquals(1, clientFailedConnectionCount.get());
    service.stop();
    service.close();
    applicationContext.close();
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:33,代碼來源:AutomaticReconnectTest.java

示例14: taskExecutorByBeanName

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void taskExecutorByBeanName() {
	StaticApplicationContext context = new StaticApplicationContext();

	BeanDefinition processorDefinition = new RootBeanDefinition(AsyncAnnotationBeanPostProcessor.class);
	context.registerBeanDefinition("postProcessor", processorDefinition);

	BeanDefinition executorDefinition = new RootBeanDefinition(ThreadPoolTaskExecutor.class);
	executorDefinition.getPropertyValues().add("threadNamePrefix", "testExecutor");
	context.registerBeanDefinition("myExecutor", executorDefinition);

	BeanDefinition executorDefinition2 = new RootBeanDefinition(ThreadPoolTaskExecutor.class);
	executorDefinition2.getPropertyValues().add("threadNamePrefix", "testExecutor2");
	context.registerBeanDefinition("taskExecutor", executorDefinition2);

	BeanDefinition targetDefinition =
			new RootBeanDefinition(AsyncAnnotationBeanPostProcessorTests.TestBean.class);
	context.registerBeanDefinition("target", targetDefinition);

	context.refresh();

	ITestBean testBean = context.getBean("target", ITestBean.class);
	testBean.test();
	testBean.await(3000);
	Thread asyncThread = testBean.getThread();
	assertTrue(asyncThread.getName().startsWith("testExecutor2"));
	context.close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:29,代碼來源:AsyncAnnotationBeanPostProcessorTests.java

示例15: testMethodValidationPostProcessor

import org.springframework.context.support.StaticApplicationContext; //導入方法依賴的package包/類
@Test
public void testMethodValidationPostProcessor() {
	StaticApplicationContext ac = new StaticApplicationContext();
	ac.registerSingleton("mvpp", MethodValidationPostProcessor.class);
	MutablePropertyValues pvs = new MutablePropertyValues();
	pvs.add("beforeExistingAdvisors", false);
	ac.registerSingleton("aapp", AsyncAnnotationBeanPostProcessor.class, pvs);
	ac.registerSingleton("bean", MyValidBean.class);
	ac.refresh();
	doTestProxyValidation(ac.getBean("bean", MyValidInterface.class));
	ac.close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:13,代碼來源:MethodValidationTests.java


注:本文中的org.springframework.context.support.StaticApplicationContext.close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。