Re: calling java from a javascript XPCOM component

From: Andrew Harrison <a.b.harrison_at_cs.cardiff.ac.uk>
Date: Thu, 8 Dec 2005 14:16:19 +0000

Hi David,

Thanks for this. I decided to get to Java via C++ because I didn't
want to go via a webpage. I was writing a protocol handler, so your
technique of using LiveConnect didn't work for me. There are some
similarities to your method however. I had to get to the already
initialized JVM that is loaded with the browser, so I couldn't set a
classpath like you would normally do with JNI when creating a JVM.
Instead I have to get a URLClassLoader and pass it the libs and
classes to load.

I've been listening to the discussions on this list since my initial
query and it's very interesting. My protocol handler calls back to a
P2P framework we're developing (at Cardiff, Wales, UK). The aim of
the extension is to allow publishing and discovery of resources in a
decentralised manner - i.e. your browser becomes a Peer. This issue
has been touched upon in the list with regards to Semantic Bank. I'd
like to tie in my stuff with Piggy Bank when I get the time.
Unfortunately I'm having to work on this firefox stuff 'out of hours'
so progress is patchy, but hopefully I'll have something going in
the new year. I'll let you know.

Keep up the good work.

cheers,

Andrew




On 7 Dec 2005, at 15:11, David Huynh wrote:

> Andrew-- in case you're still investigating, here's a barebone
> component for this technique:
>
> http://simile.mit.edu/java-firefox-extension/
>
> Cheers,
>
> David
>
>
> Andrew Harrison wrote:
>
>> Hi,
>>
>> This is really a general question. Piggybank seems to be able to
>> create Java object from within a Javascript component. Could
>> anyone explain how this was achieved? I've got LiveConnect working
>> in the JavaScript on an html page, but when I try the same thing
>> from within a component it doesn't work. So somehow I need to
>> tell Firefox to use the LiveConnect when it's loading the
>> component, but I can't work out how.
>>
>> Any help appreciated.
>>
>> cheers,
>>
>> Andrew
>>
>> PS - I'm on a Mac - but like I say, I've got the LiveConnect
>> working in an html page.
>>
>
Received on Thu Dec 08 2005 - 14:09:41 EST

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:18 EDT