Class ComponentContextImpl<S>

  • All Implemented Interfaces:
    ExtComponentContext, org.osgi.service.component.ComponentContext

    public class ComponentContextImpl<S>
    extends java.lang.Object
    implements ExtComponentContext
    Implementation for the ComponentContext interface
    • Field Detail

      • 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
      • 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()
      • setImplementationObject

        public void setImplementationObject​(S implementationObject)
      • setImplementationAccessible

        public void setImplementationAccessible​(boolean implementationAccessible)
      • getServiceRegistration

        org.osgi.framework.ServiceRegistration<S> getServiceRegistration()
      • getProperties

        public final java.util.Dictionary<java.lang.String,​java.lang.Object> getProperties()
        Specified by:
        getProperties in interface org.osgi.service.component.ComponentContext
      • locateService

        public java.lang.Object locateService​(java.lang.String name)
        Specified by:
        locateService in interface org.osgi.service.component.ComponentContext
      • locateService

        public java.lang.Object locateService​(java.lang.String name,
                                              org.osgi.framework.ServiceReference ref)
        Specified by:
        locateService in interface org.osgi.service.component.ComponentContext
      • locateServices

        public java.lang.Object[] locateServices​(java.lang.String name)
        Specified by:
        locateServices in interface org.osgi.service.component.ComponentContext
      • getBundleContext

        public org.osgi.framework.BundleContext getBundleContext()
        Specified by:
        getBundleContext in interface org.osgi.service.component.ComponentContext
      • getUsingBundle

        public org.osgi.framework.Bundle getUsingBundle()
        Specified by:
        getUsingBundle in interface org.osgi.service.component.ComponentContext
      • getComponentInstance

        public org.osgi.service.component.ComponentInstance<S> getComponentInstance()
        Specified by:
        getComponentInstance in interface org.osgi.service.component.ComponentContext
      • enableComponent

        public void enableComponent​(java.lang.String name)
        Specified by:
        enableComponent in interface org.osgi.service.component.ComponentContext
      • disableComponent

        public void disableComponent​(java.lang.String name)
        Specified by:
        disableComponent in interface org.osgi.service.component.ComponentContext
      • getServiceReference

        public org.osgi.framework.ServiceReference<S> getServiceReference()
        Specified by:
        getServiceReference in interface org.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 and component.name property are set by the Service Component Runtime and cannot be removed or replaced.

        Specified by:
        setServiceProperties in interface ExtComponentContext
        Parameters:
        properties - properties to update the default component properties with. If this is null 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)
      • createNewFieldHandlerMap

        private java.util.Map<RefPair<?,​?>,​java.lang.Object> createNewFieldHandlerMap()