Nearly everything in Odysseus is designed to be replaced or extended. Here are the typical ones:
- Language extensions
- Create a new language (not only for queries, could be a DSL for anything)
- Create a new Odysseus Script Commands (#....)
- Create a new Logical/PQL Operator
- Processing function extensions
- Create new datatypes
- Create new stream object types
- Data Handler
- Create a new wrapper
- Transport handler
- Protocol handler
- Create new functions for expressions and predicates
- Create new aggregation functions
- Create new operators
- Create new schedulers and scheduling strategies
- Create new meta data
Some OSGi/Eclipse basics
- Bundles
- Aka plugin: An eclipse project
- Each bundle has its own class loader
- MANIFEST.MF: meta data for that bundle (name, version, imports, exports…)
- In Odysseus: a module that encapsulates functions
- Fragment
- A special bundle that will not exist allone but together with a host bundle
- Same class loader as host bundle
- Used to extend host bundle
- We do not use this anymore, better approach is declarative services
- Declarative Services
- OSGi way of dependency injection
- Defined by so called components
- Can provide functions by interfaces or use (bind/unbind) implementations by interfaces à examples later
- Feature: a feature is a collection of bundles
- Define a set of bundles, that belong together and builds some functionality (e.g. each wrapper has its own feature)
- An update site provides features
- A bundle can be part of many features
- Update-site:
- A collection of features that can be installed in Odysseus
- On the same way, as in Eclipse („Install new software“)
- Via command on ther server
- Via Odysseus-Script
- Product:
- A product is a runnable software (with an application)
- Can be defined by bundles or features
- We only use features to define products
OSGi Life Cycle
- Each bundle has a life cycle
- Installed: A bundle (with correct Metadata is installed)
- Resolved: All dependencies (MANIFEST) are found
- Uninstalled: removed from runtime
- Active: a bundle is activated
- E.g. call of bundle activator
- Remark: there is no need to start a bundle, if the bundle should only provide classes (as a library)
- Eclipse tries to resolve dependencies lazy, if this cannot be done, the bundle stays installed --> bundle cannot be used
OSGi debugging
TODO: Check commands with apache felix console
- When an application (product) gets started with –console (as in Odysseus always), there is a console available
- ss shows all currently available bundles and their current life cycle state
- Sometimes, there are problems because dependencies are missing (INSTALLED)
- Typical problem: The dependency defined in the MANIFEST.MF was not added to any feature
- diag <id> shows the missing dependencies
- Again: Resolved is no “problem” ;-)
- ls: shows all currently installed (declarative) services
- Unsatisfied: Some dependencies cannot be found
- Use comp <id> to determine missing dependencies
See also some newer See also some newer slides
Setting up
This section describes how to set up Eclipse and Odysseus for development.
...