public abstract class AbstractServiceReferenceRecipe extends AbstractRecipe implements org.osgi.framework.ServiceListener, SatisfiableRecipe
Modifier and Type | Class and Description |
---|---|
static class |
AbstractServiceReferenceRecipe.Listener |
SatisfiableRecipe.SatisfactionListener
Modifier and Type | Field and Description |
---|---|
protected ExtendedBlueprintContainer |
blueprintContainer |
protected List<Recipe> |
explicitDependencies |
protected String |
filter
The OSGi filter for tracking references
|
protected ValueRecipe |
filterRecipe |
protected List<AbstractServiceReferenceRecipe.Listener> |
listeners
The list of listeners for this reference.
|
protected CollectionRecipe |
listenersRecipe |
protected org.osgi.service.blueprint.reflect.ServiceReferenceMetadata |
metadata |
protected boolean |
optional |
name, prototype
Modifier | Constructor and Description |
---|---|
protected |
AbstractServiceReferenceRecipe(String name,
ExtendedBlueprintContainer blueprintContainer,
org.osgi.service.blueprint.reflect.ServiceReferenceMetadata metadata,
ValueRecipe filterRecipe,
CollectionRecipe listenersRecipe,
List<Recipe> explicitDependencies) |
Modifier and Type | Method and Description |
---|---|
protected void |
bind(org.osgi.framework.ServiceReference reference,
Object service) |
protected void |
createListeners() |
protected Object |
createProxy(Callable<Object> dispatcher,
Set<Class<?>> interfaces) |
protected void |
doStop() |
org.osgi.framework.ServiceReference |
getBestServiceReference() |
protected org.osgi.framework.BundleContext |
getBundleContextForServiceLookup() |
List<Recipe> |
getConstructorDependencies()
Get the list of constructor dependencies, i.e.
|
List<Recipe> |
getDependencies()
Get the list of nested recipes, i.e.
|
protected Class |
getInterfaceClass() |
CollectionRecipe |
getListenersRecipe() |
String |
getOsgiFilter() |
protected static Class |
getRuntimeClass(org.osgi.service.blueprint.reflect.ServiceReferenceMetadata metadata) |
List<org.osgi.framework.ServiceReference> |
getServiceReferences() |
protected Object |
getServiceSecurely(org.osgi.framework.ServiceReference serviceReference) |
boolean |
isSatisfied() |
protected boolean |
isStarted() |
protected List<Class<?>> |
loadAllClasses(Iterable<String> interfaceNames) |
protected org.osgi.service.blueprint.container.ReifiedType |
loadType(String typeName,
ClassLoader fromClassLoader) |
protected abstract void |
retrack() |
void |
serviceChanged(org.osgi.framework.ServiceEvent event) |
protected void |
setSatisfied(boolean s) |
void |
start(SatisfiableRecipe.SatisfactionListener listener) |
void |
stop() |
protected abstract void |
track(org.osgi.framework.ServiceReference reference) |
protected void |
unbind(org.osgi.framework.ServiceReference reference,
Object service) |
protected abstract void |
untrack(org.osgi.framework.ServiceReference reference) |
protected void |
updateListeners() |
addPartialObject, canConvert, convert, convert, create, destroy, getName, internalCreate, isPrototype, loadClass, loadType, setPrototype, toString
protected final ExtendedBlueprintContainer blueprintContainer
protected final org.osgi.service.blueprint.reflect.ServiceReferenceMetadata metadata
protected final ValueRecipe filterRecipe
protected final CollectionRecipe listenersRecipe
protected final boolean optional
protected final String filter
protected List<AbstractServiceReferenceRecipe.Listener> listeners
protected AbstractServiceReferenceRecipe(String name, ExtendedBlueprintContainer blueprintContainer, org.osgi.service.blueprint.reflect.ServiceReferenceMetadata metadata, ValueRecipe filterRecipe, CollectionRecipe listenersRecipe, List<Recipe> explicitDependencies)
public CollectionRecipe getListenersRecipe()
public void start(SatisfiableRecipe.SatisfactionListener listener)
start
in interface SatisfiableRecipe
public void stop()
stop
in interface SatisfiableRecipe
protected void doStop()
protected boolean isStarted()
public boolean isSatisfied()
isSatisfied
in interface SatisfiableRecipe
public List<Recipe> getConstructorDependencies()
Recipe
getConstructorDependencies
in interface Recipe
getConstructorDependencies
in class AbstractRecipe
public List<Recipe> getDependencies()
Recipe
getDependencies
in interface Recipe
public String getOsgiFilter()
getOsgiFilter
in interface SatisfiableRecipe
protected Object getServiceSecurely(org.osgi.framework.ServiceReference serviceReference)
protected void createListeners()
protected org.osgi.service.blueprint.container.ReifiedType loadType(String typeName, ClassLoader fromClassLoader)
loadType
in class AbstractRecipe
protected Object createProxy(Callable<Object> dispatcher, Set<Class<?>> interfaces) throws Exception
Exception
public void serviceChanged(org.osgi.framework.ServiceEvent event)
serviceChanged
in interface org.osgi.framework.ServiceListener
protected Class getInterfaceClass()
protected static Class getRuntimeClass(org.osgi.service.blueprint.reflect.ServiceReferenceMetadata metadata)
protected org.osgi.framework.BundleContext getBundleContextForServiceLookup()
protected void setSatisfied(boolean s)
protected abstract void track(org.osgi.framework.ServiceReference reference)
protected abstract void untrack(org.osgi.framework.ServiceReference reference)
protected abstract void retrack()
protected void updateListeners()
protected void bind(org.osgi.framework.ServiceReference reference, Object service)
protected void unbind(org.osgi.framework.ServiceReference reference, Object service)
public List<org.osgi.framework.ServiceReference> getServiceReferences()
public org.osgi.framework.ServiceReference getBestServiceReference()
Copyright © 2016. All rights reserved.