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 Summary
FieldsModifier and TypeFieldDescriptionprivate final ComponentRegistry
private final org.osgi.framework.BundleContext
private SoftReference
<ConcurrentHashMap<Long, org.osgi.framework.dto.ServiceReferenceDTO[]>> private static final String[]
-
Constructor Summary
ConstructorsConstructorDescriptionServiceComponentRuntimeImpl
(org.osgi.framework.BundleContext context, ComponentRegistry componentRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bundleChanged
(org.osgi.framework.BundleEvent event) private org.osgi.framework.dto.BundleDTO
bundleToDTO
(org.osgi.framework.BundleContext bundleContext) (package private) boolean
(package private) Object
org.osgi.util.promise.Promise
<Void> disableComponent
(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) org.osgi.util.promise.Promise
<Void> enableComponent
(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) Collection
<org.osgi.service.component.runtime.dto.ComponentConfigurationDTO> getComponentConfigurationDTOs
(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) org.osgi.service.component.runtime.dto.ComponentDescriptionDTO
getComponentDescriptionDTO
(org.osgi.framework.Bundle bundle, String name) Collection
<org.osgi.service.component.runtime.dto.ComponentDescriptionDTO> getComponentDescriptionDTOs
(org.osgi.framework.Bundle... bundles) private ComponentHolder
<?> getHolderFromDescription
(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) Return the component holderprivate org.osgi.service.component.runtime.dto.ComponentDescriptionDTO
holderToDescription
(ComponentHolder<?> holder) boolean
isComponentEnabled
(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) private org.osgi.service.component.runtime.dto.ComponentConfigurationDTO
managerToConfiguration
(ComponentManager<?> manager, org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) private org.osgi.service.component.runtime.dto.ReferenceDTO[]
refsToDTO
(List<ReferenceMetadata> dependencies) private org.osgi.service.component.runtime.dto.SatisfiedReferenceDTO[]
satisfiedRefManagersToDTO
(List<? extends ReferenceManager<?, ?>> referenceManagers) void
serviceChanged
(org.osgi.framework.ServiceEvent event) private org.osgi.framework.dto.ServiceReferenceDTO
serviceReferenceToDTO
(org.osgi.framework.ServiceReference<?> serviceRef) private org.osgi.service.component.runtime.dto.UnsatisfiedReferenceDTO[]
unsatisfiedRefManagersToDTO
(List<? extends ReferenceManager<?, ?>> referenceManagers)
-
Field Details
-
EMPTY
-
context
private final org.osgi.framework.BundleContext context -
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 interfaceorg.osgi.service.component.runtime.ServiceComponentRuntime
- See Also:
-
getComponentDescriptionDTO
public org.osgi.service.component.runtime.dto.ComponentDescriptionDTO getComponentDescriptionDTO(org.osgi.framework.Bundle bundle, String name) - Specified by:
getComponentDescriptionDTO
in interfaceorg.osgi.service.component.runtime.ServiceComponentRuntime
- See Also:
-
getComponentConfigurationDTOs
public Collection<org.osgi.service.component.runtime.dto.ComponentConfigurationDTO> getComponentConfigurationDTOs(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) - Specified by:
getComponentConfigurationDTOs
in interfaceorg.osgi.service.component.runtime.ServiceComponentRuntime
- See Also:
-
isComponentEnabled
public boolean isComponentEnabled(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) - Specified by:
isComponentEnabled
in interfaceorg.osgi.service.component.runtime.ServiceComponentRuntime
- See Also:
-
enableComponent
public org.osgi.util.promise.Promise<Void> enableComponent(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) - Specified by:
enableComponent
in interfaceorg.osgi.service.component.runtime.ServiceComponentRuntime
- See Also:
-
disableComponent
public org.osgi.util.promise.Promise<Void> disableComponent(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO description) - Specified by:
disableComponent
in interfaceorg.osgi.service.component.runtime.ServiceComponentRuntime
- See Also:
-
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
-
convert
-
checkType
-
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 interfaceorg.osgi.framework.BundleListener
-
serviceChanged
public void serviceChanged(org.osgi.framework.ServiceEvent event) - Specified by:
serviceChanged
in interfaceorg.osgi.framework.ServiceListener
-