Chapter 4 Flashcards
Name the three implementation layers of component framework?
- Platform
- Container
- Components
From a conceptual point of view, software component C consists of three items
- A component identifier id
- Component specification spc, and
- Component body bdy
C = <id, spc, bdy>
Explain composition mechanism
Composition mechanisms explain how components are composed and deployed in a framework.
Explain the main composition mechanisms of component frameworks
- Bundling: it means constructing new component C from the given components C1, …Cn before deployment. C is a component with its name, specification and body.
Bundling is sometimes called Aggregation. - Deploying: it means making the name and body of components C available within a container D.
- Connecting: it means making the services of a component available to another component at runtime. This is done by passing references from one component to another.
Explain OSGi
It is a component framework of Java that supports dynamic installation and management of components. Complete applications and single components can be remotely installed, started, stopped, updated and uninstalled without requiring a reboot of the host process.
OSGi framework basics to know
- OSGi defines the structure and syntax of deployable components which are called bundle in OSGi context
- OSGi provides a container together with a sophisticated API for installing, uninstalling, and dynamically managing components.
Services in OSGi
They are identified by Java interfaces.
What does Activator class mean in OSGi component?
It contains the code for initial startup and final cleanup just like Glue code.
What is the important aspect of OSGi container?
It stores its current state in a persistent representation when the container is closed. If the container is relaunched, it sets up the state it was in before closing.
Components in general and OSGi bundles have two functions:
They provide services and manage code.
With the dynamic runtime environment of OSGi framework, at runtime, the when the framework/container is running :
- Bundles can be installed and resolved and uninstalled
- Resolved bundles can be started, and stopped
- Services can be registered and unregistered
Limitation of service listeners
It is more suitable for a small systems, for a complex system and much services, a more suitable alternative Service trackers or Declarative Services that OSGi provides.
Difference between declarative services and service listeners.
Instead of describing in the program how service listeners reacts to changes, declarative services describes the dependencies and properties of services in an additional XML file.
Explain the two kinds of components the OSGi framework supports
- Immediate components: it is activated as soon as its dependencies are satisfied
- Delayed components: it is activated as soon as it’s service is requested.
All components providing services are delayed components while others are immediate components.
You can override this by setting the parameter immediate of the @Component annotation to false.
OSGi service listeners are based on
Events i.e publish-subscribe principle.