I ended up implementing nsIFactory, and nsISupports in my java class.
At runtime in my java code, I do something like this to register my
components:
registerComponent() {
Mozilla mozilla = Mozilla.getInstance();
Foo f = Foo.getInstance();
nsIComponentRegistrar registrar = mozilla.getComponentRegistrar();
registrar.registerFactory(
Foo.CID, "Foo Component", Foo.CONTRACT_ID, f);
}
I also have an idl file that is compiled into an typelib that is
registered into xpcom.
After this is done, I can call this code from my javascript.
I hope this will help anyone else doing this sort of thing.
-Bryan
bc wrote:
> Hey Everyone -
>
> I've been trying to figure out XULRunner/javaXPCOM for about 3 weeks now
> and i wanted to make sure i'm going about it correctly.
>
> I have mostly implemented an XPCOM object in java - implemented
> nsIFactory, nsIModule, and nsISupports interfaces in a Java class
> (although i'm not sure it's all correct). I'm thinking the thing to do
> now is register my java implemented xpcom object. Can i do this at run
> time with the component registrar or does the registration need to take
> place elsewhere?
>
> Thanks,
> Bryan
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding