Java 如何在应用程序上下文中排除刷新特定bean
当我调用可配置spring应用程序上下文的刷新方法时,我想将bean从刷新中排除Java 如何在应用程序上下文中排除刷新特定bean,java,spring,Java,Spring,当我调用可配置spring应用程序上下文的刷新方法时,我想将bean从刷新中排除 ConfigurableApplicationContext context = new FileSystemXmlApplicationContext(args[0]); for(int i=0; i<MAX ; i++) { context.refresh(); ... try { Thread.sleep(pause); } catch (I
ConfigurableApplicationContext context =
new FileSystemXmlApplicationContext(args[0]);
for(int i=0; i<MAX ; i++) {
context.refresh();
...
try {
Thread.sleep(pause);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
ConfigurableApplicationContext上下文=
新的FileSystemXmlApplicationContext(参数[0]);
对于(inti=0;i将bean放入另一个上下文文件,即spring-static-context.xml,不要将其包含到args数组中