C - The type of the component implementation.public class ComponentContextImpl<C> extends Object implements org.everit.osgi.ecm.component.ComponentContext<C>
| Constructor and Description |
|---|
ComponentContextImpl(AbstractComponentContainer<C> componentContainer,
org.osgi.framework.BundleContext bundleContext) |
ComponentContextImpl(AbstractComponentContainer<C> componentContainer,
org.osgi.framework.BundleContext bundleContext,
Dictionary<String,Object> properties)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closing the component context that stops the component instance as well if it is started.
|
void |
fail(Throwable e,
boolean permanent)
Sets FAILED state for the ComponentContext, unregisters the OSGi services registered via the
ComponentContext and removes the instance object. |
org.osgi.framework.BundleContext |
getBundleContext() |
org.everit.osgi.ecm.component.resource.ComponentContainer<C> |
getComponentContainer() |
ComponentRevisionImpl<C> |
getComponentRevision() |
org.osgi.framework.ServiceReference<?> |
getComponentServiceReference() |
Class<C> |
getComponentType() |
C |
getInstance() |
Map<String,Object> |
getProperties() |
org.everit.osgi.ecm.component.resource.ComponentState |
getState() |
boolean |
isFailed() |
boolean |
isSatisfied()
Whether the component is satisfied based on the currently satisfied references or not.
|
void |
open()
Opens the component that means that configuration will be processed, all references will be
tracked and if all references are satisfied the component will be started.
|
<S> org.osgi.framework.ServiceRegistration<S> |
registerService(Class<S> clazz,
S service,
Dictionary<String,?> properties) |
org.osgi.framework.ServiceRegistration<?> |
registerService(String[] clazzes,
Object service,
Dictionary<String,?> properties) |
org.osgi.framework.ServiceRegistration<?> |
registerService(String clazz,
Object service,
Dictionary<String,?> properties) |
void |
updateConfiguration(Dictionary<String,?> properties)
Updates the configuration on the component instance.
|
public ComponentContextImpl(AbstractComponentContainer<C> componentContainer, org.osgi.framework.BundleContext bundleContext)
public ComponentContextImpl(AbstractComponentContainer<C> componentContainer, org.osgi.framework.BundleContext bundleContext, Dictionary<String,Object> properties)
componentContainer - The component container that created this context.bundleContext - The context of the bundle that opened the Component Container.properties - The configuration of the component.public void close()
public void fail(Throwable e, boolean permanent)
ComponentContext and removes the instance object.e - The cause of the component failure.permanent - Whether the failure is permanent or not. In case of non-permanent failure, a
configuration update will change the state of the component, while a permanent failure
can be changed only by upgrading the component instance binary.public org.osgi.framework.BundleContext getBundleContext()
getBundleContext in interface org.everit.osgi.ecm.component.ComponentContext<C>public org.everit.osgi.ecm.component.resource.ComponentContainer<C> getComponentContainer()
getComponentContainer in interface org.everit.osgi.ecm.component.ComponentContext<C>public ComponentRevisionImpl<C> getComponentRevision()
getComponentRevision in interface org.everit.osgi.ecm.component.ComponentContext<C>public org.osgi.framework.ServiceReference<?> getComponentServiceReference()
getComponentServiceReference in interface org.everit.osgi.ecm.component.ComponentContext<C>public Class<C> getComponentType()
getComponentType in interface org.everit.osgi.ecm.component.ComponentContext<C>public C getInstance()
getInstance in interface org.everit.osgi.ecm.component.ComponentContext<C>public Map<String,Object> getProperties()
getProperties in interface org.everit.osgi.ecm.component.ComponentContext<C>public org.everit.osgi.ecm.component.resource.ComponentState getState()
public boolean isFailed()
public boolean isSatisfied()
public void open()
public <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String,?> properties)
registerService in interface org.everit.osgi.ecm.component.ComponentContext<C>public org.osgi.framework.ServiceRegistration<?> registerService(String clazz, Object service, Dictionary<String,?> properties)
registerService in interface org.everit.osgi.ecm.component.ComponentContext<C>public org.osgi.framework.ServiceRegistration<?> registerService(String[] clazzes, Object service, Dictionary<String,?> properties)
registerService in interface org.everit.osgi.ecm.component.ComponentContext<C>public void updateConfiguration(Dictionary<String,?> properties)
properties - The new configuration of the component.Copyright © 2011–2015 Everit Kft.. All rights reserved.