public abstract class

AbstractServiceLoaderBasedFactoryBean

extends AbstractFactoryBean<T>
implements BeanClassLoaderAware
java.lang.Object
   ↳ org.springframework.beans.factory.config.AbstractFactoryBean<T>
     ↳ org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
Known Direct Subclasses

Class Overview

Abstract base class for FactoryBeans operating on the JDK 1.6 java.util.ServiceLoader facility.

See Also

Summary

[Expand]
Inherited Fields
From class org.springframework.beans.factory.config.AbstractFactoryBean
Public Constructors
AbstractServiceLoaderBasedFactoryBean()
Public Methods
Class getServiceType()
Return the desired service type.
void setBeanClassLoader(ClassLoader beanClassLoader)
Callback that supplies the bean class loader to a bean instance.
void setServiceType(Class serviceType)
Specify the desired service type (typically the service's public API).
Protected Methods
Object createInstance()
abstract Object getObjectToExpose(ServiceLoader serviceLoader)
Determine the actual object to expose for the given ServiceLoader.
[Expand]
Inherited Methods
From class org.springframework.beans.factory.config.AbstractFactoryBean
From class java.lang.Object
From interface org.springframework.beans.factory.BeanClassLoaderAware
From interface org.springframework.beans.factory.BeanFactoryAware
From interface org.springframework.beans.factory.DisposableBean
From interface org.springframework.beans.factory.FactoryBean
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public AbstractServiceLoaderBasedFactoryBean ()

Also: SpringBeans

Public Methods

public Class getServiceType ()

Also: SpringBeans

Return the desired service type.

public void setBeanClassLoader (ClassLoader beanClassLoader)

Also: SpringBeans

Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's afterPropertiesSet() method or a custom init-method.

Parameters
beanClassLoader the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via getDefaultClassLoader()

public void setServiceType (Class serviceType)

Also: SpringBeans

Specify the desired service type (typically the service's public API).

Protected Methods

protected Object createInstance ()

Also: SpringBeans
Returns
  • the object to expose

protected abstract Object getObjectToExpose (ServiceLoader serviceLoader)

Also: SpringBeans

Determine the actual object to expose for the given ServiceLoader.

Left to concrete subclasses.

Parameters
serviceLoader the ServiceLoader for the configured service class
Returns
  • the object to expose