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

This code example shows how to use the following methods:
 
 
	/** 
	 * Lazily creates an {@code MBeanServerConnection}. 
	 */ 
	private class MBeanServerConnectionLazyInitTargetSource extends AbstractLazyCreationTargetSource { 
 
		@Override 
		protected Object createObject() throws Exception { 
			return connector.getMBeanServerConnection(); 
		} 
 
		@Override 
		public Class<?> getTargetClass() { 
			return MBeanServerConnection.class; 
		} 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
 
	private class ReferenceTargetSource<T> extends AbstractLazyCreationTargetSource { 
 
		private AtomicReference<T> reference; 
 
		public ReferenceTargetSource(AtomicReference<T> reference) { 
			this.reference = reference; 
		} 
 
		@Override 
		protected Object createObject() throws Exception { 
			initialize(); 
			return reference.get(); 
		} 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
 * A Spring {@link FactoryBean} for lazily instantiating a serialized bean from 
 * a file as needed 
 *  
 * @author bdferris 
 */ 
public class SerializedLazyCreationTargetSource extends 
    AbstractLazyCreationTargetSource {
 
  private File _path;
  private String _initMethod;
 
  public void setPath(File path) {
    _path = path;
  } 
 
  public void setInitMethod(String method) {
    _initMethod = method;
  } 
 
  @Override 
4
CodeRank
This code example shows how to use the following methods:
     * 
     * @param serviceRegistry a {@link org.opennms.core.soa.ServiceRegistry} object. 
     * @param filter  
     * @param serviceInterface a {@link java.lang.Class} object. 
     */ 
    public ServiceRegistryTargetSource(ServiceRegistry serviceRegistry, String filter, Class<?> serviceInterface) { 
        m_serviceRegistry = serviceRegistry; 
        m_filter = filter; 
        m_serviceInterface = serviceInterface; 
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    protected Object createObject() throws Exception { 
        Object object = m_serviceRegistry.findProvider(m_serviceInterface, m_filter); 
        if (object == null) { 
            throw new IllegalStateException("Unable to find an object that implements '" +  
                    m_serviceInterface +  
                    (m_filter == null ? "'" : " matching filter "+m_filter)); 
        } 
4
CodeRank