Re: persistent object?
On Apr 28, 10:15 am, Arne Vajh=F8j <a...@vajhoej.dk> wrote:
SpreadTooThin wrote:
I need a list of objects that can survive from one invocation of the
application to the next.
Is this doable in Java or does that break sand box rules?
In my case I simply need a list of structures to exist and be reloaded
if the application is quit and restarted.
A Java application does typical not run in a sand box and are
therefore capable of writing and reading local files.
Java applets is another story.
Java applets (1.4+) have the AppletContext.getStreamKeys()*/
getStream()/setStream() methods, which might seem at
first look to be for inter-applet communication (and
can be used for that) but also, apparently, for
persistence. They are limited to around 63-64Kb.
*
<http://java.sun.com/javase/6/docs/api/java/applet/
AppletContext.html#getStreamKeys()>
Apps. launched using JWS are also subject to a sandbox
unless they are digitally signed & request/are granted
all-permissions or j2ee-application-client-permissions
(a horrid name for limited extra permissions, IMO).
Even sandboxed JWS apps. can access the PersistenceService
Demo of the persistence service.
<http://pscode.org/jws/api.html#ps>
--
Andrew T.
pscode.org