Re: SISC in applets

Turadg Aleahmad <[email protected]>
Newsgroups gmane.comp.java.sisc.devel
Message-ID <[email protected]>
Matthias Radestock wrote:

> PS: next time please don't reformat the entire file.


Oops.  I'm using Eclipse and I've got an itchy "Ctrl-Shift-F".

>> 2) With applet-level permissions, loading the heap takes much much longer
>
>
> couldn't spot anything obvious.


I don't know what was happening before, but it's not happening anymore.  
Same goes for that reverse! problem I mentioned in #sisc.  (Though I 
think that one's related to sisc-lib.jar out of sync with the heap.)

> Stick a custom sisc/util/Defaults.class at the beginning of your class 
> path.


I couldn't get this to work.  I put a custom Defaults.class into a 
sisc-override.jar and put that earlier in the class path.  BTW, why is 
it an interface instead of an abstract class?  I read in Effective Java 
that using interfaces for constants is bad.  You can't argue on brevity 
since DEFAULT_PERMIT_INTERRUPTS is just as long as 
Defaults.PERMIT_INTERRUPTS.  Ok, one char shorter.  :)


In other news, I added a target that builds sisc-heap.jar.  This 
contains sisc/boot/sisc.shp and sisc/boot/HeapAnchor.class.  This works 
fine for me, but I have another idea that may be better:  
sisc.boot.HeapLoader (or HeapUtil, something like that).  It has one 
method getHeap() (or whatever) that returns a SeekableInputStream.

public static SeekableInputStream getHeap() {
    URL heapURL = this.class.getResource("sisc.shp");
    if (heapURL == null) return null;
    return new MemoryRandomAccessInputStream(heapURL.openStream());
}

The only problem I see with this is creating Java code that depends on 
the JAR that ant builds.  But I think it's important for applets to have 
an easy, consistent way to retrieve the heap and I would say that weighs 
more.  What do you think?


-Turadg




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.