Global java object not exposed to JavaScript XPCOM components

RESOLVED WONTFIX

Status

()

Core
XPConnect
RESOLVED WONTFIX
13 years ago
10 months ago

People

(Reporter: Collin Jackson, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51
Build Identifier: 

I want to instantiate a java object (e.g. new java.math.BigInteger) from an XPCOM JavaScript component. Currently the only way to do this seems to be getting a handle on a window and using window.java. However, it would make for much cleaner interfaces if I could access the "java" object directly.

Reproducible: Always

Steps to Reproduce:
1. Build an XPCOM component in JavaScript.
2. Try to use the "java" object.


Actual Results:  
It doesn't work, because "java" is not defined.

Expected Results:  
Allowed me to access the global "java" object.

Updated

13 years ago
Assignee: jhpedemonte → dbradley
Status: UNCONFIRMED → NEW
Component: Java to XPCOM Bridge → XPConnect
Ever confirmed: true
QA Contact: xpcom-bridge → pschwartau

Comment 1

13 years ago
the code to do this currently lives in
nsJSContext::InitializeLiveConnectClasses

it could be moved to xpconnect i suppose.

anyone happen to know how thread friendly java is?

reporter: it'd help if you tested this heavily to try to find out if e.g.
initializing java on a different thread has any interesting consequences.

i suppose it'd be fairly hard to convince gecko to actually try to create its
first jscontext off the main thread, the easiest way would probably be a c++
component that in its NSGetModule function created an osnative thread that then
tried to instantiate a jscomponent. you'd have to make sure that no jscomponents
registered before that c++ component in that session and that no jscomponents
were registered to be created at startup before your c++ component tried to do
its dirty work.

at one point we tried to actively delay java initialization, but i have a
feeling that we gave up at some point, i wonder if this would have startup time
implications, i guess the answer is probably not much.
Assignee: dbradley → nobody
QA Contact: pschwartau → xpconnect
I think the global java object is long gone.
Status: NEW → RESOLVED
Last Resolved: 10 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.