Class ServiceComponentRuntimeImpl

java.lang.Object
org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl
All Implemented Interfaces:
EventListener, org.osgi.framework.BundleListener, org.osgi.framework.ServiceListener, org.osgi.service.component.runtime.ServiceComponentRuntime

public class ServiceComponentRuntimeImpl extends Object implements org.osgi.service.component.runtime.ServiceComponentRuntime, org.osgi.framework.ServiceListener, org.osgi.framework.BundleListener
  • Field Details

    • EMPTY

      private static final String[] EMPTY
    • context

      private final org.osgi.framework.BundleContext context
    • componentRegistry

      private final ComponentRegistry componentRegistry
    • dtoCache

      private volatile SoftReference<ConcurrentHashMap<Long,org.osgi.framework.dto.ServiceReferenceDTO[]>> dtoCache
  • Constructor Details

    • ServiceComponentRuntimeImpl

      public ServiceComponentRuntimeImpl(org.osgi.framework.BundleContext context, ComponentRegistry componentRegistry)
  • Method Details

    • getComponentDescriptionDTOs

      public Collection<org.osgi.service.component.runtime.dto.ComponentDescriptionDTO> getComponentDescriptionDTOs(org.osgi.framework.Bundle... bundles)
      Specified by:
      getComponentDescriptionDTOs in interface org.osgi.service.component.runtime.ServiceComponentRuntime
      See Also:
      • ServiceComponentRuntime.getComponentDescriptionDTOs(org.osgi.framework.Bundle[])
    • getComponentDescriptionDTO

      public org.osgi.service.component.runtime.dto.ComponentDescriptionDTO getComponentDescriptionDTO(org.osgi.framework.Bundle bundle, String name)
      Specified by:
      getComponentDescriptionDTO in interface org.osgi.service.component.runtime.ServiceComponentRuntime
      See Also:
      • ServiceComponentRuntime.getComponentDescriptionDTO(org.osgi.framework.Bundle, java.lang.String)
    • getComponentConfigurationDTOs

      public Collection<org.osgi.service.component.runtime.dto.ComponentConfigurationDTO> getComponentConfigurationDTOs(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description)
      Specified by:
      getComponentConfigurationDTOs in interface org.osgi.service.component.runtime.ServiceComponentRuntime
      See Also:
      • ServiceComponentRuntime.getComponentConfigurationDTOs(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO)
    • isComponentEnabled

      public boolean isComponentEnabled(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description)
      Specified by:
      isComponentEnabled in interface org.osgi.service.component.runtime.ServiceComponentRuntime
      See Also:
      • ServiceComponentRuntime.isComponentEnabled(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO)
    • enableComponent

      public org.osgi.util.promise.Promise<Void> enableComponent(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description)
      Specified by:
      enableComponent in interface org.osgi.service.component.runtime.ServiceComponentRuntime
      See Also:
      • ServiceComponentRuntime.enableComponent(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO)
    • disableComponent

      public org.osgi.util.promise.Promise<Void> disableComponent(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description)
      Specified by:
      disableComponent in interface org.osgi.service.component.runtime.ServiceComponentRuntime
      See Also:
      • ServiceComponentRuntime.disableComponent(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO)
    • managerToConfiguration

      private org.osgi.service.component.runtime.dto.ComponentConfigurationDTO managerToConfiguration(ComponentManager<?> manager, org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description)
    • satisfiedRefManagersToDTO

      private org.osgi.service.component.runtime.dto.SatisfiedReferenceDTO[] satisfiedRefManagersToDTO(List<? extends ReferenceManager<?,?>> referenceManagers)
    • unsatisfiedRefManagersToDTO

      private org.osgi.service.component.runtime.dto.UnsatisfiedReferenceDTO[] unsatisfiedRefManagersToDTO(List<? extends ReferenceManager<?,?>> referenceManagers)
    • serviceReferenceToDTO

      private org.osgi.framework.dto.ServiceReferenceDTO serviceReferenceToDTO(org.osgi.framework.ServiceReference<?> serviceRef)
    • getHolderFromDescription

      private ComponentHolder<?> getHolderFromDescription(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description)
      Return the component holder
      Parameters:
      description - Component description DTO
      Returns:
      The component holder
      Throws:
      IllegalStateException - If the bundle is not active anymore
    • holderToDescription

      private org.osgi.service.component.runtime.dto.ComponentDescriptionDTO holderToDescription(ComponentHolder<?> holder)
    • deepCopy

      private Map<String,Object> deepCopy(Map<String,Object> source)
    • convert

      Object convert(Object source)
    • checkType

      boolean checkType(Class<?> type)
    • refsToDTO

      private org.osgi.service.component.runtime.dto.ReferenceDTO[] refsToDTO(List<ReferenceMetadata> dependencies)
    • bundleToDTO

      private org.osgi.framework.dto.BundleDTO bundleToDTO(org.osgi.framework.BundleContext bundleContext)
    • bundleChanged

      public void bundleChanged(org.osgi.framework.BundleEvent event)
      Specified by:
      bundleChanged in interface org.osgi.framework.BundleListener
    • serviceChanged

      public void serviceChanged(org.osgi.framework.ServiceEvent event)
      Specified by:
      serviceChanged in interface org.osgi.framework.ServiceListener