On Mon, 2007-06-18 at 14:09 -0700, Bryan Atsatt wrote:
> So an application server would have to create, say, a private
> LocalRepository instance to hold the modules of a single application.
> And it would have to ensure that no other application could get it's
> grubby paws on that repository instance.
>
> Ok. That works for me. And it eliminates the need for cloning AND for
> releaseModule():
>
> 1. Any given Repository instance is either 100% shared or 100% private,
> with *no* in-between.

Since we are talking about appservers, I'll just point out
that this doesn't cover what JBoss allows you to do.

In JBoss we have a notion of what I like to call "ClassLoader Domains"
although they are actually called "LoaderRepositorys" after
the JMX name (note the JMX spec only has a singleton repository).

These are "isolated" classloading systems that sit on top
of a "Default Domain" and you can choose whether to do
parent/child delegation in either
* standard J2SE order (parent first)
* servlet style (child first).

When you deploy an application you get to choose the domain.
There is nothing to stop you putting multiple applications
into the same domain.

I would guess in your proposal they WOULD share the
same LocalRepository but only those named applications
would have access to it?

There are two main usecases for such a configuration.

1)  Optimization
You want to optimize the inter-application communication
between related applications. i.e. one application uses
components from another application and you don't want
to do call-by-value.
By having the applications in the same classloader domain
one application can lookup and use the local interfaces
of the other application.

2) Convenience
You deploy a rar inside an ear (making the rar classes
invisible to other applications)
but you want to configure the connection factories
of that rar outside the ear where it is easier to
edit the configuration file.

In this case you can specify that the connection factories
should use the classloading domain of the ear, making
its classes visible again.

e.g. something like:

<connection-factories>

<loader-repository>classloader:application=myapp.ear</loader-repository>

<etc/>

--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Reply via email to