org.springframework.beans.factory.serviceloader

## 类 AbstractServiceLoaderBasedFactoryBean

- java.lang.Object
- - org.springframework.beans.factory.config.AbstractFactoryBean<Object>
  - - org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean

- 所有已实现的接口:
    Aware, BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<Object>, InitializingBean
  直接已知子类:
    ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean

      public abstract class AbstractServiceLoaderBasedFactoryBean
      extends AbstractFactoryBean<Object>
      implements BeanClassLoaderAware

  Abstract base class for FactoryBeans operating on the JDK 1.6 `ServiceLoader` facility.
  从以下版本开始:
    2.5
  作者:
    Juergen Hoeller
  另请参阅:
    `ServiceLoader`

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.beans.factory.config.AbstractFactoryBean

      `logger`

  - ### 构造器概要

    构造器
    构造器和说明
    `AbstractServiceLoaderBasedFactoryBean()`

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected Object` | `createInstance()` Delegates to `getObjectToExpose(java.util.ServiceLoader)`.
    `protected abstract Object` | `getObjectToExpose(ServiceLoader<?> serviceLoader)` Determine the actual object to expose for the given ServiceLoader.
    `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).

    - ### 从类继承的方法 org.springframework.beans.factory.config.AbstractFactoryBean

      `afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, getObjectType, isSingleton, setBeanFactory, setSingleton`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### AbstractServiceLoaderBasedFactoryBean

          public AbstractServiceLoaderBasedFactoryBean()

  - ### 方法详细资料

    - #### setServiceType

          public void setServiceType(@Nullable
                                     Class<?> serviceType)

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

    - #### getServiceType

          @Nullable
          public Class<?> getServiceType()

      Return the desired service type.

    - #### setBeanClassLoader

          public void setBeanClassLoader(@Nullable
                                         ClassLoader beanClassLoader)

      从接口复制的说明: `BeanClassLoaderAware`
      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` `InitializingBean.afterPropertiesSet()` method or a custom init-method.

      指定者:
        `setBeanClassLoader` 在接口中 `BeanClassLoaderAware`
      覆盖:
        `setBeanClassLoader` 在类中 `AbstractFactoryBean<Object>`
      参数:
        `beanClassLoader` - the owning class loader

    - #### createInstance

          protected Object createInstance()

      Delegates to `getObjectToExpose(java.util.ServiceLoader)`.
      指定者:
        `createInstance` 在类中 `AbstractFactoryBean<Object>`
      返回:
        the object to expose
      另请参阅:
        `AbstractFactoryBean.getObject()`

    - #### getObjectToExpose

          protected abstract Object getObjectToExpose(ServiceLoader<?> serviceLoader)

      Determine the actual object to expose for the given ServiceLoader.

      Left to concrete subclasses.

      参数:
        `serviceLoader` - the ServiceLoader for the configured service class
      返回:
        the object to expose