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 class
ComponentContextImpl.ComponentInstanceImpl<S>
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.CountDownLatch
accessibleLatch
private java.util.Map<java.lang.String,java.util.Map<RefPair<?,?>,java.lang.Object>>
boundValues
Mapping of ref pairs to value boundprivate EdgeInfo[]
edgeInfos
private org.osgi.service.component.ComponentInstance<S>
m_componentInstance
private SingleComponentManager<S>
m_componentManager
private boolean
m_implementationAccessible
private S
m_implementationObject
private org.osgi.framework.ServiceRegistration<S>
m_serviceRegistration
private org.osgi.framework.Bundle
m_usingBundle
private ComponentServiceObjectsHelper
serviceObjectsHelper
-
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 void
cleanup()
private java.util.Map<RefPair<?,?>,java.lang.Object>
createNewFieldHandlerMap()
void
disableComponent(java.lang.String name)
void
enableComponent(java.lang.String name)
java.util.Map<RefPair<?,?>,java.lang.Object>
getBoundValues(java.lang.String key)
org.osgi.framework.BundleContext
getBundleContext()
org.osgi.service.component.ComponentInstance<S>
getComponentInstance()
protected SingleComponentManager<S>
getComponentManager()
ComponentMetadata
getComponentMetadata()
ComponentServiceObjectsHelper
getComponentServiceObjectsHelper()
(package private) EdgeInfo
getEdgeInfo(DependencyManager<S,?> dm)
(package private) S
getImplementationObject(boolean requireAccessible)
ComponentLogger
getLogger()
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.Bundle
getUsingBundle()
java.lang.Object
locateService(java.lang.String name)
java.lang.Object
locateService(java.lang.String name, org.osgi.framework.ServiceReference ref)
java.lang.Object[]
locateServices(java.lang.String name)
void
setImplementationAccessible(boolean implementationAccessible)
void
setImplementationObject(S implementationObject)
void
setServiceProperties(java.util.Dictionary<java.lang.String,?> properties)
Sets the service registration properties of the component registered as a service.void
unsetServiceRegistration()
-
-
-
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:
getComponentServiceObjectsHelper
in 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:
getComponentMetadata
in interfaceScrComponentContext
-
getProperties
public final java.util.Dictionary<java.lang.String,java.lang.Object> getProperties()
- Specified by:
getProperties
in interfaceorg.osgi.service.component.ComponentContext
-
locateService
public java.lang.Object locateService(java.lang.String name)
- Specified by:
locateService
in interfaceorg.osgi.service.component.ComponentContext
-
locateService
public java.lang.Object locateService(java.lang.String name, org.osgi.framework.ServiceReference ref)
- Specified by:
locateService
in interfaceorg.osgi.service.component.ComponentContext
-
locateServices
public java.lang.Object[] locateServices(java.lang.String name)
- Specified by:
locateServices
in interfaceorg.osgi.service.component.ComponentContext
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()
- Specified by:
getBundleContext
in interfaceorg.osgi.service.component.ComponentContext
-
getUsingBundle
public org.osgi.framework.Bundle getUsingBundle()
- Specified by:
getUsingBundle
in interfaceorg.osgi.service.component.ComponentContext
-
getLogger
public ComponentLogger getLogger()
- Specified by:
getLogger
in interfaceScrComponentContext
-
getComponentInstance
public org.osgi.service.component.ComponentInstance<S> getComponentInstance()
- Specified by:
getComponentInstance
in interfaceorg.osgi.service.component.ComponentContext
-
enableComponent
public void enableComponent(java.lang.String name)
- Specified by:
enableComponent
in interfaceorg.osgi.service.component.ComponentContext
-
disableComponent
public void disableComponent(java.lang.String name)
- Specified by:
disableComponent
in interfaceorg.osgi.service.component.ComponentContext
-
getServiceReference
public org.osgi.framework.ServiceReference<S> getServiceReference()
- Specified by:
getServiceReference
in interfaceorg.osgi.service.component.ComponentContext
-
setServiceProperties
public void setServiceProperties(java.util.Dictionary<java.lang.String,?> properties)
Description copied from interface:ExtComponentContext
Sets 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.id
andcomponent.name
property are set by the Service Component Runtime and cannot be removed or replaced.- Specified by:
setServiceProperties
in interfaceExtComponentContext
- Parameters:
properties
- properties to update the default component properties with. If this isnull
or 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:
getBoundValues
in interfaceScrComponentContext
-
createNewFieldHandlerMap
private java.util.Map<RefPair<?,?>,java.lang.Object> createNewFieldHandlerMap()
-
-