Spring Framework AbstractFactoryBean - 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 AbstractFactoryBean class.

This code example shows how to use the following methods:
		Foo foo = beanFactory.getBean("fooFactory", Foo.class);
		assertNotNull(foo);
	} 
} 
 
class FooFactoryBean extends AbstractFactoryBean<Foo> {
	@Override 
	protected Foo createInstance() throws Exception {
		return new Foo(); 
	} 
 
	@Override 
	public Class<?> getObjectType() {
		return Foo.class; 
	} 
} 
 
class Foo { } 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
/** 
 * Factory bean for the resource details service. 
 * 
 * @author Ryan Heaton 
 */ 
public class ProtectedResourceDetailsServiceFactoryBean extends AbstractFactoryBean<ProtectedResourceDetailsService>  {
 
  @Override 
  public Class<? extends ProtectedResourceDetailsService> getObjectType() {
    return InMemoryProtectedResourceDetailsService.class; 
  } 
 
  @Override 
  protected ProtectedResourceDetailsService createInstance() throws Exception {
    Map<String, ProtectedResourceDetails> detailsMap = BeanFactoryUtils.beansOfTypeIncludingAncestors((ListableBeanFactory) getBeanFactory(),
                                                                                                           ProtectedResourceDetails.class); 
    InMemoryProtectedResourceDetailsService service = new InMemoryProtectedResourceDetailsService();
    service.setResourceDetailsStore(detailsMap);
    return service;
  } 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.beans.factory.config.AbstractFactoryBean; 
 
/** 
 * @author Brian Wing Shun Chan 
 */ 
public class DataSourceFactoryBean extends AbstractFactoryBean<DataSource> { 
 
	@Override 
	public DataSource createInstance() throws Exception { 
		Properties properties = _properties; 
 
		if (properties == null) { 
			properties = PropsUtil.getProperties(_propertyPrefix, true); 
		} 
		else { 
			properties = PropertiesUtil.getProperties( 
				properties, _propertyPrefix, true); 
		} 
 
		return DataSourceFactoryUtil.initDataSource(properties); 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.beans.factory.config.AbstractFactoryBean;
 
/** 
 * @author Brian Wing Shun Chan 
 */ 
public class MailSessionFactoryBean extends AbstractFactoryBean<Session> {
 
	@Override 
	public Class<Session> getObjectType() {
		return Session.class;
	} 
 
	public void setPropertyPrefix(String propertyPrefix) {
		_propertyPrefix = propertyPrefix;
	} 
 
	@Override 
	protected Session createInstance() throws Exception {
		Properties properties = PropsUtil.getProperties(_propertyPrefix, true);
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.apache.derby.jdbc.EmbeddedDataSource; 
import org.springframework.beans.factory.config.AbstractFactoryBean;
 
public class DerbyDataSourceFactoryBean extends AbstractFactoryBean<DataSource> {
 
	private String dataDirectory = "derby-home";
 
	public void setDataDirectory(String dataDirectory) {
		this.dataDirectory = dataDirectory;
	} 
 
	@Override 
	protected DataSource createInstance() throws Exception {
		File directory = new File(dataDirectory);
		System.setProperty("derby.system.home", directory.getCanonicalPath());
		System.setProperty("derby.storage.fileSyncTransactionLog", "true");
		System.setProperty("derby.storage.pageCacheSize", "100");
 
		final EmbeddedDataSource ds = new EmbeddedDataSource();
		ds.setDatabaseName("derbydb");
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	private final String expressionString;
 
	private volatile ExpressionParser parser = DEFAULT_PARSER;
 
 
	public ExpressionFactoryBean(String expressionString) {
		Assert.hasText(expressionString, "expressionString must not be empty or null");
		this.expressionString = expressionString;
	} 
 
 
	public void setParserConfiguration(SpelParserConfiguration parserConfiguration) {
		Assert.notNull(parserConfiguration, "parserConfiguration must not be null");
		this.parser = new SpelExpressionParser(parserConfiguration);
	} 
 
 
	@Override 
	public Class<?> getObjectType() {
		return Expression.class;
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package org; 
 
import org.springframework.beans.factory.config.AbstractFactoryBean; 
 
public class ImplementingInterfaceThroughExtendingTypeFromLibrary<T> extends AbstractFactoryBean<T> { 
 
	@Override 
	protected T createInstance() throws Exception { 
		return null; 
	} 
 
	@Override 
	public Class<?> getObjectType() { 
		return null; 
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	private final String expressionString;
 
	private volatile ExpressionParser parser = DEFAULT_PARSER;
 
 
	public ExpressionFactoryBean(String expressionString) {
		Assert.hasText(expressionString, "expressionString must not be empty or null");
		this.expressionString = expressionString;
	} 
 
 
	public void setParserConfiguration(SpelParserConfiguration parserConfiguration) {
		Assert.notNull(parserConfiguration, "parserConfiguration must not be null");
		this.parser = new SpelExpressionParser(parserConfiguration);
	} 
 
 
	@Override 
	public Class<?> getObjectType() {
		return Expression.class;
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
/** 
 * Builds an ObjectMapper configured with annotation support 
 *  
 * @author Eric Dalquist 
 */ 
public class ObjectMapperFactoryBean extends AbstractFactoryBean<ObjectMapper> { 
 
    @Override 
    public Class<?> getObjectType() { 
        return ObjectMapper.class; 
    } 
 
    @Override 
    protected ObjectMapper createInstance() throws Exception { 
        final ObjectMapper mapper = new ObjectMapper(); 
        mapper.findAndRegisterModules(); 
         
        return mapper; 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.beans.factory.config.AbstractFactoryBean;
 
import javax.jcr.Credentials; 
import javax.jcr.SimpleCredentials; 
 
public class WorkspaceManagerFactoryBean extends AbstractFactoryBean {
    private RepositoryImpl repository;
    private String login;
    private String password;
 
    @Required 
    public void setLogin(String login) {
        this.login = login;
    } 
 
    @Required 
    public void setPassword(String password) {
        this.password = password;
    } 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework AbstractFactoryBean Methods: