Hello. Im not pretty sure on how or is it possible to do it. I need to know on how (if possible) to keep the value of a Vector in memory until the user log out from the system. Similar to a session. Im developing a system for Network Marketing Company(e.g. Amway). So i need the list of user's downlines in the whole system without querying to the database again and again. Thanks and i hope i made it clear. Need really an expert advice here.
just some ideas, tho i'm not sure exactly what you can access in the desktop environment:
Ideas Part (1) "shutdown" hook
(a) if you have access to "comms/logout" code (somehow you would have to have this, i think, to know how long to maintain the vector?), you could use a shutdown hook to transfer the vector to a physical or virtual (mem) location accessible to the logout component, or .. [ideas below]
(b) You could have your shutdown launch a tiny zombie at shutdown (written in, say, C), that *could* monitor connection status (active), or later be accessed by your 'logout' component(passive), then provide Vector access, then die.
Ideas, Part (2) serialized vector (w or w/out logout timestamp)
(a) serialized vector will be more versatile - can be stored in tmp, "cookie-ized', sent over any comms, etc.
(b) you could also jam a (ser) obj back into an implementation resource such as jar, config file, etc - if security/access/visibility is an issue, for later access by whatever
[but in the "olden daze", we would have poked the little puppy in a hard-coded mem loc... sure am glad since the olden daze passed away:-)