geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Axis module review
Date Fri, 29 Oct 2004 06:52:35 GMT
First of all, I'm hoping to start looking seriously at web service 
deployment soon.  I think it will require some fairly fundamental 
modifications of how deployment in geronimo is structured.  However, 
these changes will also allow us to do things like deploy portlets in a 
well integrated way.  So, you may not be able to do everything you need 
to do in geronimo yet:-)

Generally the deployer components don't assume anything in the runtime 
system is available or running.  The role of a deployer is to a large 
extent to construct gbean configurations.  The information it needs 
should be supplied as gbean attributes or references.  For instance, if 
you look at the EarConfigBuilder gbean, it has references to various 
j2ee module deployers for web, ejb, connector, and client, but the only 
knowledge of the runtime server is from object names for the components 
that will be needed at runtime.  These object names are copied into 
many of the "output" gbeans as references.

Both  the assembly j2ee-deployer-plan and j2ee-server plan have all the 
deployment gbeans in them currently: this is a good place to look to 
see how the configuration fits together.  The deployer gbeans really 
shouldn't be in the server plan, but are there because we unfortunately 
included the deployment code in the same module as the runtime code in 
the early days of geronimo, and haven't had time to split them into two 
modules. The client module is properly divided into runtime and 
deployment (client-builder).

My understanding of web services is that messages can be sent to either 
servlets or ejbs.  (Apparently the servlets aren't "Servlet" 
implementations, but are usually wrapped in one).  We need a gbean to 
be deployed for each such servlet and each such ejb.  At the moment I 
think the best approach is to have a WSServletBuilder and a 
WSEJBBuilder that will actually build the gbeans.  These, especially 
the WSEJBBuilder, would be similar to the openejb SessionConfigBuilder. 
  (I don't know what kinds of ejbs can be the target of a WS message: 
I'm assuming only stateless session beans.  If there are others, they 
would need their own builders).

One problem is that currently we are not providing gbeans for normal 
web servlets, but are just relying on the Jetty deployer.  This will 
have to change anyway, but it may be difficult to  write a 
WEServletBuilder until this is fixed.

At the moment I don't have a good idea about how to determine that a 
j2ee module contains web services, and should go to the WS deployer.  
Can a single WS module deploy both servlets and ejbs, or would this 
require two modules?

I'll try to put some more comments inline.

On Oct 28, 2004, at 10:59 PM, Srinath Perera wrote:

>> I was just reviewing the code in the Axis module and noticed some
>> things that are considered no-nos or bad practice with the Geronimo
>> architecture.  This is our fault for not reviewing the code sooner.
>> Let me try and make up for this lack of feedback.
> Thanks David, when I start with the Axis module I want to get the Web
> Service working, and hope things would shape up when the comment come
> as I am great beliver of starting with something runing and shape it
> up.
> let us address the things one by one. To put it in simple words I wan
> to do the following
> There are three senarios
> 1)  Start Axis
>    * I need jetty and open ejb running

openejb isn't really a "thing": for the most part each ejb gets 
deployed independently.  What the WS deployer needs to do is to  
construct gbean configurations for WS servlets and WS ejbs and add them 
to the configuration it is constructing.  Jetty is a bit more of a 
"thing", but, if you deploy a web app, it will be registered with Jetty 
>   *  I need to start the AxisGBean
I'm assuming this is needed at runtime rather than deployment time.
This should be done by putting an xml configuration for the axis gbean 
in j2ee-service.xml. It could also go in a separate plan which might 
make it easier to experiment with.
>   *  I need to start Axis Servelt inside jetty
This will eventually be done automatically: all the WS deployer will 
have to do is construct the gbean configuration for the axis servlet 
> 2) deploy a Webservice
>   * I need to invoke the deploy(...) in AxisGBean
I don't know what this does
>   * Axis GBean register the Web Service in Axis (which is WS detail I
> belive I can handle it)
I think this could be done by having reference collections on the axis 
gbean that contain all the ws servlets and ws ejbs.  Whenever one of 
these components starts, it will be automatically added to the 
reference collection, and you can be notified on a listener.  The axis 
gbean can then register the WS in axis.  One example of something like 
this is the transactiom manager recovery in TransactionManagerProxy.  
(don't worry about the recovery part, it's just an example of how to 
use the reference collections).
>   * I need to deploy and start if there are ejb's bind with Web Service
Similarly, the deployer would construct the gbean configuration, and 
when the gbean starts, it would be added to the axis gbean reference 
> 3) Invoke a Web Service
>  * Axis Servlet will capture the SOAP/HTTP request  and go ahead with
> the web service
>  * if the impl of the Web Service is a EJB I need to invoke it using
> the Geronimo internals (Using Contianer Index now).
> I need to learn following
> 1) How to use the plans to start the Geronimo from a test case. So to
> do it with out hardcoding object names

I think looking at how the EarConfigBuilder is set up shows how to  
avoid hardcoding object names.    Probably the openejb 
EJBConfigBuilderTest has the most detail on starting geromino in code 
and doing something like deployment.  You might also look at the 
openejb itests which run a single instance of geronimo through the 
whole test suite.
> 2) How to start a AxisGBean from plan
Include xml configuration for the gbean in the plan.  I'd look at 
j2ee-system-plan in modules/assembly
> 3) How to start Axis Servlet from the AxisGBean
This should actually be constructing a servlet gbean configuration from 
the web service deployer.  This will be difficult until we construct 
gbeans for regular servlets.
> 4) how to call a deploy(..) method of AxisGBean with out using Kernel
This is sort of the wrong question.  We need a web service 
configuration builder that can be called by the rest of the deployment 
framework.  There will be a reference to the web service deployer 
somewhere in the deployment framework, and the framework will call the 
various deployment methods for you.  However, getting this to work 
right and fit into geronimo well may require some significant 
restructuring of the current framework.
> 5) How to deploy a ejb and start ejb from the AxisGbean
All the web service deployer will need to do is configure a gbean for 
the ejb and add it to the configuration object the deployer is 
constructing.  Geronimo will do the rest for you.
> Q1) can somebody name me a module which use plans to bring the
> geronimo up with web, ejb continer, AxisGbean started so that I can
> use junit test to test it? Are they all do it .. will check
> Q2) How can I programtically requst the services from the Geronimo
> (with out using the kernel). e.g. deploy this ejb, start/stop this
> service ect
To really request deployment services, you should use jsr-88.  This can 
be done for instance from maven: you can look at the itests module.  
However, to unit test deployment pieces, you can generally either 
construct the gbean in code and call it directly or register it with a 
kernel and invoke a method from your test code.  In a gbean, if you 
need to get another gbean  to do something, you should have a reference 
to it in your gbean: when your gbean has started, there will be an 
object there implementing the interface or class you requested, that 
you can call methods on directly.

Hope this helps a bit.

many thanks,
david jencks

> if anybody can point me to the testcases in other modules that do the
> above that would be very helpful :)
> Thanks
> Srinath
> p.s. I wrote the code by looking at the test cases in other modules ,
> see how they setup the geronimo for test ect.

View raw message