[jboss-as7-dev] multiple instances of AS per VM?
Jason T. Greene
jason.greene at redhat.com
Tue Jan 24 13:20:21 EST 2012
On 1/24/12 12:14 PM, Scott Marlow wrote:
> Do we have any use cases where we need to support multiple instances of
> the AS per VM? I heard that this was part of the early design but
> doesn't seem to be taken advantage of, as far as I know.
>
> In my changes for AS7-2076 (serialization of extended persistence
> context), I used a class variable, which would be shared between the
> multiple AS instances (if I don't change it). I could switch to using a
> service and lookup the service through
> CurrentServiceContainer.getServiceContainer().getService() but that also
> uses a class variable for tracking the current AS. The advantage of
> using CurrentServiceContainer.getServiceContainer(), is better
> encapsulation of code that needs to change, if we do run multiple AS
> instance per VM at some point.
It's very difficult to achieve since so much code (thirdparty and in
many cases ours) relies on static variables. So really the only way you
can truly do this is to have duplicate modules for everything. That
said, we have tried to minimize at least our code from doing this.
What's more important is that :reload works correctly, and that means
not caching any service related details in static variables.
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
More information about the jboss-as7-dev
mailing list