public void destroy() { ClassPathXmlApplicationContext applicationContext = context; if (applicationContext != null) { context = null; applicationContext.destroy(); } }
@After public void tearDown() throws Exception { ctx.destroy(); }
@After public void tearDown() throws Exception { ctx.destroy(); }
public void run() { //重写Runnable中的run方法并在此销毁bean this.classPathXmlApplicationContext.destroy(); } }
@Override public void dispose() { if (applicationContext != null) { applicationContext.destroy(); applicationContext = null; } }
@Override public void visit(ClassPathXmlApplicationContext context) { context.destroy(); } });
protected void xreleaseClassPathContext() { final ApplicationContext cachedContext = _xcachedContext; if (cachedContext != null && cachedContext instanceof ClassPathXmlApplicationContext) { ((ClassPathXmlApplicationContext) cachedContext).destroy(); } }
@Override public void destroy() { beanFactory.markForDestroy(); super.destroy(); } }
public static void remove() { get().destroy(); CONTEXT.remove(); } }
@Override public void destroy() { super.destroy(); if (this.applicationContext != null) { this.applicationContext.destroy(); } } }
@Override public void destroy() { super.destroy(); cleanRpc(); }
@Override public void destroy() { super.destroy(); cleanRpc(); }
@Override public void addLibrary(Class libraryClass, ClassPathXmlApplicationContext context) throws Exception { Field field = ReflectionUtils.findField(libraryClass, "ROBOT_LIBRARY_SCOPE"); RobotScope scope = RobotScope.toRobotScope((String) field.get(libraryClass)); ClassPathXmlApplicationContext current = libraries.get(scope); if(current != null && current.isActive()) { current.destroy(); } else { libraries.put(scope, context); } }
@After public void destroySpringContext() { log.info( "destroy spring context" ); ctx.destroy(); }
@After public void destroySpringContext() { log.info( "destroy spring context" ); ctx.destroy(); }
@After public void destroySpringContext() { log.info( "destroy spring context" ); ctx.destroy(); }
@After public void destroySpringContext() { log.info( "destroy spring context" ); ctx.destroy(); }
@AfterClass public static void tearDownAfterClass() { appContext.destroy(); }
public void testMonitorAutowire() { ClassPathXmlApplicationContext ctx = getContext("console-monitor-autowire.xml"); ctx.start(); ctx.destroy(); } }
public void testMonitorAutowire() { ClassPathXmlApplicationContext ctx = getContext("monitoring-autowire.xml"); ctx.start(); try { String[] proxyCreator = ctx.getBeanNamesForType(BeanNameAutoProxyCreator.class); assertEquals(1, proxyCreator.length); String[] monitors = ctx.getBeanNamesForType(EtmMonitor.class); assertEquals(1, monitors.length); } finally { ctx.destroy(); } }