org.qi4j.library.spring.importer

## Class SpringImporter

- java.lang.Object
- - org.qi4j.library.spring.importer.SpringImporter

- All Implemented Interfaces:
    ServiceImporter

      public class SpringImporter
      extends Object
      implements ServiceImporter

  Import a service from Spring. This assumes that the service has been imported into the assembly using the SpringImporterAssembler, so that the ApplicationContext is available as service meta-info.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpringImporter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `importService(ImportedServiceDescriptor serviceDescriptor)` Import a service from Spring by looking it up in the ApplicationContext.
    `boolean` | `isAvailable(Object instance)` Ask if the service is available or not.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### SpringImporter

          public SpringImporter()

  - ### Method Detail

    - #### importService

          public Object importService(ImportedServiceDescriptor serviceDescriptor)
                               throws ServiceImporterException

      Import a service from Spring by looking it up in the ApplicationContext.
      Specified by:
        `importService` in interface `ServiceImporter`
      Parameters:
        `serviceDescriptor` - The service descriptor.
      Returns:
        a service instance
      Throws:
        `ServiceImporterException` - if unable to import the service

    - #### isAvailable

          public boolean isAvailable(Object instance)

      Description copied from interface: `ServiceImporter`
      Ask if the service is available or not.
      Specified by:
        `isAvailable` in interface `ServiceImporter`
      Parameters:
        `instance` - the instance to be checked
      Returns:
        true if the service is available, false if not