Runtime Surgery New ways to integrate softwarecomponents   with eclipse equinox     Tobias Jenkner (edmPRO)
Surgery - who are the patients    ●Eclipse Runtime – equinox    ●Osgi: Reuse existing software    components    ➔Patients:...
Reuse bundles: Customize            Plugin            to be reused                Java and OSGI                access rest...
Reuse bundles: Separation of concerns   Client              Common        Server    Log API              RCP            .....
Summary:Reuse bundles✗  Separation of concerns✗ Interfaces available➔ Write a component once run everywhere● Separation of...
Integration – existing bundles
Integration options●Enhancement request to the vendor / project●Branch existing sourcecode●Modify code at runtime with ecl...
Eclipse equinoxApplication of the patches at loadtime.                                Eclipse PluginEquinox transforms xsl...
Equinox transforms xsltChange existing eclipse RCP extensions:●Remove, relocate, restrict visibility of toolbar andmenu en...
Equinox weaving aspectjUse aspectj around advice to suppress methodcalls●Set window titlepointcut setTitle() :call(void or...
Equinox weaving aspectj    ●Access internals from existing bundles in order to    customize existing functionality    ●  A...
Use case summaryWeaving:●Customize and extend existing functionality(without API)●Suppress method callsTransforms:●Cleanup...
Drawbacks●Equinox waeving: Coping with internals /breaking up information hidingDoing the job of the vendor / project●
ConclusionModify complete bundles at runtime:●Declarative XML●Java bytecode
What do you think?● Useful ?● Risk ?● Production ?● Responsibility ?● ...
Upcoming SlideShare
Loading in …5
×

Runtime surgery

682 views
629 views

Published on

Slides to eclipse summit europe 2010 talk runtime surgery (https://www.eclipsecon.org/submissions/ese2010/edit_talk.php?id=1885).

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
682
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Runtime surgery

  1. 1. Runtime Surgery New ways to integrate softwarecomponents with eclipse equinox Tobias Jenkner (edmPRO)
  2. 2. Surgery - who are the patients ●Eclipse Runtime – equinox ●Osgi: Reuse existing software components ➔Patients: existing osgi bundles we want to reuse
  3. 3. Reuse bundles: Customize Plugin to be reused Java and OSGI access restrictions InitializationCustomize No public interface Plugin to be reused Java and OSGI access restrictions Security
  4. 4. Reuse bundles: Separation of concerns Client Common Server Log API RCP ... Menu-Entry Global UI Software-Updates Log impl RCP ... Change Window View 1 Title Log config RCP ... RCP View 1 View 2
  5. 5. Summary:Reuse bundles✗ Separation of concerns✗ Interfaces available➔ Write a component once run everywhere● Separation of concerns only in the context ofthe original development (A single OSGI Bundle contains GUI,configuration, business logic, …)● Customization not possible (API not available)● Write once break everywhere else
  6. 6. Integration – existing bundles
  7. 7. Integration options●Enhancement request to the vendor / project●Branch existing sourcecode●Modify code at runtime with eclipse equinoxframework extensions
  8. 8. Eclipse equinoxApplication of the patches at loadtime. Eclipse PluginEquinox transforms xslt● plugin.xmlEquinox weaving aspectj● bytecode
  9. 9. Equinox transforms xsltChange existing eclipse RCP extensions:●Remove, relocate, restrict visibility of toolbar andmenu entries<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- suppress the menuContribution for the command org.eclipse.equinox.p2.ui.sdk.install --> <xsl:template match="extension[@point=org.eclipse.ui.menus]/ MenuContribution/ command[@commandId= org.eclipse.equinox.p2.ui.sdk.install]"> </xsl:template> ...
  10. 10. Equinox weaving aspectjUse aspectj around advice to suppress methodcalls●Set window titlepointcut setTitle() :call(void org.eclipse.swt.widgets.Shell.setText(String));void around() : setTitle() { // without proceed() - suppress the method call}
  11. 11. Equinox weaving aspectj ●Access internals from existing bundles in order to customize existing functionality ● AJDT, ScalaDT JDT CompilationUnit around(PackageFragment parent, String name, WorkingCopyOwner owner) : compilationUnitCreations(parent, name, owner) { String newName = trimName(name); String extension = findExtension(newName); ICompilationUnitProvider provider = CompilationUnitProviderRegistry.getInstance().getProvider(extension); if (provider != null) { try { return provider.create(parent, newName, owner); } catch (Throwable t) { JDTWeavingPlugin.logException(t); } } return proceed(parent, name, owner); }http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ajdt/AJDT_src/org.eclipse.contribution.weaving.jdt/src/org/eclipse/contribution/jdt/cuprovider/CompilationUnitProviderAspect.aj?view=markup&root=Tools_Project
  12. 12. Use case summaryWeaving:●Customize and extend existing functionality(without API)●Suppress method callsTransforms:●Cleanup Menus / UIBoth:●Enforce integration specific codingguidelines. Forbid usage of available APIs (e.g.set window title).
  13. 13. Drawbacks●Equinox waeving: Coping with internals /breaking up information hidingDoing the job of the vendor / project●
  14. 14. ConclusionModify complete bundles at runtime:●Declarative XML●Java bytecode
  15. 15. What do you think?● Useful ?● Risk ?● Production ?● Responsibility ?● ...

×