Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  3DzzD - Applet Boot V2 updated  (Read 9408 times)
0 Members and 1 Guest are viewing this topic.
Offline CommanderKeith
« Reply #30 - Posted 2010-05-03 05:35:28 »

It seems like it loads some more things after the start of the applet:
1  
2  
3  
4  
5  
6  
7  
LineOfSightApplet: contructor begin
network: Cache entry not found [url: http://keithphw.freehostia.com/LineOfSightApplet/test/LineOfSightApplet$1.class, version: null]
network: Connecting http://keithphw.freehostia.com/LineOfSightApplet/test/LineOfSightApplet$1.class with proxy=DIRECT
network: Connecting http://keithphw.freehostia.com:80/ with proxy=DIRECT
.
.
.

Uh huh! Thanks  Smiley I never knew about setting the trace level on the console. Well that explains the 5 second gap - the URLClassLoader is downloading the classes it needs to do the run method. Pity there's no way to load them all before hand without manually doing 'loadClass(classNameString)' for each class. Hm, the time taken for the URLClassLoader to download each little class separately must be pretty inefficient.

I have not been able to use v2 of the boot, because I can't access resources as I used to.
1  
Thread.currentThread().getContextClassLoader().getResourceAsStream(resource)

dosen't find the stuff from "BOOTJARS". The console just freezes, but I think that is the problem. I guess they are only available from another thread/classloader. Not sure if I made some mistake somewhere along the line. Suggestions are welcome. I guess it might be time for me to learn about classloaders...
Maybe try accessing them directly from the URLClassLoader which loads the rest of your app?
It's declared in this line:
1  
ucl = ((URLClassLoader) Thread.currentThread().getContextClassLoader()).newInstance(urlJars);

Then call
1  
ucl.getResourceAsStream(resource);


Offline DzzD
« Reply #31 - Posted 2010-05-03 08:15:21 »

I have only got problem on ressource when I run Applet locally (AccesControlException because the protocole is file) in other case (when online) it strangely works well...

Plz if you make significant change/improvment post it somewhere, maybe as this code is pretty short & simple we could use Jojoh Wiki and make modification on it, Wiki is nice as it enable history & discussion. Also I propose to put the BootClassLoader as an inner class so the whole code will be only one file (usually not very clean to do that but in this case it make sens).

A target I think good to keep in minds for the loader are : be generic & compatible with the lowest java version possible, inded it is also important that it become robust & stable (must never crash) as an applet crashing is not that bad if the user is well informed.

finally the ultimate goal would be to have a very generic "shell/container" for applet enabling better user experience on applet start aswell as applet crash
 

Offline CommanderKeith
« Reply #32 - Posted 2010-05-03 12:26:47 »

For sure. I haven't changed much, just the invalidate/validate thing I mentioned already.
There are 3 problems which I'd like to look into.
How to load all the classes before the main application starts - currently they're only downloaded on-the-fly as needed.
How to avoid having to re-download the jars every time the applet is reloaded.
Getting rid of the coffee cup animation at the very start

Thanks for the help Smiley

Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (43 views)
2014-10-17 03:59:02

Norakomi (33 views)
2014-10-16 15:22:06

Norakomi (26 views)
2014-10-16 15:20:20

lcass (30 views)
2014-10-15 16:18:58

TehJavaDev (60 views)
2014-10-14 00:39:48

TehJavaDev (60 views)
2014-10-14 00:35:47

TehJavaDev (50 views)
2014-10-14 00:32:37

BurntPizza (66 views)
2014-10-11 23:24:42

BurntPizza (38 views)
2014-10-11 23:10:45

BurntPizza (80 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!