Ticket #470 (closed Enhancement: wontfix)
Add support for scala written plugins
Reported by: | joern | Owned by: | joern |
---|---|---|---|
Priority: | Major | Milestone: | |
Component: | 3rd Party Plugins | Version: | 4.1 |
Keywords: | Cc: | jri, dgf | |
Complexity: | 3 | Area: | |
Module: |
Description
As scala and java are interoperable, there no reason to not write plugins in scala. I've investigated the possiblities and started to write a proof of concept. The first steps are already achieved:
- add scala compiler to plugin pom.xml (the global pom don't need to know about this)
scala-osgi is required, needs to be manually added to maven
scala-compile-first option to use java classes
export scala*
import sun.misc (needed by scala-osgi): requieres tweaks in felix runner as the package is not available by default
- write a scala Activator: straight forward
The plugin can be activated and is even Added to EventAdmin?. But for Listeners are not working, I have to research the PluginIml? class which fails to attach the listeners. Maybe a scala rewrite of this class will be necessary.
Repo can be found here: https://github.com/joernweissenborn/dm4-api_framework.git
A Plugin Scala is possible, see github. But its not possible to listen to events and the overall plugin impl behaves akward (it seems to simple not do some methods, while still excecuting things like connect to services). For this reason its at the moment not possible to write plugins in scala. A fix for that would however be nice.