[jboss-dev-forums] [Design of POJO Server] - Re: Deployers in AS

adrian@jboss.org do-not-reply at jboss.com
Wed May 14 06:18:18 EDT 2008


"ALRubinger" wrote : We've previously talked about the deployers being an integration point with AS, and therefore should be placed within the AS source tree.
  | 

That is correct. Here's a repeat of the reasons I've stated before in both the aop,
tomcat and webservices forums.

NOTE: This is an idealisation of where we want to get to, rather how it has
actually being done now.

1) DO IT

Individual projects should not be making policy decisions. They're job is to "do one
thing well". In ejb3's case, its task is to create an EJB container from an EJBMetaData object.

The deployers are just a mechanism to construct metadata and then
create the MC ControllerContext(s) that will actually instantiate the real objects.

The parsing available in the metadata project (from ejb-jar.xml and jboss.xml)
should be enough to write your tests (using the same hooks that the deployers
use to create the real objects). 
You don't care how the EJBMetaData gets constructed, that is a policy decision of the
appserver. e.g. parsing annotations, programmatically or something else.

i.e. Appserver/deployers is:
Some artifacts -> metadata
ejb3 is:
ejbmetadata -> ejb3 container

The examples I give are the MC and new classloader. Neither of these projects
depend upon the deployers. Instead there are deployers that integrate this code.
e.g. when I test unit test the classloaders, I just parse the 
jboss-classloading.xml (or create it programmatically) and then use the
same ClassLoading api that is used by the classloader deployers.

2) Standalone usage

The individual projects should not depend upon the appserver's deployers
or even the deployment api.
Use case: If I want to re-use ejb3 programmatically I should just be
able to instantiate the ejb3 metadata and make some call to a factory in the ejb3
project.

If I have to mock out deployment api (which I have to do with the current ejb3 api
because it wronglg depends upon the deployers api) 
or otherwise make use of appserver specific stuff there is something wrong.

This also reflects the idea that the deployer and runtime are different ideas/artifacts.
i.e. the ejb3 deployer(s) are just responsible for creating and manipulating metadata
then using the MC to activate it via the runtime component. (See for example
the split we did of the Tomcat service).

There should be no runtime parameters/service injection etc. onto the deployers
that should be injected onto the runtime service.

NOTE: There's another reason for this seperation which is we
want to be able "bootstrap" an appserver configuration "offline" in
a management client to verify it works without actually starting it.
i.e. it just goes through the deployers and dependency validation without
actually constructing the real services.
This is impossible without a proper seperation.

3) Configuration

Deployer and runtime configuration is a policy decision of the appserver.
If I want to swap out, augment or otherwise change how EJBMetaData gets
constructed that is something that is done in the integration project i.e. the AS.

The configuration files should therefore live there where they can be easily changed.

To make version control easy/managable, it also makes sense for the deployer to live
in the same codebase (although obviously not a requirement).

But more importantly, there will be many different configurations/implementations.
e.g. JBoss Embedded has a totally different mechansim (search the externally 
constructed "classpath") on how to find ejb deployments to 
what the appserver does.


SUMMARY

EJB3's job should be to provide a Runtime service that can be used to
construct EJB3 container(s) from EJBMetaData (and others) 
with other service injections onto that service.

The Appserver's job (or any other project) is to create that metadata
(currently done using the aspectized deployers) and use that Runtime service
(currently done via the MC).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150666#4150666

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150666



More information about the jboss-dev-forums mailing list