kilim-osgi
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Kilim port for OSGi environment
Using Kilim in OSGi environment
===============================

Kilim does continuation-passing style transformation using byte-code instrumentation.
Based on that, Kilim implements Erland-style actor model that, according to some
tests, performs as well as or better than Erlang itself.

See http://www.malhar.net/sriram/kilim/ for more information about Kilim.

Kilim OSGi brings Kilim into Eclipse world.
Run-time code instrumentation required by Kilim can be employed in OSGi environment
by means of so-called Adaptor Hooks. Please see [1] for more information on them.

The code in this repository targets Eclipse 3.5 version of Equinox. To run it
under Eclipse 3.4, you'll have to use Organize Imports command to import
BundleLoader class from another package. (It's an internal Equinox class that
Kilim OSGi uses.)


Enabling Kilim instrumentation
------------------------------

To instrument plugin classes with Kilim, add the following header into the 
bundle manifest file (META-INF/MANIFEST.MF): “Kilim-Enabled: true”.

You also need to import “kilim” and “kilim.fiber” packages. Don't forget to enable
the corresponding bundles (“org.kilim.osgi” and “org.kilim.osgi.fibers”) in your
launch configuration.


Running your application with Kilim instrumentation
---------------------------------------------------

Please refer to [1]. In short, for *development* mode:

1) Open “Plug-ins” view, find org.eclipse.osgi and choose “Import As > Source Project”.

2) Make sure org.eclipse.osgi (from your workspace), org.kilim.osgi and org.kilim.osgi.fibers
are enabled in the launch configuration.

3) Make extra sure org.eclipse.osgi and org.kilim.osgi are located
in the same file system directory (e.g. both in the workspace folder).

4) Recheck that the launch configuration includes org.eclipse.osgi from your workspace,
not org.eclipse.osgi from the platform.

5) Add “-Dosgi.framework.extensions=org.kilim.osgi” to VM arguments of
your launch configuration (found on Arguments tab).


For *production* (compiled & jared plugins) mode:

1) Compile org.kilim.osgi into a jar, and make sure the jar includes
a version number (e.g. org.kilim.osgi_1.0.0.jar).

2) Put org.kilim.osgi_*.jar into eclipse/plugins folder (i.e. into
exactly the same folder where org.eclipse.osgi_*.jar is located).

3) Also compile org.kilim.osgi.fibers into a jar, this one can be treated
like any other plugin (i.e. put anywhere Eclipse can find plugins, etc).

4) Add “osgi.framework.extensions=org.kilim.osgi” to config.ini.


Failure to do any of these steps will cause the Kilim extension to be silently
ignored. In case you find yourself debugging it, two places of interest are:

- org.eclipse.equinox.launcher/org.eclipse.equinox.launcher.Main.readFrameworkExtensions
(Reads extensions list from “osgi.framework.extensions” property and sets up
the class path of the system bundle. The same property is read from numerous other
locations, but those locations do not affect anything loaded from the extension.)

- org.eclipse.osgi/org.eclipse.osgi.baseadaptor.HookRegistry.mergeFileHookConfigurators
(Actually reads the list of hook configurators from hookconfigurators.properties.)


A few more facts
----------------

1) To provide run-time instrumentation, you need adaptor hooks.

2) Adaptor hooks can only be registered in OSGi extension bundles [2]

3) OSGi extension bundles cannot require any other bundles

4) Equinox launcher reads eclipse.properties to determine the extension classpath
(in case you wonder why the file is needed).


References
----------

[1] http://wiki.eclipse.org/index.php/Adaptor_Hooks
[2] OSGi R4 Core Reference, Section 3.15 “Extension Bundles”

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。