Yes I'm using JavaXPCOM. Here's the basic layout/strategy.
I have my IDL file which i compiled into a typelib and java interface.
Then i implemented the interface in java via JavaXPCOM.
To register the XPCOM component I do something like this:
registerComponent(){
Mozilla mozilla = Mozilla.getInstance();
Foo f = Foo.getInstance();
nsIComponentRegistrar registrar = mozilla.getComponentRegistrar();
registrar.registerFactory(
Foo.CID, "Foo Component", Foo.CONTRACT_ID, f);
}
Note that my Foo implementation implements both IFoo (which means i'm
implementing nsISupports) and nsIFactory.
Once this registration occurs I am able to call any of my java specific
implemented methods from my javascript. Coincidentally i finally got it
working just a moment ago.
-Bryan
Nickolay Ponomarev wrote:
> On 9/25/07, bc <[EMAIL PROTECTED]> wrote:
>> I have implemented an XPCOM object in java and i'm trying to call it
>> from javascript.
>
> Ah, I'm not familiar with Mozilla's integration with Java, sadly. Do
> you use JavaXPCOM?
>
>> I was actually hoping there was a way to enable a
>> debug console of some sort
>
> AFAIK, there's no debug console. There may be some NSPR-based logging
> in JavaXPCOM, I don't know.
>
>> so that i could see that the xpcom object was
>> getting registered correctly from the java, and being called correctly
>> from the javascript.
>>
> Hm. I'm probably not being of much help here, but now I'm curious --
> how do you "register" your XPCOM component? AFAIK, there's no
> component loader implemented for Java ATM.
>
> Nickolay
>
>> Nickolay Ponomarev wrote:
>>> On 9/21/07, bc <[EMAIL PROTECTED]> wrote:
>>>> is there any way to get trace for xulrunner?
>>>>
>>> What exactly is your question? You can build a debug XULRunner
>>> yourself of course.
>>>
>>> If you're asking about the symbols for release builds (for getting
>>> meaningful stacks for crashes and the like), I'm not sure they are
>>> provided, but Mac builds probably ship with symbols.
>>>
>>> Nickolay
>> _______________________________________________
>> dev-embedding mailing list
>> [email protected]
>> https://lists.mozilla.org/listinfo/dev-embedding
>>
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding