Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Unlike a POJO component in iPOJO that has code associated with it, a composite component is completely described by its metadata. Similar to a POJO component, however, the metadata describes a component type for which iPOJO will registry registers a factory service that can be used to create instances of the composite component.

A composite can be represented thought of as a service registry . Moreover, composite can be contained in other compositeor a scoping mechanism of the global OSGi™ service registry. Composites can contain other composite, creating a hierarchy of service registries. The OSGi™ service registry is the root composite.

A composite can:

  • Contain services.
  • Import services from the its parent service registrycomposite.
  • Provide services to the its parent service registry
  • Contain "sub-services" instantiated inside the composite registry
  • composite.

A service contained in a composite is a sub-service, which is isomorphic to sub-components in traditional component-oriented composites. A sub-service is a service instance created from a component factory. Sub-services are not visible outside of the composite and can only see other services that reside in the composite service registry. The set of services in the composite service registry are all sub-services as well as all imported services. Sub-services are not aware of the fact that they are inside of a composite and provide and use services normally within their compositeSub-services lives in the composite and use the composite service registry. However, they don't know that they are inside a composite and use services normally. This "scoping" effect of composite allows to limit the service range.

"Hello World" composite

This section describes a simple composition example importing several services, instantiating 3 sub-services and exporting one service.

...