public class OsgiServiceCollection extends java.lang.Object implements java.util.Collection, org.springframework.beans.factory.InitializingBean, CollectionProxy, org.springframework.beans.factory.DisposableBean
Collection| Modifier and Type | Class and Description |
|---|---|
private class |
OsgiServiceCollection.BaseListener
Listener tracking the OSGi services which form the dynamic collection.
|
private static class |
OsgiServiceCollection.EventResult |
protected class |
OsgiServiceCollection.OsgiServiceIterator
Read-only iterator wrapper around the dynamic collection iterator.
|
private class |
OsgiServiceCollection.ServiceInstanceListener |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.ClassLoader |
classLoader
TCCL to set between calling listeners
|
private org.osgi.framework.BundleContext |
context |
private OsgiServiceDependency |
dependency
dependency object
|
private java.lang.Object |
eventSource
dependable service importer
|
private org.osgi.framework.Filter |
filter |
private org.osgi.framework.ServiceListener |
listener |
private OsgiServiceLifecycleListener[] |
listeners |
private java.lang.Object |
lock |
private static org.apache.commons.logging.Log |
log |
private ServiceProxyCreator |
proxyCreator
Service proxy creator
|
private static org.apache.commons.logging.Log |
PUBLIC_LOGGER |
private boolean |
serviceRequiredAtStartup |
protected DynamicCollection<java.lang.Object> |
services
The dynamic collection.
|
protected java.util.Map<java.lang.Long,ProxyPlusCallback> |
servicesIdMap |
private java.lang.String |
sourceName
event source (importer) name
|
private java.util.List<ImporterStateListener> |
stateListeners
state listener
|
private boolean |
useBlueprintExceptions |
private boolean |
useServiceReferences
use references instead of instances inside the collection
|
| Constructor and Description |
|---|
OsgiServiceCollection(org.osgi.framework.Filter filter,
org.osgi.framework.BundleContext context,
java.lang.ClassLoader classLoader,
ServiceProxyCreator proxyCreator,
boolean useServiceReference) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Object o) |
boolean |
addAll(java.util.Collection c) |
void |
afterPropertiesSet() |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
protected DynamicCollection<java.lang.Object> |
createInternalDynamicStorage()
Create the dynamic storage used internally.
|
void |
destroy() |
private void |
invalidateProxy(ProxyPlusCallback ppc) |
boolean |
isEmpty() |
boolean |
isSatisfied()
Is the underlying proxy satisfied?
For dynamic, mandatory imports, this checks the service reference.
|
java.util.Iterator<java.lang.Object> |
iterator() |
protected void |
mandatoryServiceCheck()
Check to see whether at least one service is available.
|
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
boolean |
retainAll(java.util.Collection c) |
void |
setListeners(OsgiServiceLifecycleListener[] listeners) |
void |
setRequiredAtStartup(boolean serviceRequiredAtStartup) |
void |
setServiceImporter(java.lang.Object importer) |
void |
setServiceImporterName(java.lang.String name) |
void |
setStateListeners(java.util.List<ImporterStateListener> stateListeners) |
void |
setUseBlueprintExceptions(boolean useBlueprintExceptions) |
int |
size() |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] array) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprivate static final org.apache.commons.logging.Log log
private static final org.apache.commons.logging.Log PUBLIC_LOGGER
protected final java.util.Map<java.lang.Long,ProxyPlusCallback> servicesIdMap
protected DynamicCollection<java.lang.Object> services
private volatile boolean serviceRequiredAtStartup
private final org.osgi.framework.Filter filter
private final org.osgi.framework.BundleContext context
private final java.lang.ClassLoader classLoader
private final ServiceProxyCreator proxyCreator
private OsgiServiceLifecycleListener[] listeners
private final org.osgi.framework.ServiceListener listener
private java.util.List<ImporterStateListener> stateListeners
private final java.lang.Object lock
private OsgiServiceDependency dependency
private java.lang.Object eventSource
private java.lang.String sourceName
private final boolean useServiceReferences
private volatile boolean useBlueprintExceptions
public OsgiServiceCollection(org.osgi.framework.Filter filter,
org.osgi.framework.BundleContext context,
java.lang.ClassLoader classLoader,
ServiceProxyCreator proxyCreator,
boolean useServiceReference)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeanprotected void mandatoryServiceCheck()
public boolean isSatisfied()
CollectionProxyisSatisfied in interface CollectionProxyprotected DynamicCollection<java.lang.Object> createInternalDynamicStorage()
private void invalidateProxy(ProxyPlusCallback ppc)
public void setServiceImporter(java.lang.Object importer)
public void setServiceImporterName(java.lang.String name)
public java.util.Iterator<java.lang.Object> iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectionpublic int size()
size in interface java.util.Collectionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.Collectionpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.Collectionpublic void clear()
clear in interface java.util.Collectionpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.Collectionpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectionpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.Collectionpublic boolean isEmpty()
isEmpty in interface java.util.Collectionpublic java.lang.Object[] toArray()
toArray in interface java.util.Collectionpublic java.lang.Object[] toArray(java.lang.Object[] array)
toArray in interface java.util.Collectionpublic void setListeners(OsgiServiceLifecycleListener[] listeners)
listeners - The listeners to set.public void setRequiredAtStartup(boolean serviceRequiredAtStartup)
public void setStateListeners(java.util.List<ImporterStateListener> stateListeners)
public void setUseBlueprintExceptions(boolean useBlueprintExceptions)