public void doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig) { if (pluginBean.isReadableProperty(DO_WITH_SPRING)) { if (LOG.isDebugEnabled()) { LOG.debug("Plugin " + this + " is participating in Spring configuration..."); } Closure c = (Closure) plugin.getProperty(DO_WITH_SPRING); BeanBuilder bb = new BeanBuilder(getParentCtx(), springConfig, application.getClassLoader()); Binding b = new Binding(); b.setVariable("application", application); b.setVariable("manager", getManager()); b.setVariable("plugin", this); b.setVariable("parentCtx", getParentCtx()); b.setVariable("resolver", getResolver()); bb.setBinding(b); c.setDelegate(bb); bb.invokeMethod("beans", new Object[] {c}); } }
public BeanBuilder beans(Closure closure) { BeanBuilder bb = new BeanBuilder(getParentCtx(), new GroovyClassLoader(application.getClassLoader())); bb.invokeMethod("beans", new Object[] {closure}); return bb; }