org.springframework.beans.factory.serviceloader

## 类 ServiceFactoryBean

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

- 所有已实现的接口:
    Aware, BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<Object>, InitializingBean

      public class ServiceFactoryBean
      extends AbstractServiceLoaderBasedFactoryBean
      implements BeanClassLoaderAware

  `FactoryBean` that exposes the 'primary' service for the configured service class, obtained through the JDK 1.6 `ServiceLoader` facility.
  从以下版本开始:
    2.5
  作者:
    Juergen Hoeller
  另请参阅:
    `ServiceLoader`

- - ### 字段概要

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

      `logger`

  - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected Object` | `getObjectToExpose(ServiceLoader<?> serviceLoader)` Determine the actual object to expose for the given ServiceLoader.
    `Class<?>` | `getObjectType()` This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

    - ### 从类继承的方法 org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean

      `createInstance, getServiceType, setBeanClassLoader, setServiceType`

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

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

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

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

    - ### 从接口继承的方法 org.springframework.beans.factory.BeanClassLoaderAware

      `setBeanClassLoader`

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

    - #### ServiceFactoryBean

          public ServiceFactoryBean()

  - ### 方法详细资料

    - #### getObjectToExpose

          protected Object getObjectToExpose(ServiceLoader<?> serviceLoader)

      从类复制的说明: `AbstractServiceLoaderBasedFactoryBean`
      Determine the actual object to expose for the given ServiceLoader.

      Left to concrete subclasses.

      指定者:
        `getObjectToExpose` 在类中 `AbstractServiceLoaderBasedFactoryBean`
      参数:
        `serviceLoader` - the ServiceLoader for the configured service class
      返回:
        the object to expose

    - #### getObjectType

          @Nullable
          public Class<?> getObjectType()

      从类复制的说明: `AbstractFactoryBean`
      This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
      指定者:
        `getObjectType` 在接口中 `FactoryBean<Object>`
      指定者:
        `getObjectType` 在类中 `AbstractFactoryBean<Object>`
      返回:
        the type of object that this FactoryBean creates, or `null` if not known at the time of the call
      另请参阅:
        `FactoryBean.getObjectType()`