org.springframework.osgi.service.importer
Class OsgiMultiServiceProxyFactoryBean

java.lang.Object
  extended by org.springframework.osgi.internal.service.importer.AbstractServiceImporter
      extended by org.springframework.osgi.service.importer.AbstractOsgiServiceProxyFactoryBean
          extended by org.springframework.osgi.service.importer.OsgiMultiServiceProxyFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, FactoryBean, InitializingBean, SmartFactoryBean, BundleContextAware, org.springframework.osgi.internal.service.ServiceImporter

public class OsgiMultiServiceProxyFactoryBean
extends AbstractOsgiServiceProxyFactoryBean

Specialized single-service proxy creator. Will return a proxy that will select only one OSGi service which matches the configuration criteria. If the selected service goes away, the proxy will search for a replacement.

Author:
Costin Leau
See Also:
Collection, List, Set, SortedSet

Nested Class Summary
static class OsgiMultiServiceProxyFactoryBean.CollectionOptions
          Enumeration style class used to specify the collection type that this FactoryBean should produce.
 
Field Summary
 
Fields inherited from class org.springframework.osgi.service.importer.AbstractOsgiServiceProxyFactoryBean
bundleContext, CARDINALITY_ATTRIBUTE, classLoader, contextClassloader, filter, FILTER_ATTRIBUTE, initialized, INTERFACE_ATTRIBUTE, listeners, OBJECTCLASS, serviceBeanName, serviceTypes, unifiedFilter
 
Fields inherited from class org.springframework.osgi.internal.service.importer.AbstractServiceImporter
depedencyListeners, mandatory
 
Constructor Summary
OsgiMultiServiceProxyFactoryBean()
           
 
Method Summary
protected  org.springframework.osgi.internal.service.ImporterProxy createMultiServiceCollection(Filter filter)
           
 void destroy()
           
 Object getObject()
          Subclasses have to implement this method and return the approapriate service proxy.
 Class getObjectType()
          Subclasses have to implement this method and return the approapriate service proxy type.
 boolean isSatisfied()
           
 void setCollectionType(int collectionType)
           
 void setComparator(Comparator comparator)
           
 
Methods inherited from class org.springframework.osgi.service.importer.AbstractOsgiServiceProxyFactoryBean
afterPropertiesSet, getUnifiedFilter, isEagerInit, isPrototype, isSingleton, setBeanClassLoader, setBeanName, setBundleContext, setContextClassloader, setFilter, setInterface, setListeners, setServiceBeanName
 
Methods inherited from class org.springframework.osgi.internal.service.importer.AbstractServiceImporter
isMandatory, registerListener, setMandatory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiMultiServiceProxyFactoryBean

public OsgiMultiServiceProxyFactoryBean()
Method Detail

getObject

public Object getObject()
Description copied from class: AbstractOsgiServiceProxyFactoryBean
Subclasses have to implement this method and return the approapriate service proxy.

Specified by:
getObject in interface FactoryBean
Specified by:
getObject in class AbstractOsgiServiceProxyFactoryBean

getObjectType

public Class getObjectType()
Description copied from class: AbstractOsgiServiceProxyFactoryBean
Subclasses have to implement this method and return the approapriate service proxy type.

Specified by:
getObjectType in interface FactoryBean
Specified by:
getObjectType in class AbstractOsgiServiceProxyFactoryBean

isSatisfied

public boolean isSatisfied()

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface DisposableBean
Specified by:
destroy in class AbstractOsgiServiceProxyFactoryBean
Throws:
Exception

createMultiServiceCollection

protected org.springframework.osgi.internal.service.ImporterProxy createMultiServiceCollection(Filter filter)

setComparator

public void setComparator(Comparator comparator)

setCollectionType

public void setCollectionType(int collectionType)


Copyright © 2006-2007 Spring Framework. All Rights Reserved.