github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

njbartlett / Extensions2Services

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (2)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Integration layer for Eclipse Extensions to use OSGi Services — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Ignore missing unbind method 
njbartlett (author)
Wed Dec 09 06:33:11 -0800 2009
commit  cf8afb7682c7cac8a325a71588a931ba6f4e2679
tree    2788d33b5af010d9e15190d7886fd838009a598a
parent  5f2b4b3d255c21fa42b71a68af38c69a9553904a
Extensions2Services /
name age
history
message
file .gitignore Loading commit data...
file README.md
directory eu.wwuk.eclipse.extsvcs.core.test/
directory eu.wwuk.eclipse.extsvcs.core/
directory eu.wwuk.eclipse.extsvcs.examples.client/
directory eu.wwuk.eclipse.extsvcs.feature/
directory eu.wwuk.eclipse.extsvcs.target/
directory manual/
README.md

Extensions-2-Services: Integrating Eclipse Extensions with OSGi Services

Extensions2Services ("e2s") is a very small and lightweight framework for integrating Eclipse Extensions with OSGi Services. These two models are difficult to use together for the following reasons:

  • No references to OSGi APIs (e.g. BundleContext) from extension objects.
  • Lifecycle mismatch -- services come and go but extensions cannot easily be disabled if the services they depend on become unavailable.
  • Extensions are factories, whereas services are shared singleton-like objects. Coercing services directly into use as extension objects can result in unexpected behaviour.
  • No explicit release. There is no API for the client of an extension to indicate that it has finished using an extension object, therefore there is no opportunity for an extension object to unregister its interest in a service.

Example

The approach used by e2s us to delcare an "injected factory" using a special extension point. That factory may then be referenced by extensions into any other arbitrary extension point. The following example shows the use of e2s to declare an Eclipse view that uses the OSGi LogReaderService:

<!-- Factory Declaration -->
<extension
      point="eu.wwuk.eclipse.extsvcs.core.injectedFactories">
   <factory
         id="logReaderView"
         class="org.example.view.LogReaderView">
      <reference
            interface="org.osgi.service.log.LogReaderService">
      </reference>
   </factory>
</extension>

<!-- Standard View Declaration -->
<extension
      point="org.eclipse.ui.views">
   <view
         id="org.example.views.logView"
         class="eu.wwuk.eclipse.extsvcs.core.InjectionFactory:logReaderView"
         name="Log Reader"
         icon="icons/log.gif">
   </view>
</extension>

Notice thta the view extension declaration is exactly the same as a normal view declaration, except for the content of the class attribute.

Further Information

For extensive documentation, see the included manual.

WARNING

This code is currently experimental and contains very little error handling or diagnostic capabilities. These will be added in due course, but for the time being caveat emptor.

Licence

All code and examples are licensed under the Eclipse Public Licence version 1.0.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server