|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.osgi.service.importer.support.AbstractOsgiServiceImportFactoryBean org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean
public final class OsgiServiceProxyFactoryBean
OSGi (single) service importer. This implementation creates a managed OSGi service proxy that handles the OSGi service dynamics. The returned proxy will select only the best matching OSGi service for the configuration criteria. If the select service goes away (at any point in time), the proxy will automatically search for a replacement without the user intervention.
Note that the proxy instance remains the same and only the backing OSGi service changes. Due to the dynamic nature of OSGi, the backing object can change during method invocations.
Constructor Summary | |
---|---|
OsgiServiceProxyFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
void |
destroy()
|
Object |
getObject()
Returns a managed object for accessing OSGi service(s). Returns a managed proxy to the best matching OSGi service. |
Class |
getObjectType()
Returns the managed proxy type. |
long |
getTimeout()
Returns the timeout (in milliseconds) this importer waits while trying to find a backing service. |
boolean |
isEagerInit()
The object created by this factory bean is eagerly initialized. |
boolean |
isPrototype()
The object returned by this FactoryBean is a not a prototype. |
boolean |
isSingleton()
The object managed by this factory is a singleton. |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
|
void |
setBeanClassLoader(ClassLoader classLoader)
This method is called automatically by the container. The class will automatically chain this classloader with the AOP infrastructure classes (even if these are not visible to the user) so that the proxy creation can be completed successfully. |
void |
setCardinality(Cardinality cardinality)
Sets the importer cardinality (0..1, 1..1, 0..N, or 1..N). Since this implementation creates a managed proxy, only single cardinalities are accepted. |
void |
setTimeout(long timeoutInMillis)
Sets how long (in milliseconds) should this importer wait between failed attempts at rebinding to a service that has been unregistered. |
Methods inherited from class org.springframework.osgi.service.importer.support.AbstractOsgiServiceImportFactoryBean |
---|
getBeanClassLoader, getBeanName, getBundleContext, getCardinality, getContextClassLoader, getFilter, getInterfaces, getListeners, getUnifiedFilter, setBeanName, setBundleContext, setContextClassLoader, setFilter, setInterfaces, setListeners, setServiceBeanName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OsgiServiceProxyFactoryBean()
Method Detail |
---|
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public Class getObjectType()
getObjectType
in interface FactoryBean
public Object getObject()
getObject
in interface FactoryBean
public void setTimeout(long timeoutInMillis)
timeoutInMillis
- Timeout to set, in millisecondspublic long getTimeout()
public void setCardinality(Cardinality cardinality)
setCardinality
in class AbstractOsgiServiceImportFactoryBean
cardinality
- importer cardinality.public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
public boolean isSingleton()
isSingleton
in interface FactoryBean
public boolean isEagerInit()
isEagerInit
in interface SmartFactoryBean
public boolean isPrototype()
isPrototype
in interface SmartFactoryBean
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
setBeanClassLoader
in class AbstractOsgiServiceImportFactoryBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |