Question on sharing a JVM between 'applications'...

S

Steve Wampler

I'm looking into using a 'Container/component model' (using ICE,
not CORBA, in this case). The general idea is that a container
can manage multiple, independent applications (components).

However, I'm stuck on one point. When running an application
on a standalone JVM, it's possible share data across all objects
through the use of a singleton class, or through static variables
and methods. However, that breaks down when sharing a JVM
across applications. As far as I know, that singleton class
(applies to static variables, as well) would be visible to all
components in the JVM - instead of just to that single component).

I need 'component level locally-global' storage. Is there a
way to get this other than having to pass some id data through
*every* method and constructor call performed in the component
[which is not an acceptable solution]?

Anyone run into this and have a solution (be careful if you
haven't thought about it before - I don't think the solution
is obvious...)

Thanks!
Steve
 
L

Lee Fesperman

Steve said:
I'm looking into using a 'Container/component model' (using ICE,
not CORBA, in this case). The general idea is that a container
can manage multiple, independent applications (components).

However, I'm stuck on one point. When running an application
on a standalone JVM, it's possible share data across all objects
through the use of a singleton class, or through static variables
and methods. However, that breaks down when sharing a JVM
across applications. As far as I know, that singleton class
(applies to static variables, as well) would be visible to all
components in the JVM - instead of just to that single component).

I need 'component level locally-global' storage. Is there a
way to get this other than having to pass some id data through
*every* method and constructor call performed in the component
[which is not an acceptable solution]?

This is solved by using a separate classloader for each component ... that's what
containers like application servers do.
Anyone run into this and have a solution (be careful if you
haven't thought about it before - I don't think the solution
is obvious...)

There are still other issues to be dealt with for true isolation of components --
System.out/System.in/System.err for instance, however the classloader solution may be
acceptable isolation for simple situations.
 
S

Steve Wampler

This is solved by using a separate classloader for each
component ... that's what containers like application servers do.


There are still other issues to be dealt with for true isolation
of components -- System.out/System.in/System.err for instance,
however the classloader solution may be acceptable isolation
for simple situations.

Yes - that should work for my purposes just fine. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top