EAI - timing problem between applet and wrl 
Author Message
 EAI - timing problem between applet and wrl

Hello!

I am implementing EAI, letting an applet work against an embedded vrml
world, that is dynamically generated using php3.

I use jdk 1.17, netscape 4.6 and Cortona VRML client.

It seems as if the delay caused by the world generation gives the applet

problems, because when I tried to replace the world with a static .wrl
file, the applet did iindeed find the browser.

I tried to delay the returning of the init()
method by a constant number of elapsed seconds, using (for 10 seconds)

void init(){
.....
long st = System.currentTimeMillis();
  while (System.currentTimeMillis()<=st+10000){

  }

Quote:
}

This helps as now the applet finds the browser, but this is a louzy
sollution as it is not exactly general.

I would like a suggestion of a sollution that detects that the
php-generated vrml file is completely deployed, but I know very little
about
inter-process and inter thread communication in Java.

A short browse through the documentation indicates that wait() may be a
solution. Any hint on how I apply it into this case? For example, How do

I gain control of the
thread (if any) responsible for the vrml browser object?

Thanks

--
Michael Preminger

Forsker / Research Scientist
Avdeling for journalistikk,
bibliotek- og informasjonsfag /
Faculty of Journalism, Library and
Information Science
H?gskolen i Oslo / Oslo College

http://www.*-*-*.com/ ~michaelp

Pilestredet 52, N-0167 Oslo
Voice: +47-22452778
Fax:   +47-22452605



Mon, 25 Feb 2002 03:00:00 GMT  
 EAI - timing problem between applet and wrl
On Thu, 09 Sep 1999 09:59:01 +0100, Michael Preminger


Quote:
>void init(){
>.....
>long st = System.currentTimeMillis();
>  while (System.currentTimeMillis()<=st+10000){

>  }
>}

In that case I use

try{Thread.sleep(10000);}
catch(InterruptedException e){
  System.out.println("Can't sleep or something woke me up: "+e);

Quote:
}
>This helps as now the applet finds the browser, but this is a louzy
>sollution as it is not exactly general.

>I would like a suggestion of a sollution that detects that the
>php-generated vrml file is completely deployed, but I know very little
>about
>inter-process and inter thread communication in Java.

>A short browse through the documentation indicates that wait() may be a
>solution. Any hint on how I apply it into this case? For example, How do

>I gain control of the
>thread (if any) responsible for the vrml browser object?

I have no solution to the original problem. If one uses Object.wait()
method there should be something that calls object's notify() method
and my guess is that the "something" comes with netscape's
documentation on the JVM or the plugin interface.

My second guess is that it would be best if one could register
interest in the VRML browser plugin similar to awt's event listeners.

I'm afraid this was not very helpful.

Atschoe, Axel



Mon, 25 Feb 2002 03:00:00 GMT  
 EAI - timing problem between applet and wrl
I used this:

    public void start()
    {
        while ((browser = Browser.getBrowser(this)) == null)
        {
            try
            {
                Thread.sleep(250);
            }
            catch (InterruptedException interruptedException)
            {
            }
        }
    }

from one of the Cosmo/EAI samples.  The comment states you may need to do
this to deal with loading latency.  Unless the browser has some notification
call-back you can register with, this is a low cost solution.  Anything that
smacked of polling would eat CPU in a tight loop, unless you sleep between
tries (hence this loop).

This is as much as I know on this issue.

- John



Mon, 25 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. EAI:wrl-File und Java-Applet in different Layer

2. EAI Applet in Communicator 4.5 problem

3. Java Applet EAI problem

4. JAVA applet problem in EAI

5. Problem running EAI applet

6. Problem with .wrl file - mack12.wrl (1/1)

7. Problem with .wrl file - mack12.wrl (0/1)

8. Applet to control the embeded WRL

9. How to save a *.wrl file using EAI

10. how to write .wrl file using EAI

11. Problem with vrml- and java-time (using EAI)

12. EAI: getBrowser(Applet,frame,index)

 

 
Powered by phpBB® Forum Software