private DefaultMessageHandlerMethodFactory createInstance() { DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); factory.setBeanFactory(new StaticListableBeanFactory()); return factory; }
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
@Test public void testNoBeansOfType() { StaticListableBeanFactory lbf = new StaticListableBeanFactory(); lbf.addBean("foo", new Object()); Map<String, ?> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(lbf, ITestBean.class, true, false); assertTrue(beans.isEmpty()); }
@Before public void setup() { this.registrar.setEndpointRegistry(this.registry); this.registrar.setBeanFactory(new StaticListableBeanFactory()); }
@Test public void testFindsBeansOfTypeWithStaticFactory() { StaticListableBeanFactory lbf = new StaticListableBeanFactory(); TestBean t1 = new TestBean(); TestBean t2 = new TestBean(); DummyFactory t3 = new DummyFactory(); DummyFactory t4 = new DummyFactory(); t4.setSingleton(false); lbf.addBean("t1", t1); lbf.addBean("t2", t2); lbf.addBean("t3", t3); lbf.addBean("t4", t4); Map<String, ?> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(lbf, ITestBean.class, true, true); assertEquals(4, beans.size()); assertEquals(t1, beans.get("t1")); assertEquals(t2, beans.get("t2")); assertEquals(t3.getObject(), beans.get("t3")); assertTrue(beans.get("t4") instanceof TestBean); beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(lbf, DummyFactory.class, true, true); assertEquals(2, beans.size()); assertEquals(t3, beans.get("&t3")); assertEquals(t4, beans.get("&t4")); beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(lbf, FactoryBean.class, true, true); assertEquals(2, beans.size()); assertEquals(t3, beans.get("&t3")); assertEquals(t4, beans.get("&t4")); }
@Test public void testHierarchicalCountBeansWithNonHierarchicalFactory() { StaticListableBeanFactory lbf = new StaticListableBeanFactory(); lbf.addBean("t1", new TestBean()); lbf.addBean("t2", new TestBean()); assertTrue(BeanFactoryUtils.countBeansIncludingAncestors(lbf) == 2); }
protected JCacheOperationSource createOperationSource(CacheManager cacheManager, CacheResolver cacheResolver, CacheResolver exceptionCacheResolver, KeyGenerator keyGenerator) { DefaultJCacheOperationSource source = new DefaultJCacheOperationSource(); source.setCacheManager(cacheManager); source.setCacheResolver(cacheResolver); source.setExceptionCacheResolver(exceptionCacheResolver); source.setKeyGenerator(keyGenerator); source.setBeanFactory(new StaticListableBeanFactory()); source.afterSingletonsInstantiated(); return source; }
/** * Builds and initializes the target message receiver if necessary (if it's * null). Upon execution of this operation the receiver is fully functional * and is ready to receive messages. */ private synchronized void initializeIfNecessary(ProcessContext context, ProcessSession processSession) { if (this.messageReceiver == null) { this.processSession = processSession; this.messageReceiver = this.buildMessageReceiver(context); this.shouldSetDeleteFlag = context.getProperty(SHOULD_DELETE_MESSAGES).asBoolean(); int fetchSize = context.getProperty(FETCH_SIZE).evaluateAttributeExpressions().asInteger(); this.messageReceiver.setMaxFetchSize(fetchSize); this.messageReceiver.setJavaMailProperties(this.buildJavaMailProperties(context)); // need to avoid spring warning messages this.messageReceiver.setBeanFactory(new StaticListableBeanFactory()); this.messageReceiver.afterPropertiesSet(); this.messageQueue = new ArrayBlockingQueue<>(fetchSize); } }
targetDataSources.put("ISOLATION_REPEATABLE_READ", "ds2"); dsToUse.setDefaultTargetDataSource("ds1"); StaticListableBeanFactory beanFactory = new StaticListableBeanFactory(); beanFactory.addBean("ds1", dataSource1); beanFactory.addBean("ds2", dataSource2);
/** * Creates a new mock flow service locator. */ public MockFlowServiceLocator() { super(new FlowDefinitionRegistryImpl(), new StaticListableBeanFactory()); }
protected void setUp() { StaticListableBeanFactory beanFactory = new StaticListableBeanFactory(); beanFactory.addBean("bean", new Object()); model = new FlowModel(); }
protected void setUp() { StaticListableBeanFactory beanFactory = new StaticListableBeanFactory(); beanFactory.addBean("bean", new Object()); registry = new FlowModelRegistryImpl(); }
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
@Before public void setup() { registrar.setEndpointRegistry(registry); registrar.setBeanFactory(new StaticListableBeanFactory()); }
/** * Builds and initializes the target message receiver if necessary (if it's * null). Upon execution of this operation the receiver is fully functional * and is ready to receive messages. */ private synchronized void initializeIfNecessary(ProcessContext context, ProcessSession processSession) { if (this.messageReceiver == null) { this.processSession = processSession; this.messageReceiver = this.buildMessageReceiver(context); this.shouldSetDeleteFlag = context.getProperty(SHOULD_DELETE_MESSAGES).asBoolean(); int fetchSize = context.getProperty(FETCH_SIZE).evaluateAttributeExpressions().asInteger(); this.messageReceiver.setMaxFetchSize(fetchSize); this.messageReceiver.setJavaMailProperties(this.buildJavaMailProperties(context)); // need to avoid spring warning messages this.messageReceiver.setBeanFactory(new StaticListableBeanFactory()); this.messageReceiver.afterPropertiesSet(); this.messageQueue = new ArrayBlockingQueue<>(fetchSize); } }