[Kde-java] KIO Slave in Java
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Fri Feb 27 21:02:14 CET 2004
On Friday 27 February 2004 18:17, Daniel Hanlon wrote:
> Hi Richard,
>
> Thanks for replying so quickly!
>
> On Friday 27 February 2004 18:00, Richard Dale wrote:
> > case Get:
> > myJob = KIO.get( src, true );
> > connect(myJob, SIGNAL("data( Job, byte[])"),
> > SLOT("slotData( Job, byte[])"));
> > break;
> >
> > case Put:
> > putBuffer = 0;
> > myJob = KIO.put( src, -1, true, false);
> > connect(myJob, SIGNAL("dataReq( Job, ByteArrayOutputStream)"),
> > SLOT("slotDataReq( Job, ByteArrayOutputStream)"));
> > break;
> >
> > So I'm not sure if you have to useJNI - I would have thought if you are
> > wanting to go java <-> java and so it should be possible to avoid it.
>
> The problem is that KIO.get leads to an analysis of the "protocol" and then
> it launches something that implements/extends SlaveBase via kdeinit. KIO's
> quite clever and you don't have to implement all the methods of SlaveBase
> for KIO to realise that for example a "move" can still be performed with
> "copy" and "delete". I think I need to read up more on exactly how the
> protocol implementation is launched - C++ isn't exactly my forte so I was
> just being lazy and trying to avoid it! :-)
I was wondering if you could use a relatively generic kioslave which you
connected via slots/signals to byte[] arrays as above to intercept the
messages, and it would then talk in turn to the GridFTP api. You could only
do that for your current application though. However, I know nothing of the
GridFTP api..
In order to have something launched via kdeinit I think it would need to be
compiled to native code with gcj. I haven't been looking at KDevelop 3.0
recently, but perhaps a java kioslave project template to do that would be
really good. Most dynamic loaded code has a C function as an entry point - I
don't think you would need any JNI for that, just a small C/C++ 'stub' part
to get it going. The Koala java api has pretty much all the jni calls covered
already.
-- Richard
More information about the Kde-java
mailing list