|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.osgi.internal.service.importer.AbstractServiceImporter
org.springframework.osgi.service.importer.AbstractOsgiServiceProxyFactoryBean
org.springframework.osgi.service.importer.OsgiSingleServiceProxyFactoryBean
public class OsgiSingleServiceProxyFactoryBean
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.
Field Summary | |
---|---|
protected org.springframework.osgi.internal.service.support.RetryTemplate |
retryTemplate
|
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 | |
---|---|
OsgiSingleServiceProxyFactoryBean()
|
Method Summary | |
---|---|
protected void |
addLocalBundleContextSupport(ProxyFactory factory)
Add the local bundle context support. |
protected void |
addOsgiRetryInterceptor(ProxyFactory factory,
Filter filter,
TargetSourceLifecycleListener[] listeners)
Add the retry interceptor and the ServiceReference aware mixin. |
protected ServiceReferenceAware |
createSingleServiceProxy(Class[] classes,
TargetSourceLifecycleListener[] listeners,
ClassLoader loader)
|
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 |
setRetryTimes(int maxRetries)
How many times should we attempt to rebind to a target service if the service we are currently using is unregistered. |
void |
setTimeout(long millisBetweenRetries)
How long should we wait between failed attempts at rebinding to a service that has been unregistered. |
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 |
Field Detail |
---|
protected org.springframework.osgi.internal.service.support.RetryTemplate retryTemplate
Constructor Detail |
---|
public OsgiSingleServiceProxyFactoryBean()
Method Detail |
---|
public void destroy() throws Exception
destroy
in interface DisposableBean
destroy
in class AbstractOsgiServiceProxyFactoryBean
Exception
public Object getObject()
AbstractOsgiServiceProxyFactoryBean
getObject
in interface FactoryBean
getObject
in class AbstractOsgiServiceProxyFactoryBean
public Class getObjectType()
AbstractOsgiServiceProxyFactoryBean
getObjectType
in interface FactoryBean
getObjectType
in class AbstractOsgiServiceProxyFactoryBean
public boolean isSatisfied()
protected ServiceReferenceAware createSingleServiceProxy(Class[] classes, TargetSourceLifecycleListener[] listeners, ClassLoader loader)
protected void addOsgiRetryInterceptor(ProxyFactory factory, Filter filter, TargetSourceLifecycleListener[] listeners)
factory
- filter
- listeners
- protected void addLocalBundleContextSupport(ProxyFactory factory)
factory
- public void setRetryTimes(int maxRetries)
maxRetries
- The maxRetries to set.public void setTimeout(long millisBetweenRetries)
millisBetweenRetries
- The millisBetweenRetries to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |