----- Original Message -----
From: "Timothy Wall" <twal...@dev.java.net>
To: <use...@jna.dev.java.net>
Sent: Saturday, October 13, 2007 4:06 PM
Subject: Re: [jna-users] Wrapping a C api to control Matlab using Java (with
example)
I think binding to the C interface via JNA is a better solution, since
you know *that* is never going to change, and probably gives you more
functionality, since MatlabControl doesn't really provide for data
exchange except via matlab's output buffer.
My initial efforts are here:
http://array4j.googlecode.com/svn/trunk/src/main/java/net/lunglet/matlab/
http://array4j.googlecode.com/svn/trunk/src/test/java/net/lunglet/matlab/
http://array4j.googlecode.com/svn/trunk/src/test/resources/net/lunglet/matlab/
The few basic tests I've written so far seem to indicate that things are
working nicely.
If anyone wants to hack further, contact me, so I can add you as a developer
on the array4j project.
The next order of business is probably to build out the Engine class a bit
to make it easier to execute MATLAB code. mlabwrap for Python has some cool
features that might provide some inspiration.
Then I'd also like to sort out a callback mechanism from MATLAB back into
Java code.
Unfortunately, you can't use the JNA callback mechanism here, because the
MATLAB engine runs in a separate process (if anyone knows if this "feature"
can be circumvented, that would be great).
Luckily, MATLAB can call easily call Java functions, so I've started playing
with using RMI to call back from MATLAB into my Java process. The Engine
class could provide some methods to make setting up all the details a bit
easier.
I haven't got it working yet though -- dynamic class loading and stubs and
interference from Jini included with the MATLAB Distributed Computing
Toolbox makes this an interesting exercise, to say the least.
Regards,
Albert