Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.gemini.blueprint.service.importer.support
Class AbstractOsgiServiceImportFactoryBean

    java.lang.Object
      org.eclipse.gemini.blueprint.service.importer.support.AbstractOsgiServiceImportFactoryBean

All Implemented Interfaces:
  BundleContextAware, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.InitializingBean

Direct Known Subclasses:
  OsgiServiceCollectionProxyFactoryBean, OsgiServiceProxyFactoryBean

    public abstract class AbstractOsgiServiceImportFactoryBean

extends Object
implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, BundleContextAware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanNameAware

Base class for importing OSGi services. Provides the common properties and contracts between importers.

Author:
  Costin Leau, Adrian Colyer, Hal Hildebrand

Constructor Summary
`AbstractOsgiServiceImportFactoryBean()`

Method Summary
`void` | `afterPropertiesSet()`
`Availability` | `getAvailability()`
`ClassLoader` | `getBeanClassLoader()` Returns the class loader used by this FactoryBean.
`String` | `getBeanName()` Returns the bean name associated with the instance of this class (when running inside the Spring container).
`org.osgi.framework.BundleContext` | `getBundleContext()` Returns the bundleContext used by this FactoryBean.
`Cardinality` | `getCardinality()` Deprecated. As of Spring DM 2.0, replaced by `getAvailability()`
`ImportContextClassLoader` | `getContextClassLoader()` Deprecated. As of Spring DM 2.0, replaced by `getImportContextClassLoader()`
`String` | `getFilter()` Returns the filter describing the imported service(s).
`ImportContextClassLoaderEnum` | `getImportContextClassLoader()` Returns the context class loader management strategy.
`Class<?>[]` | `getInterfaces()` Returns the interfaces used for discovering the imported service(s).
`OsgiServiceLifecycleListener[]` | `getListeners()` Returns the listeners interested in receiving events for this importer.
`org.osgi.framework.Filter` | `getUnifiedFilter()` Assembles the configuration properties into one unified OSGi filter.
`void` | `setAvailability(Availability availability)` Sets the importer availability.
`void` | `setBeanClassLoader(ClassLoader classLoader)` This method is called automatically by the container.
`void` | `setBeanName(String name)`
`void` | `setBundleContext(org.osgi.framework.BundleContext context)` Set the `BundleContext` that this bean runs in.
`void` | `setCardinality(Cardinality cardinality)` Deprecated. As of Spring DM 2.0, replaced by `setAvailability(Availability)`
`void` | `setContextClassLoader(ImportContextClassLoader contextClassLoader)` Deprecated. As of Spring DM 2.0, replaced by `#setImportContextClassLoader(ImportContextClassLoaderEnum))`
`void` | `setFilter(String filter)` Sets the OSGi service filter.
`void` | `setImportContextClassLoader(ImportContextClassLoaderEnum contextClassLoader)` Sets the thread context class loader management strategy to use for services imported by this service.
`void` | `setInterfaces(Class<?>[] interfaces)` Sets the classes that the imported service advertises.
`void` | `setListeners(OsgiServiceLifecycleListener[] listeners)` Sets the lifecycle listeners interested in receiving events for this importer.
`void` | `setServiceBeanName(String serviceBeanName)` Sets the OSGi service bean name.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.springframework.beans.factory.FactoryBean
`getObject, getObjectType, isSingleton`

Methods inherited from interface org.springframework.beans.factory.DisposableBean
`destroy`

Constructor Detail

### AbstractOsgiServiceImportFactoryBean

    public AbstractOsgiServiceImportFactoryBean()

Method Detail

### afterPropertiesSet

    public void afterPropertiesSet()

  Specified by:
    `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`

### getUnifiedFilter

    public org.osgi.framework.Filter getUnifiedFilter()

  Assembles the configuration properties into one unified OSGi filter. Note that this implementation creates the filter on the first call and caches it afterwards.

  Returns:
    unified filter based on this factory bean configuration

### setInterfaces

    public void setInterfaces(Class<?>[] interfaces)

  Sets the classes that the imported service advertises.

  Parameters:
    `interfaces` - array of advertised classes.

### setContextClassLoader

    public void setContextClassLoader(ImportContextClassLoader contextClassLoader)

  Deprecated. As of Spring DM 2.0, replaced by `#setImportContextClassLoader(ImportContextClassLoaderEnum))`

  Sets the thread context class loader management strategy to use for services imported by this service. By default `ImportContextClassLoader.CLIENT` is used.

  Parameters:
    `contextClassLoader` - import context class loader management strategy
  See Also:
    `ImportContextClassLoader`

### setImportContextClassLoader

    public void setImportContextClassLoader(ImportContextClassLoaderEnum contextClassLoader)

  Sets the thread context class loader management strategy to use for services imported by this service. By default `ImportContextClassLoaderEnum.CLIENT` is used.

  Parameters:
    `contextClassLoader` - import context class loader management strategy
  See Also:
    `ImportContextClassLoader`

### setBundleContext

    public void setBundleContext(org.osgi.framework.BundleContext context)

  Description copied from interface: `BundleContextAware`
  Set the `BundleContext` that this bean runs in. Normally this can be used to initialize an object.

  Specified by:
    `setBundleContext` in interface `BundleContextAware`
  Parameters:
    `context` - the `BundleContext` object to be used by this object

### setFilter

    public void setFilter(String filter)

  Sets the OSGi service filter. The filter will be concatenated with the rest of the configuration properties specified (such as interfaces) so there is no need to include them in the filter.

  Parameters:
    `filter` - OSGi filter describing the importing OSGi service

### setListeners

    public void setListeners(OsgiServiceLifecycleListener[] listeners)

  Sets the lifecycle listeners interested in receiving events for this importer.

  Parameters:
    `listeners` - importer listeners

### setServiceBeanName

    public void setServiceBeanName(String serviceBeanName)

  Sets the OSGi service bean name. This setting should be normally used when the imported service has been exported by Spring DM exporter. You may specify additional filtering criteria if needed (using the filter property) but this is not required.

  Parameters:
    `serviceBeanName` - importer service bean name

### setBeanClassLoader

    public void setBeanClassLoader(ClassLoader classLoader)

  This method is called automatically by the container.

  Specified by:
    `setBeanClassLoader` in interface `org.springframework.beans.factory.BeanClassLoaderAware`

### getBeanClassLoader

    public ClassLoader getBeanClassLoader()

  Returns the class loader used by this FactoryBean.

  Returns:
    factory bean class loader

### getBundleContext

    public org.osgi.framework.BundleContext getBundleContext()

  Returns the bundleContext used by this FactoryBean.

  Returns:
    factory bean class loader

### getInterfaces

    public Class<?>[] getInterfaces()

  Returns the interfaces used for discovering the imported service(s).

  Returns:
    interfaces advertised by services in the OSGi space

### getFilter

    public String getFilter()

  Returns the filter describing the imported service(s).

  Returns:
    filter describing the imported service(s)

### getListeners

    public OsgiServiceLifecycleListener[] getListeners()

  Returns the listeners interested in receiving events for this importer.

  Returns:
    lifecycle listeners used by this importer

### getContextClassLoader

    public ImportContextClassLoader getContextClassLoader()

  Deprecated. As of Spring DM 2.0, replaced by `getImportContextClassLoader()`

  Returns the context class loader management strategy.

  Returns:
    the context class loader management strategy

### getImportContextClassLoader

    public ImportContextClassLoaderEnum getImportContextClassLoader()

  Returns the context class loader management strategy.

  Returns:
    the context class loader management strategy

### getCardinality

    public Cardinality getCardinality()

  Deprecated. As of Spring DM 2.0, replaced by `getAvailability()`

  Returns the cardinality used by this importer.

  Returns:
    importer cardinality

### getAvailability

    public Availability getAvailability()

### setCardinality

    public void setCardinality(Cardinality cardinality)

  Deprecated. As of Spring DM 2.0, replaced by `setAvailability(Availability)`

  Sets the importer cardinality (0..1, 1..1, 0..N, or 1..N). Default is 1..X.

  Parameters:
    `cardinality` - importer cardinality.

### setAvailability

    public void setAvailability(Availability availability)

  Sets the importer availability. Default is mandatory (`Availability.MANDATORY`

  Parameters:
    `availability` -

### getBeanName

    public String getBeanName()

  Returns the bean name associated with the instance of this class (when running inside the Spring container).

  Returns:
    component bean name

### setBeanName

    public void setBeanName(String name)

  Specified by:
    `setBeanName` in interface `org.springframework.beans.factory.BeanNameAware`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2012. All Rights Reserved.