multiple instances of AS per VM?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

multiple instances of AS per VM?

Scott Marlow
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.

Scott
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: multiple instances of AS per VM?

jtgreene
Administrator
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
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev