Spring Framework StaticListableBeanFactory - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework StaticListableBeanFactory class.

This code example shows how to use the following methods:
 
 
	@Before 
	public void setup() { 
		registrar.setEndpointRegistry(registry); 
		registrar.setBeanFactory(new StaticListableBeanFactory()); 
	} 
 
	@Test 
	public void registerNullEndpoint() { 
		thrown.expect(IllegalArgumentException.class); 
		registrar.registerEndpoint(null, containerFactory); 
	} 
 
	@Test 
	public void registerNullEndpointId() { 
		thrown.expect(IllegalArgumentException.class); 
		registrar.registerEndpoint(new SimpleJmsListenerEndpoint(), containerFactory); 
	} 
 
7
CodeRank
This code example shows how to use the following methods:
		adapter.setHandlerMethod(factory.createInvocableHandlerMethod(sample, m));
		return adapter;
	} 
 
	private void initializeFactory(DefaultMessageHandlerMethodFactory factory) {
		factory.setBeanFactory(new StaticListableBeanFactory());
		factory.afterPropertiesSet();
	} 
 
 
	@SuppressWarnings("unused") 
	private static class SampleBean { 
 
		public Message<String> echo(Message<String> input) {
			return MessageBuilder.withPayload(input.getPayload()) 
					.setHeader(JmsHeaders.TYPE, "reply") 
					.build(); 
		} 
 
		public void fail(String input) {
6
CodeRank
This code example shows how to use the following methods:
 
 
	@Before 
	public void setup() { 
		registrar.setEndpointRegistry(registry); 
		registrar.setBeanFactory(new StaticListableBeanFactory()); 
	} 
 
	@Test 
	public void registerNullEndpoint() { 
		thrown.expect(IllegalArgumentException.class); 
		registrar.registerEndpoint(null, containerFactory); 
	} 
 
	@Test 
	public void registerNullEndpointId() { 
		thrown.expect(IllegalArgumentException.class); 
		registrar.registerEndpoint(new SimpleRabbitListenerEndpoint(), containerFactory); 
	} 
 
6
CodeRank
This code example shows how to use the following methods:
		return method;
	} 
 
 
	private void initializeFactory(DefaultMessageHandlerMethodFactory factory) {
		factory.setBeanFactory(new StaticListableBeanFactory());
		factory.afterPropertiesSet();
	} 
 
 
	static class RabbitEndpointSampleBean { 
 
		private final Map<String, Boolean> invocations = new HashMap<String, Boolean>();
 
		public void expectFooBarUpperCase(@Payload String msg) {
			invocations.put("expectFooBarUpperCase", true);
			assertEquals("Unexpected payload message", "FOO-BAR", msg);
		} 
	} 
 
6
CodeRank
This code example shows how to use the following methods:
		adapter.setHandlerMethod(factory.createInvocableHandlerMethod(sample, m));
		return adapter;
	} 
 
	private void initializeFactory(DefaultMessageHandlerMethodFactory factory) {
		factory.setBeanFactory(new StaticListableBeanFactory());
		factory.afterPropertiesSet();
	} 
 
	private static class SampleBean { 
 
		public Message<String> echo(Message<String> input) {
			return MessageBuilder.withPayload(input.getPayload()) 
					.setHeader(AmqpHeaders.TYPE, "reply") 
					.build(); 
		} 
 
		public void fail(String input) {
			throw new IllegalArgumentException("Expected test exception");
		} 
6
CodeRank
This code example shows how to use the following methods:
 * EL resolver for resolving Spring Beans accessible by a flow's bean factory. 
 * @author Jeremy Grelle 
 */ 
public class SpringBeanWebFlowELResolver extends SpringBeanELResolver { 
 
	private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory(); 
 
	private RequestContext requestContext; 
 
	public SpringBeanWebFlowELResolver() { 
	} 
 
	public SpringBeanWebFlowELResolver(RequestContext context) { 
		this.requestContext = context; 
	} 
 
	protected BeanFactory getBeanFactory(ELContext elContext) { 
		RequestContext requestContext = getRequestContext(); 
		if (requestContext == null) { 
			return EMPTY_BEAN_FACTORY; 
5
CodeRank
This code example shows how to use the following methods:
 * @author Rossen Stoyanchev 
 * @since 2.1 
 */ 
public class BeanFactoryPropertyAccessor implements PropertyAccessor { 
 
	private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory();
 
	public Class<?>[] getSpecificTargetClasses() {
		return null; 
	} 
 
	public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
		return getBeanFactory().containsBean(name);
	} 
 
	public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
		return new TypedValue(getBeanFactory().getBean(name));
	} 
 
	public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
5
CodeRank
This code example shows how to use the following methods:
		add(new BeanELResolver()); 
	} 
 
	private static class BeanELResolver extends SpringBeanELResolver { 
 
		private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory(); 
 
		protected BeanFactory getBeanFactory(ELContext elContext) { 
			RequestContext requestContext = RequestContextHolder.getRequestContext(); 
			if (requestContext == null) { 
				return EMPTY_BEAN_FACTORY; 
			} 
			BeanFactory beanFactory = requestContext.getActiveFlow().getApplicationContext(); 
			return beanFactory != null ? beanFactory : EMPTY_BEAN_FACTORY; 
		} 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
 *  
 * @author Phillip Webb 
 */ 
public class SpringFacesBeanELResolver extends SpringBeanELResolver { 
 
	private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory(); 
 
	@Override 
	protected BeanFactory getBeanFactory(ELContext elContext) { 
		if (SpringFacesContext.getCurrentInstance() == null) { 
			return EMPTY_BEAN_FACTORY; 
		} 
		return SpringFacesContext.getCurrentInstance().getWebApplicationContext(); 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
	/** 
	 * An extension of StaticListableBeanFactory that implements 
	 * AutowireCapableBeanFactory in order to allow bean initialization of 
	 * {@link ApplicationContextAware} singletons. 
	 */ 
	private class StubBeanFactory extends StaticListableBeanFactory implements AutowireCapableBeanFactory { 
 
		public Object initializeBean(Object existingBean, String beanName) throws BeansException { 
			if (existingBean instanceof ApplicationContextAware) { 
				((ApplicationContextAware) existingBean).setApplicationContext(MockWebApplicationContext.this); 
			} 
			return existingBean; 
		} 
 
		public <T> T createBean(Class<T> beanClass) throws BeansException { 
			throw new UnsupportedOperationException("Bean creation is not supported"); 
		} 
 
		@SuppressWarnings("rawtypes") 
		public Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException { 
3
CodeRank