public final class OsgiServiceProxyFactoryBean extends AbstractServiceImporterProxyFactoryBean implements org.springframework.context.ApplicationEventPublisherAware
| Modifier and Type | Class and Description |
|---|---|
private class |
OsgiServiceProxyFactoryBean.Executor
Wrapper around internal commands.
|
| Modifier and Type | Field and Description |
|---|---|
private org.springframework.context.ApplicationEventPublisher |
applicationEventPublisher
application publisher
|
private ImporterInternalActions |
controller |
private java.lang.Runnable |
destructionCallback
proxy infrastructure hook exposed to allow clean up
|
private java.lang.Runnable |
initializationCallback |
private static org.apache.commons.logging.Log |
log |
private boolean |
mandatory
convenience field *
|
private java.lang.Object |
monitor |
private ImportedOsgiServiceProxy |
proxy
proxy cast to a specific interface to allow specific method calls
|
private RetryTemplate |
retryTemplate |
private long |
retryTimeout |
private java.util.List<ImporterStateListener> |
stateListeners
internal listeners
|
private boolean |
sticky |
| Constructor and Description |
|---|
OsgiServiceProxyFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
private OsgiServiceLifecycleListener[] |
addListener(OsgiServiceLifecycleListener[] listeners,
OsgiServiceLifecycleListener listener)
Add the given listener to the array but in the first position.
|
void |
afterPropertiesSet() |
(package private) java.lang.Object |
createProxy(boolean lazyProxy)
Creates the proxy tracking the matching OSGi services.
|
(package private) Cardinality |
getInternalCardinality() |
java.lang.Object |
getObject()
Returns a managed object for accessing OSGi service(s).
|
(package private) java.lang.Runnable |
getProxyDestructionCallback()
Returns the destruction callback associated with the proxy created by this object.
|
(package private) java.lang.Runnable |
getProxyInitializer()
Returns a callback to the proxy which gets called when the proxy is called for the first time, if a lazy creation
was used.
|
long |
getTimeout()
Returns the timeout (in milliseconds) this importer waits while trying to find a backing service.
|
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setSticky(boolean sticky)
Sets the stickiness of this proxy.
|
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.
|
destroy, getAopClassLoader, getObjectType, isBlueprintCompliant, isEagerInit, isPrototype, isSingleton, isUseBlueprintExceptions, setBeanClassLoader, setBlueprintCompliant, setUseBlueprintExceptionsgetAvailability, getBeanClassLoader, getBeanName, getBundleContext, getCardinality, getContextClassLoader, getFilter, getImportContextClassLoader, getInterfaces, getListeners, getUnifiedFilter, setAvailability, setBeanName, setBundleContext, setCardinality, setContextClassLoader, setFilter, setImportContextClassLoader, setInterfaces, setListeners, setServiceBeanNameprivate static final org.apache.commons.logging.Log log
private long retryTimeout
private RetryTemplate retryTemplate
private ImportedOsgiServiceProxy proxy
private java.lang.Runnable destructionCallback
private java.lang.Runnable initializationCallback
private org.springframework.context.ApplicationEventPublisher applicationEventPublisher
private final java.util.List<ImporterStateListener> stateListeners
private final ImporterInternalActions controller
private volatile boolean mandatory
private volatile boolean sticky
private final java.lang.Object monitor
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class AbstractServiceImporterProxyFactoryBeanpublic java.lang.Object getObject()
getObject in interface org.springframework.beans.factory.FactoryBean<java.lang.Object>getObject in class AbstractServiceImporterProxyFactoryBeanjava.lang.Object createProxy(boolean lazyProxy)
AbstractServiceImporterProxyFactoryBeancreateProxy in class AbstractServiceImporterProxyFactoryBeanlazyProxy - indicates whether the proxy is lazy (no code is executed in the proxy) or notAbstractServiceImporterProxyFactoryBean.getProxyDestructionCallback()java.lang.Runnable getProxyInitializer()
AbstractServiceImporterProxyFactoryBeangetProxyInitializer in class AbstractServiceImporterProxyFactoryBeanjava.lang.Runnable getProxyDestructionCallback()
AbstractServiceImporterProxyFactoryBeanFactoryBean.getProxyDestructionCallback in class AbstractServiceImporterProxyFactoryBean#createProxy()private OsgiServiceLifecycleListener[] addListener(OsgiServiceLifecycleListener[] listeners, OsgiServiceLifecycleListener listener)
listeners - listener - public void setTimeout(long timeoutInMillis)
timeoutInMillis - Timeout to set, in millisecondspublic long getTimeout()
public void setSticky(boolean sticky)
sticky - sticky flagpublic void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwareCardinality getInternalCardinality()
getInternalCardinality in class AbstractOsgiServiceImportFactoryBean