Class ComponentContextImpl<S>
- java.lang.Object
-
- org.apache.felix.scr.impl.manager.ComponentContextImpl<S>
-
- All Implemented Interfaces:
ExtComponentContext
,org.osgi.service.component.ComponentContext
public class ComponentContextImpl<S> extends Object implements ExtComponentContext
Implementation for the ComponentContext interface
-
-
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()
void
disableComponent(String name)
void
enableComponent(String name)
Map<RefPair<?,?>,Object>
getBoundValues(String key)
org.osgi.framework.BundleContext
getBundleContext()
org.osgi.service.component.ComponentInstance
getComponentInstance()
protected SingleComponentManager<S>
getComponentManager()
ComponentServiceObjectsHelper
getComponentServiceObjectsHelper()
Dictionary<String,Object>
getProperties()
org.osgi.framework.ServiceReference<S>
getServiceReference()
org.osgi.framework.Bundle
getUsingBundle()
Object
locateService(String name)
Object
locateService(String name, org.osgi.framework.ServiceReference ref)
Object[]
locateServices(String name)
void
setImplementationAccessible(boolean implementationAccessible)
void
setImplementationObject(S implementationObject)
void
setServiceProperties(Dictionary<String,?> properties)
Sets the service registration properties of the component registered as a service.void
unsetServiceRegistration()
-
-
-
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()
-
setImplementationObject
public void setImplementationObject(S implementationObject)
-
setImplementationAccessible
public void setImplementationAccessible(boolean implementationAccessible)
-
getComponentManager
protected SingleComponentManager<S> getComponentManager()
-
getProperties
public final Dictionary<String,Object> getProperties()
- Specified by:
getProperties
in interfaceorg.osgi.service.component.ComponentContext
-
locateService
public Object locateService(String name)
- Specified by:
locateService
in interfaceorg.osgi.service.component.ComponentContext
-
locateService
public Object locateService(String name, org.osgi.framework.ServiceReference ref)
- Specified by:
locateService
in interfaceorg.osgi.service.component.ComponentContext
-
locateServices
public Object[] locateServices(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
-
getComponentInstance
public org.osgi.service.component.ComponentInstance getComponentInstance()
- Specified by:
getComponentInstance
in interfaceorg.osgi.service.component.ComponentContext
-
enableComponent
public void enableComponent(String name)
- Specified by:
enableComponent
in interfaceorg.osgi.service.component.ComponentContext
-
disableComponent
public void disableComponent(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(Dictionary<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.
-
-