Class ComponentContextImpl<S>
- java.lang.Object
-
- org.apache.felix.scr.impl.manager.ComponentContextImpl<S>
-
- All Implemented Interfaces:
ExtComponentContext,ScrComponentContext,org.osgi.service.component.ComponentContext
public class ComponentContextImpl<S> extends java.lang.Object implements ScrComponentContext
Implementation for the ComponentContext interface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classComponentContextImpl.ComponentInstanceImpl<S>
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.CountDownLatchaccessibleLatchprivate java.util.Map<java.lang.String,java.util.Map<RefPair<?,?>,java.lang.Object>>boundValuesMapping of ref pairs to value boundprivate EdgeInfo[]edgeInfosprivate org.osgi.service.component.ComponentInstance<S>m_componentInstanceprivate SingleComponentManager<S>m_componentManagerprivate booleanm_implementationAccessibleprivate Sm_implementationObjectprivate org.osgi.framework.ServiceRegistration<S>m_serviceRegistrationprivate org.osgi.framework.Bundlem_usingBundleprivate ComponentServiceObjectsHelperserviceObjectsHelper
-
Constructor Summary
Constructors Constructor Description ComponentContextImpl(SingleComponentManager<S> componentManager, org.osgi.framework.Bundle usingBundle, org.osgi.framework.ServiceRegistration<S> serviceRegistration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()private java.util.Map<RefPair<?,?>,java.lang.Object>createNewFieldHandlerMap()voiddisableComponent(java.lang.String name)voidenableComponent(java.lang.String name)java.util.Map<RefPair<?,?>,java.lang.Object>getBoundValues(java.lang.String key)org.osgi.framework.BundleContextgetBundleContext()org.osgi.service.component.ComponentInstance<S>getComponentInstance()protected SingleComponentManager<S>getComponentManager()ComponentMetadatagetComponentMetadata()ComponentServiceObjectsHelpergetComponentServiceObjectsHelper()(package private) EdgeInfogetEdgeInfo(DependencyManager<S,?> dm)(package private) SgetImplementationObject(boolean requireAccessible)ComponentLoggergetLogger()java.util.Dictionary<java.lang.String,java.lang.Object>getProperties()org.osgi.framework.ServiceReference<S>getServiceReference()(package private) org.osgi.framework.ServiceRegistration<S>getServiceRegistration()org.osgi.framework.BundlegetUsingBundle()java.lang.ObjectlocateService(java.lang.String name)java.lang.ObjectlocateService(java.lang.String name, org.osgi.framework.ServiceReference ref)java.lang.Object[]locateServices(java.lang.String name)voidsetImplementationAccessible(boolean implementationAccessible)voidsetImplementationObject(S implementationObject)voidsetServiceProperties(java.util.Dictionary<java.lang.String,?> properties)Sets the service registration properties of the component registered as a service.voidunsetServiceRegistration()
-
-
-
Field Detail
-
m_componentManager
private final SingleComponentManager<S> m_componentManager
-
edgeInfos
private final EdgeInfo[] edgeInfos
-
m_componentInstance
private final org.osgi.service.component.ComponentInstance<S> m_componentInstance
-
m_usingBundle
private final org.osgi.framework.Bundle m_usingBundle
-
m_serviceRegistration
private volatile org.osgi.framework.ServiceRegistration<S> m_serviceRegistration
-
m_implementationObject
private volatile S m_implementationObject
-
m_implementationAccessible
private volatile boolean m_implementationAccessible
-
accessibleLatch
private final java.util.concurrent.CountDownLatch accessibleLatch
-
serviceObjectsHelper
private final ComponentServiceObjectsHelper serviceObjectsHelper
-
boundValues
private java.util.Map<java.lang.String,java.util.Map<RefPair<?,?>,java.lang.Object>> boundValues
Mapping of ref pairs to value bound
-
-
Constructor Detail
-
ComponentContextImpl
public ComponentContextImpl(SingleComponentManager<S> componentManager, org.osgi.framework.Bundle usingBundle, org.osgi.framework.ServiceRegistration<S> serviceRegistration)
-
-
Method Detail
-
unsetServiceRegistration
public void unsetServiceRegistration()
-
cleanup
public void cleanup()
-
getComponentServiceObjectsHelper
public ComponentServiceObjectsHelper getComponentServiceObjectsHelper()
- Specified by:
getComponentServiceObjectsHelperin interfaceScrComponentContext
-
setImplementationObject
public void setImplementationObject(S implementationObject)
-
setImplementationAccessible
public void setImplementationAccessible(boolean implementationAccessible)
-
getEdgeInfo
EdgeInfo getEdgeInfo(DependencyManager<S,?> dm)
-
getServiceRegistration
org.osgi.framework.ServiceRegistration<S> getServiceRegistration()
-
getComponentManager
protected SingleComponentManager<S> getComponentManager()
-
getComponentMetadata
public ComponentMetadata getComponentMetadata()
- Specified by:
getComponentMetadatain interfaceScrComponentContext
-
getProperties
public final java.util.Dictionary<java.lang.String,java.lang.Object> getProperties()
- Specified by:
getPropertiesin interfaceorg.osgi.service.component.ComponentContext
-
locateService
public java.lang.Object locateService(java.lang.String name)
- Specified by:
locateServicein interfaceorg.osgi.service.component.ComponentContext
-
locateService
public java.lang.Object locateService(java.lang.String name, org.osgi.framework.ServiceReference ref)- Specified by:
locateServicein interfaceorg.osgi.service.component.ComponentContext
-
locateServices
public java.lang.Object[] locateServices(java.lang.String name)
- Specified by:
locateServicesin interfaceorg.osgi.service.component.ComponentContext
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()
- Specified by:
getBundleContextin interfaceorg.osgi.service.component.ComponentContext
-
getUsingBundle
public org.osgi.framework.Bundle getUsingBundle()
- Specified by:
getUsingBundlein interfaceorg.osgi.service.component.ComponentContext
-
getLogger
public ComponentLogger getLogger()
- Specified by:
getLoggerin interfaceScrComponentContext
-
getComponentInstance
public org.osgi.service.component.ComponentInstance<S> getComponentInstance()
- Specified by:
getComponentInstancein interfaceorg.osgi.service.component.ComponentContext
-
enableComponent
public void enableComponent(java.lang.String name)
- Specified by:
enableComponentin interfaceorg.osgi.service.component.ComponentContext
-
disableComponent
public void disableComponent(java.lang.String name)
- Specified by:
disableComponentin interfaceorg.osgi.service.component.ComponentContext
-
getServiceReference
public org.osgi.framework.ServiceReference<S> getServiceReference()
- Specified by:
getServiceReferencein interfaceorg.osgi.service.component.ComponentContext
-
setServiceProperties
public void setServiceProperties(java.util.Dictionary<java.lang.String,?> properties)
Description copied from interface:ExtComponentContextSets the service registration properties of the component registered as a service. If the component is not registered as a service, this method has no effect.The
component.idandcomponent.nameproperty are set by the Service Component Runtime and cannot be removed or replaced.- Specified by:
setServicePropertiesin interfaceExtComponentContext- Parameters:
properties- properties to update the default component properties with. If this isnullor empty the default set of properties as defined in Section 112.6, Component Properties, are used as the service registration properties.
-
getImplementationObject
S getImplementationObject(boolean requireAccessible)
-
getBoundValues
public java.util.Map<RefPair<?,?>,java.lang.Object> getBoundValues(java.lang.String key)
- Specified by:
getBoundValuesin interfaceScrComponentContext
-
createNewFieldHandlerMap
private java.util.Map<RefPair<?,?>,java.lang.Object> createNewFieldHandlerMap()
-
-