You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by ja...@mac.com on 2003/08/12 08:07:06 UTC

[services] getting service developers started - the initial component model

I'm sure we could all debate the perfect container framework and 
compare and contrast the intricacies of the various flavours of Avalon 
containers, PicoContainer, JMX & Java Beans until the cows come home. 
However what is really important right now is we start writing 
lightweight, pluggable services ASAP to start filling in the J2EE stack 
for Geronimo.

Up to now the Geronimo codebase has assumed a JMX micro kernel, 
following in the footsteps of JBoss, Tomcat 5 and Jetty. I'm sure this 
can be improved with time though this strategy has been proved to work. 
Before we get bogged down in months of upfront design for what the 
perfect container should be - I'd like us to be able to make good 
progress integrating the various services - of which there are many. 
Then we have some real use cases that can help us as we refactor the 
Geronimo container.

What I'd like to do as an initial step is choose a default component 
model for service developers to follow as they write Geronimo services. 
For some time most of the main services in Geronimo are going to be 
fairly course grained (web container, Axis, JMS provider, JTA etc). In 
addition at the time of writing Geronimo can deploy MBeans.

So initially I think the component model should be JMX MBeans. These 
are simple, lightweight components that have no compile time 
dependencies on anything. The MBeans themselves should follow the 
Inversion of Control pattern - i.e. the container instantiates & 
configures the MBean. In addition we should try follow the MBean 
interface pattern such that we can do efficient interception easily 
with dynamic proxies - also note that MBeans do not need to use JMX at 
all - any container mechanism can be used to configure & wire together 
the components.

Already today Geronimo can handle MBeans. It must always be able to 
handle MBeans. Indeed whatever Geronimo's container framework becomes 
it should be easily cable of working with the plethora of J2EE MBeans 
that are out there. (MBeans are essential to J2EE).


So in summary

* lets start writing J2EE services as MBeans that we can plug into 
Geronimo today.

* in parallel to this activity folks can help improve & innovate inside 
the Geronimo kernel - without adversely affecting the progress of the 
component authors - we can all work in parallel

* those Avalon fans could package up one or more Avalon containers as 
MBeans then any Avalon components could be easily deployed inside an 
actual Avalon container inside Geronimo. Ditto for PicoContainer too. 
i.e. this strategy allows for a diversity of containers to be deployed.

* once all the required deployment options are available (EAR, WAR, 
SAR) and the ClassLoader stuff is working along with the interceptor 
stack; folks can then refactor the container using some real J2EE 
services to improve the manageability & codebase - based on real 
refactoring of working code rather than too much up front design. 
Indeed we can take a TDD approach to refactoring the container. So 
rather than guessing what a J2EE container should look now, we can 
refactor as we get there to improve it.

* we should make great progress, getting J2EE coverage fairly soon - 
yet we won't really be tied to JMX at all - the MBeans could be used in 
any container implementation.

* if in the future we come up with some other component model to be 
supported, it should be trivially easy to plugin MBeans anyway, or a 
simple refactor to support them

Thoughts?

James
-------
http://radio.weblogs.com/0112098/


RE: [services] getting service developers started - the initial component model

Posted by James deGraft-Johnson <jd...@digaman.com>.
I agree in principle, though I don't see how if the kernel framework is
based on MBeans, it will be easier to support MBeans created by J2EE
application developers.

Anyway, an approach to the kernel framework loosely based on MBeans has been
outlined in another thread, so I think we can worry about supporting JSR077
during design of the appropriate service.

James deGraft-Johnson
Software Engineer - IT
Verizon Information Services
Tel:         (240) 456-7018
Fax:        (240) 456-7072
Mobile:   (240) 475-1444 <jd...@verizon-uc.com>

-----Original Message-----
From: Jan Bartel [mailto:janb@mortbay.com]
Sent: Tuesday, August 12, 2003 8:33 AM
To: geronimo-dev@incubator.apache.org
Subject: Re: [services] getting service developers started - the initial
component model

I would have thought that we'd want to support JSR077 management for
J2EE from the outset. JSR077 describes lifecycles, events and
performance statistics for all J2EE components (everthing from ejbs,
datasources, jca through to web containers and servlets) that can be
modelled by mbeans.

It would be by far the simplest if geronimo's services were directly
based JSR077 mbeans, because:

1. we need to support JSR077 anyway
2. the simplest way to support it is directly, without extra layers of
    adaption code
3. there's nothing in the service lifecycle that cannot be encompassed
    by JSR077 mbeans

Jan

Alex Blewitt wrote:
>> My understanding of the JMX/MBeans idea from SUN is so that it is
>> possible
>> to create MBeans (Management Beans) as part of a J2EE application to
>> support
>> administration, management and monitoring of the J2EE application.
>> This is a
>> very powerful idea, which ideally will be supported by Geronimo.
>
>
> Absolutely. I have always been for there being a JMX /interface/ to
> Geronimo, but not as an /implementation/ of the kernel.
>
>> The use of a JMX/MBeans model for Kernel framework shouldn't
>> jeopardize the
>> above. In fact I assumed that the discussion of the MBeans as a service
>> component model was actually MBeans-like, i.e. basing the component
>> model on
>> the MBeans design. (We can structure the Geronimo kernel like JMX without
>> actually making the kernel a JMX implementation, so as to incorporate
>> into
>> the kernel the ability for J2EE application developers to create and
>> install
>> actual MBeans.) Because of the above, this is what makes sense for this
>> approach.
>
>
> I think there should be a distinction between the kernel and a JMX/MBean
> container -- they're not necessarily the same. Granted, that it may be
> desirable for MBeans to be incorporated in at a later stage, but by
> starting off with the doctrine 'everything is an MBean' then it's very
> difficult to be innovative and come up with ideas outside of the JMX spec.
>
> For example:
>
> public abstract Service {
>   public abstract String getName();
>   public abstract void start();
>   public abstract void stop();
>   public MBean getMBeanInterface() {
>     return new ServiceMBeanInterfaceAdapter(this);
>   }
> }
>
> public ServiceMBean implements GenericMBean {
>   private Service instance;
>   public ServiceMBean(Service instance) {
>     this.instance = instance;
>   }
>   public void start() { instance.start(); }
>   public void stop() { instance.stop(); }
> }
>
> That way, you can create subcomponents of Service that are entirely
> independent of JMX, whilst still providing a JMX interface to the same.
> Indeed, subclasses can provide their own specific JMXBean
> implementations if the default is not desirable.
>
> Additionally, if there is a move from using MBeans to another component
> architecture, then this will allow the same representation to be used.
>
> Alex.


Re: [services] getting service developers started - the initial component model

Posted by Jan Bartel <ja...@mortbay.com>.
I would have thought that we'd want to support JSR077 management for 
J2EE from the outset. JSR077 describes lifecycles, events and 
performance statistics for all J2EE components (everthing from ejbs, 
datasources, jca through to web containers and servlets) that can be 
modelled by mbeans.

It would be by far the simplest if geronimo's services were directly 
based JSR077 mbeans, because:

1. we need to support JSR077 anyway
2. the simplest way to support it is directly, without extra layers of
    adaption code
3. there's nothing in the service lifecycle that cannot be encompassed
    by JSR077 mbeans

Jan

Alex Blewitt wrote:
>> My understanding of the JMX/MBeans idea from SUN is so that it is 
>> possible
>> to create MBeans (Management Beans) as part of a J2EE application to 
>> support
>> administration, management and monitoring of the J2EE application. 
>> This is a
>> very powerful idea, which ideally will be supported by Geronimo.
> 
> 
> Absolutely. I have always been for there being a JMX /interface/ to 
> Geronimo, but not as an /implementation/ of the kernel.
> 
>> The use of a JMX/MBeans model for Kernel framework shouldn't 
>> jeopardize the
>> above. In fact I assumed that the discussion of the MBeans as a service
>> component model was actually MBeans-like, i.e. basing the component 
>> model on
>> the MBeans design. (We can structure the Geronimo kernel like JMX without
>> actually making the kernel a JMX implementation, so as to incorporate 
>> into
>> the kernel the ability for J2EE application developers to create and 
>> install
>> actual MBeans.) Because of the above, this is what makes sense for this
>> approach.
> 
> 
> I think there should be a distinction between the kernel and a JMX/MBean 
> container -- they're not necessarily the same. Granted, that it may be 
> desirable for MBeans to be incorporated in at a later stage, but by 
> starting off with the doctrine 'everything is an MBean' then it's very 
> difficult to be innovative and come up with ideas outside of the JMX spec.
> 
> For example:
> 
> public abstract Service {
>   public abstract String getName();
>   public abstract void start();
>   public abstract void stop();
>   public MBean getMBeanInterface() {
>     return new ServiceMBeanInterfaceAdapter(this);
>   }
> }
> 
> public ServiceMBean implements GenericMBean {
>   private Service instance;
>   public ServiceMBean(Service instance) {
>     this.instance = instance;
>   }
>   public void start() { instance.start(); }
>   public void stop() { instance.stop(); }
> }
> 
> That way, you can create subcomponents of Service that are entirely 
> independent of JMX, whilst still providing a JMX interface to the same. 
> Indeed, subclasses can provide their own specific JMXBean 
> implementations if the default is not desirable.
> 
> Additionally, if there is a move from using MBeans to another component 
> architecture, then this will allow the same representation to be used.
> 
> Alex.



Re: [services] getting service developers started - the initial component model

Posted by James Strachan <ja...@yahoo.co.uk>.
On Tuesday, August 12, 2003, at 12:51  pm, James deGraft-Johnson wrote:

> I agree with this.
>
> By structuring the kernel architecture like JMX/MBeans we will 
> simplify the
> design task, have less changes (refactoring) to make to existing 
> kernel,
> which is based on JMX/MBeans. However it is important not to tie the 
> design
> tightly to JMX/MBeans, (or implement the kernel strictly as 
> JMX/MBeans) as
> pointed out). Note that JMX/MBeans is meant to be a feature (management
> extension) of the J2EE container not an architecture for design of the 
> J2EE
> kernel. By not tightly coupling kernel architecture to JMX/MBeans we 
> can
> incorporate design ideas from outside JMX/MBeans and also allow the
> component to be changed later.

Agreed.

we have

	components <-> container <-> JMX

The container in the middle could be based on JMX or could be based on 
some other model and just adapt to JMX. But thats the containers job to 
figure that out.

For all the services & component developers we should adopt the 
standard MBean programming model as the first convention for 
developers. In the future we may have other options for component 
authors to follow (e.g. Pico components or Avalon components etc). 
However for now following the MBean convention is a no brainer since 
its already being used & supported.

If developers of a service wish to use some new wizzy abstraction API 
or to write Pico components or to use some Avalon container or whatever 
- then we can just deploy the container inside Geronimo via MBeans. So 
we could have..

	avalon component -> avalon container -> avalon MBean -> geronimo -> JMX

James
-------
http://radio.weblogs.com/0112098/


RE: [services] getting service developers started - the initial component model

Posted by James deGraft-Johnson <jd...@digaman.com>.
I agree with this.

By structuring the kernel architecture like JMX/MBeans we will simplify the
design task, have less changes (refactoring) to make to existing kernel,
which is based on JMX/MBeans. However it is important not to tie the design
tightly to JMX/MBeans, (or implement the kernel strictly as JMX/MBeans) as
pointed out). Note that JMX/MBeans is meant to be a feature (management
extension) of the J2EE container not an architecture for design of the J2EE
kernel. By not tightly coupling kernel architecture to JMX/MBeans we can
incorporate design ideas from outside JMX/MBeans and also allow the
component to be changed later.

James deGraft-Johnson
Software Engineer - IT
Verizon Information Services
Tel:         (240) 456-7018
Fax:        (240) 456-7072
Mobile:   (240) 475-1444 <jd...@verizon-uc.com>

-----Original Message-----
From: Alex Blewitt [mailto:Alex.Blewitt@ioshq.com]
Sent: Tuesday, August 12, 2003 7:35 AM
To: geronimo-dev@incubator.apache.org
Subject: Re: [services] getting service developers started - the initial
component model

> My understanding of the JMX/MBeans idea from SUN is so that it is
> possible
> to create MBeans (Management Beans) as part of a J2EE application to
> support
> administration, management and monitoring of the J2EE application.
> This is a
> very powerful idea, which ideally will be supported by Geronimo.

Absolutely. I have always been for there being a JMX /interface/ to
Geronimo, but not as an /implementation/ of the kernel.

> The use of a JMX/MBeans model for Kernel framework shouldn't
> jeopardize the
> above. In fact I assumed that the discussion of the MBeans as a service
> component model was actually MBeans-like, i.e. basing the component
> model on
> the MBeans design. (We can structure the Geronimo kernel like JMX
> without
> actually making the kernel a JMX implementation, so as to incorporate
> into
> the kernel the ability for J2EE application developers to create and
> install
> actual MBeans.) Because of the above, this is what makes sense for this
> approach.

I think there should be a distinction between the kernel and a
JMX/MBean container -- they're not necessarily the same. Granted, that
it may be desirable for MBeans to be incorporated in at a later stage,
but by starting off with the doctrine 'everything is an MBean' then
it's very difficult to be innovative and come up with ideas outside of
the JMX spec.

For example:

public abstract Service {
   public abstract String getName();
   public abstract void start();
   public abstract void stop();
   public MBean getMBeanInterface() {
     return new ServiceMBeanInterfaceAdapter(this);
   }
}

public ServiceMBean implements GenericMBean {
   private Service instance;
   public ServiceMBean(Service instance) {
     this.instance = instance;
   }
   public void start() { instance.start(); }
   public void stop() { instance.stop(); }
}

That way, you can create subcomponents of Service that are entirely
independent of JMX, whilst still providing a JMX interface to the same.
Indeed, subclasses can provide their own specific JMXBean
implementations if the default is not desirable.

Additionally, if there is a move from using MBeans to another component
architecture, then this will allow the same representation to be used.

Alex.


Re: [services] getting service developers started - the initial component model

Posted by Alex Blewitt <Al...@ioshq.com>.
> My understanding of the JMX/MBeans idea from SUN is so that it is 
> possible
> to create MBeans (Management Beans) as part of a J2EE application to 
> support
> administration, management and monitoring of the J2EE application. 
> This is a
> very powerful idea, which ideally will be supported by Geronimo.

Absolutely. I have always been for there being a JMX /interface/ to 
Geronimo, but not as an /implementation/ of the kernel.

> The use of a JMX/MBeans model for Kernel framework shouldn't 
> jeopardize the
> above. In fact I assumed that the discussion of the MBeans as a service
> component model was actually MBeans-like, i.e. basing the component 
> model on
> the MBeans design. (We can structure the Geronimo kernel like JMX 
> without
> actually making the kernel a JMX implementation, so as to incorporate 
> into
> the kernel the ability for J2EE application developers to create and 
> install
> actual MBeans.) Because of the above, this is what makes sense for this
> approach.

I think there should be a distinction between the kernel and a 
JMX/MBean container -- they're not necessarily the same. Granted, that 
it may be desirable for MBeans to be incorporated in at a later stage, 
but by starting off with the doctrine 'everything is an MBean' then 
it's very difficult to be innovative and come up with ideas outside of 
the JMX spec.

For example:

public abstract Service {
   public abstract String getName();
   public abstract void start();
   public abstract void stop();
   public MBean getMBeanInterface() {
     return new ServiceMBeanInterfaceAdapter(this);
   }
}

public ServiceMBean implements GenericMBean {
   private Service instance;
   public ServiceMBean(Service instance) {
     this.instance = instance;
   }
   public void start() { instance.start(); }
   public void stop() { instance.stop(); }
}

That way, you can create subcomponents of Service that are entirely 
independent of JMX, whilst still providing a JMX interface to the same. 
Indeed, subclasses can provide their own specific JMXBean 
implementations if the default is not desirable.

Additionally, if there is a move from using MBeans to another component 
architecture, then this will allow the same representation to be used.

Alex.


RE: [services] getting service developers started - the initial component model

Posted by James deGraft-Johnson <jd...@digaman.com>.
My understanding of the JMX/MBeans idea from SUN is so that it is possible
to create MBeans (Management Beans) as part of a J2EE application to support
administration, management and monitoring of the J2EE application. This is a
very powerful idea, which ideally will be supported by Geronimo.

The use of a JMX/MBeans model for Kernel framework shouldn't jeopardize the
above. In fact I assumed that the discussion of the MBeans as a service
component model was actually MBeans-like, i.e. basing the component model on
the MBeans design. (We can structure the Geronimo kernel like JMX without
actually making the kernel a JMX implementation, so as to incorporate into
the kernel the ability for J2EE application developers to create and install
actual MBeans.) Because of the above, this is what makes sense for this
approach.

James deGraft-Johnson
Software Engineer - IT
Verizon Information Services
Tel:         (240) 456-7018
Fax:        (240) 456-7072
Mobile:   (240) 475-1444 <jd...@verizon-uc.com>

-----Original Message-----
From: Alex Blewitt [mailto:Alex.Blewitt@ioshq.com]
Sent: Tuesday, August 12, 2003 6:57 AM
To: geronimo-dev@incubator.apache.org
Subject: Re: [services] getting service developers started - the initial
component model

> All that sounds reasonable and I fully agree with you. However, as the
> project is still in early stages I'd like to emphasize the fact that
> J2EE
> developers may want to deploy their own MBeans (doing things like
> flushing
> a cache) also at runtime. This possibility is without doubt been
> forgetten
> while WebLogic Server was coded. Even BEA WLS developers cannot supply
> one
> with any reasonable ways to deploy your own standard MBeans which do
> not
> have anything to do with WLS itself.

AFAIK the J2EE spec doesn't say anything about being able to put your
own MBean into a server. However, an MBean container for just this
purpose sounds like an excellent idea.

Note that I don't believe the server itself needs to be an MBean
container (in much the same way that the whole isn't a web container or
ejb container) but it seems reasonable to assume that at some future
point the J2EE spec may create the concept of an MBean container.

> Alex.


Re: [services] getting service developers started - the initial component model

Posted by Pasi Salminen <pa...@profitsoftware.com>.
We have a framework built on top of J2EE services where we are coding application
level services like this:

public interface PropertyService
{
    public String getProperty( String propertyName,String defaultValue );
}

public class PropertyServiceImpl
    extends AbstractService
    implements PropertyService
{
    public String getProperty( ... ) { }
}

and the lookup is then like this:

PropertyService ps = ( PropertyService ) Services.getService(
PropertyService.class.getName( ) );

which means that the interface is used to lookup the implementation. Here's the XML
configuration (which is used to configure Services class)

 <services>
  <service id="com.profitsoftware.appfw.propertyservice.PropertyService">

<class-name>com.profitsoftware.appfw.propertyservice.PropertyServiceImpl</class-name>

  </service>
    ...
 </services>

So, if somebody wants to replace service implementation (which is used through the
framework by other components), they just change the implementation class in the
XML configuration file. Works nicely. Here nobody is managing other components but
they are using each other by looking up the service and using it through a well
defined interface.

Regards,

Paci

Berin Loritsch wrote:

> Jeremy Boynes wrote:
>
> >>The danger with using too much JMX is that when components start
> >>talking to each other using JMX, then it's very difficult to undo at a
> >>later stage.
> >>
> >
> >
> > Difference between components managing each other (for which JMX may be
> > good), and invoking each other (for which an alternative may be better).
> >
> > We need to keep this difference in mind.
> >
> > We also need to be careful about coupling of implementations and making sure
> > we keep invocations detached (to allow for redeployment). JMX enforces this,
> > any other framework needs to support it as well.
>
> Coding to interfaces does a good job of managing these things.  As long as
> your code *never* does a cast to the interface like this:
>
> ((MyImpl)service).doSomethingNotInInterface();
>
> That is REALLY BAD.  You will never be able to have loose coupling, or insert
> interceptors properly with that approach.  When the interface covers the entire
> contract, components can use each other and even be completely replaced with
> something new and still function.
>
> The MAJOR RED FLAG I saw is the notion of components _managing_ each other.
> It is the Container's job to manage components.  Period.  No component should
> manage another component unless it in turn is a container for the managed
> component.  For example:
>
> BAD
> ---
>
>       +--------------+
>     ..|  Container   |..
>     . +------+-------+ .
>     .        |         .
>     v +------+-------+ v
> +----+---+      +--------+
> | Comp 1 |.....>| Comp 2 |
> +--------+      +--------+
>
> (the dotted line is management)
>
> GOOD/ACCEPTIBLE
> ---------------
>
>       +--------------+
>       |  Container   |
>       +------+-------+
>       .      |
>       . +----+---+
>       .>| Comp 1 |..
>         +----+---+ .
>              |     .
>         +----+---+ .
>         | Comp 2 |<.
>         +--------+
>
> In other words, a heirarchy of components is much easier to work with, develop,
> and debug than any component usurping the container's job and cause
> unpredictable results.  Not to mention it complicates the security mechanisms
> much more than necessary.
>
> --
>
> "They that give up essential liberty to obtain a little temporary safety
>   deserve neither liberty nor safety."
>                  - Benjamin Franklin

__________________________________________________________________________

This message and its attachments have been found clean from known viruses 
with three different antivirus programs.
__________________________________________________________________________

Re: [services] getting service developers started - the initial component model

Posted by Berin Loritsch <bl...@apache.org>.
Jeremy Boynes wrote:

>>The danger with using too much JMX is that when components start
>>talking to each other using JMX, then it's very difficult to undo at a
>>later stage.
>>
> 
> 
> Difference between components managing each other (for which JMX may be
> good), and invoking each other (for which an alternative may be better).
> 
> We need to keep this difference in mind.
> 
> We also need to be careful about coupling of implementations and making sure
> we keep invocations detached (to allow for redeployment). JMX enforces this,
> any other framework needs to support it as well.

Coding to interfaces does a good job of managing these things.  As long as
your code *never* does a cast to the interface like this:

((MyImpl)service).doSomethingNotInInterface();

That is REALLY BAD.  You will never be able to have loose coupling, or insert
interceptors properly with that approach.  When the interface covers the entire
contract, components can use each other and even be completely replaced with
something new and still function.

The MAJOR RED FLAG I saw is the notion of components _managing_ each other.
It is the Container's job to manage components.  Period.  No component should
manage another component unless it in turn is a container for the managed
component.  For example:

BAD
---

      +--------------+
    ..|  Container   |..
    . +------+-------+ .
    .        |         .
    v +------+-------+ v
+----+---+      +--------+
| Comp 1 |.....>| Comp 2 |
+--------+      +--------+

(the dotted line is management)

GOOD/ACCEPTIBLE
---------------

      +--------------+
      |  Container   |
      +------+-------+
      .      |
      . +----+---+
      .>| Comp 1 |..
        +----+---+ .
             |     .
        +----+---+ .
        | Comp 2 |<.
        +--------+

In other words, a heirarchy of components is much easier to work with, develop,
and debug than any component usurping the container's job and cause
unpredictable results.  Not to mention it complicates the security mechanisms
much more than necessary.

-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


RE: [services] getting service developers started - the initial component model

Posted by Jeremy Boynes <je...@coredevelopers.net>.
> The danger with using too much JMX is that when components start
> talking to each other using JMX, then it's very difficult to undo at a
> later stage.
>

Difference between components managing each other (for which JMX may be
good), and invoking each other (for which an alternative may be better).

We need to keep this difference in mind.

We also need to be careful about coupling of implementations and making sure
we keep invocations detached (to allow for redeployment). JMX enforces this,
any other framework needs to support it as well.

--
Jeremy


Re: [services] getting service developers started - the initial component model

Posted by Alex Blewitt <Al...@ioshq.com>.
>> AFAIK the J2EE spec doesn't say anything about being able to put your 
>> own MBean into a server. However, an MBean container for just this 
>> purpose sounds like an excellent idea.
>
> There are rumors of a user loadable JMX services JSR forming.

Cunning. However, I think that the ApacheJ2EE server should eventually 
use a micro-kernel, of which one of the containers is a MBean 
container, rather than necessarily the ApacheJ2EE server being an MBean 
container.

>> Note that I don't believe the server itself needs to be an MBean 
>> container (in much the same way that the whole isn't a web container 
>> or ejb container) but it seems reasonable to assume that at some 
>> future point the J2EE spec may create the concept of an MBean 
>> container.
>
> I agree that the standard component model (the component model is not 
> the server) does not have to be JMX, but it seems like an extreme 
> waste of effort to create a shadow JMX object for every component in 
> the server, when we can just have them be JMX components.

There's no reason they can't be both, but generate the JMX interfaces 
automatically and/or dynamically rather than having to have the user 
code them.

The danger with using too much JMX is that when components start 
talking to each other using JMX, then it's very difficult to undo at a 
later stage.

Alex.


Re: [services] getting service developers started - the initial component model

Posted by Dain Sundstrom <da...@coredevelopers.net>.
On Tuesday, August 12, 2003, at 05:57 AM, Alex Blewitt wrote:

>> All that sounds reasonable and I fully agree with you. However, as the
>> project is still in early stages I'd like to emphasize the fact that 
>> J2EE
>> developers may want to deploy their own MBeans (doing things like 
>> flushing
>> a cache) also at runtime. This possibility is without doubt been 
>> forgetten
>> while WebLogic Server was coded. Even BEA WLS developers cannot 
>> supply one
>> with any reasonable ways to deploy your own standard MBeans which do 
>> not
>> have anything to do with WLS itself.
>
> AFAIK the J2EE spec doesn't say anything about being able to put your 
> own MBean into a server. However, an MBean container for just this 
> purpose sounds like an excellent idea.

There are rumors of a user loadable JMX services JSR forming.

> Note that I don't believe the server itself needs to be an MBean 
> container (in much the same way that the whole isn't a web container 
> or ejb container) but it seems reasonable to assume that at some 
> future point the J2EE spec may create the concept of an MBean 
> container.

I agree that the standard component model (the component model is not 
the server) does not have to be JMX, but it seems like an extreme waste 
of effort to create a shadow JMX object for every component in the 
server, when we can just have them be JMX components.

-dain

/*************************
  * Dain Sundstrom
  * Partner
  * Core Developers Network
  *************************/


Re: [services] getting service developers started - the initial component model

Posted by Alex Blewitt <Al...@ioshq.com>.
> All that sounds reasonable and I fully agree with you. However, as the
> project is still in early stages I'd like to emphasize the fact that 
> J2EE
> developers may want to deploy their own MBeans (doing things like 
> flushing
> a cache) also at runtime. This possibility is without doubt been 
> forgetten
> while WebLogic Server was coded. Even BEA WLS developers cannot supply 
> one
> with any reasonable ways to deploy your own standard MBeans which do 
> not
> have anything to do with WLS itself.

AFAIK the J2EE spec doesn't say anything about being able to put your 
own MBean into a server. However, an MBean container for just this 
purpose sounds like an excellent idea.

Note that I don't believe the server itself needs to be an MBean 
container (in much the same way that the whole isn't a web container or 
ejb container) but it seems reasonable to assume that at some future 
point the J2EE spec may create the concept of an MBean container.

> Alex.


Re: [services] getting service developers started - the initial component model

Posted by Pasi Salminen <pa...@profitsoftware.com>.
Hi,

All that sounds reasonable and I fully agree with you. However, as the
project is still in early stages I'd like to emphasize the fact that J2EE
developers may want to deploy their own MBeans (doing things like flushing
a cache) also at runtime. This possibility is without doubt been forgetten
while WebLogic Server was coded. Even BEA WLS developers cannot supply one
with any reasonable ways to deploy your own standard MBeans which do not
have anything to do with WLS itself. And even if you can do it registering
those beans is next to impossible. You have to supply administrative user
and its password to WLS before you can register your own beans (due to
security issues). WebSphere handles this in much nicer way. One can embed
was.policy file into your application and the policy file contains grants
to do things. I know this is kind of future (and partly even security)
issue but I feel it's so important that I wanted speak it out now. It's
been a major show-stopper for deploying our own MBeans with application
servers and I've been doing tons of work due to this in order to make it
reasonable to deploy the same MBeans (part of our framework) to WLS and
WebSphere.

Another thing which is really annoying in app servers is the fact that you
can't ask the name of the current J2EE application. That would help a lot
while creating a unique ObjectName for MBean which is instantiated and
registered at runtime (for example when the cache instance is registered by
the CacheManager or the bean itself). I just wonder why there's no API to
ask the name of the application in J2EE.?!?! I know that it's not J2EE
specified thing but it would be nice to be able to ask it without tons of
code (as I had to do in WebSphere).

Regards,

Paci


jastrachan@mac.com wrote:

> I'm sure we could all debate the perfect container framework and
> compare and contrast the intricacies of the various flavours of Avalon
> containers, PicoContainer, JMX & Java Beans until the cows come home.
> However what is really important right now is we start writing
> lightweight, pluggable services ASAP to start filling in the J2EE stack
> for Geronimo.
>
> Up to now the Geronimo codebase has assumed a JMX micro kernel,
> following in the footsteps of JBoss, Tomcat 5 and Jetty. I'm sure this
> can be improved with time though this strategy has been proved to work.
> Before we get bogged down in months of upfront design for what the
> perfect container should be - I'd like us to be able to make good
> progress integrating the various services - of which there are many.
> Then we have some real use cases that can help us as we refactor the
> Geronimo container.
>
> What I'd like to do as an initial step is choose a default component
> model for service developers to follow as they write Geronimo services.
> For some time most of the main services in Geronimo are going to be
> fairly course grained (web container, Axis, JMS provider, JTA etc). In
> addition at the time of writing Geronimo can deploy MBeans.
>
> So initially I think the component model should be JMX MBeans. These
> are simple, lightweight components that have no compile time
> dependencies on anything. The MBeans themselves should follow the
> Inversion of Control pattern - i.e. the container instantiates &
> configures the MBean. In addition we should try follow the MBean
> interface pattern such that we can do efficient interception easily
> with dynamic proxies - also note that MBeans do not need to use JMX at
> all - any container mechanism can be used to configure & wire together
> the components.
>
> Already today Geronimo can handle MBeans. It must always be able to
> handle MBeans. Indeed whatever Geronimo's container framework becomes
> it should be easily cable of working with the plethora of J2EE MBeans
> that are out there. (MBeans are essential to J2EE).
>
> So in summary
>
> * lets start writing J2EE services as MBeans that we can plug into
> Geronimo today.
>
> * in parallel to this activity folks can help improve & innovate inside
> the Geronimo kernel - without adversely affecting the progress of the
> component authors - we can all work in parallel
>
> * those Avalon fans could package up one or more Avalon containers as
> MBeans then any Avalon components could be easily deployed inside an
> actual Avalon container inside Geronimo. Ditto for PicoContainer too.
> i.e. this strategy allows for a diversity of containers to be deployed.
>
> * once all the required deployment options are available (EAR, WAR,
> SAR) and the ClassLoader stuff is working along with the interceptor
> stack; folks can then refactor the container using some real J2EE
> services to improve the manageability & codebase - based on real
> refactoring of working code rather than too much up front design.
> Indeed we can take a TDD approach to refactoring the container. So
> rather than guessing what a J2EE container should look now, we can
> refactor as we get there to improve it.
>
> * we should make great progress, getting J2EE coverage fairly soon -
> yet we won't really be tied to JMX at all - the MBeans could be used in
> any container implementation.
>
> * if in the future we come up with some other component model to be
> supported, it should be trivially easy to plugin MBeans anyway, or a
> simple refactor to support them
>
> Thoughts?
>
> James
> -------
> http://radio.weblogs.com/0112098/

__________________________________________________________________________

This message and its attachments have been found clean from known viruses 
with three different antivirus programs.
__________________________________________________________________________

Re: [services] getting service developers started - the initial component model

Posted by James Strachan <ja...@yahoo.co.uk>.
On Tuesday, August 12, 2003, at 10:05  am, Pratik Patel wrote:

> I've been following this list for a few days and was worried that 
> everything would get bogged down in a religious debate over the 
> container framework to use. I've looked in great detail at all three 
> of the ones James mentioned (Avalon, Picocontainer, and Jetty-like JMX 
> kernel). The simple JMX container wins in this situation because it's 
> simple and allows the most flexibility for both Geronimo kernel 
> developers and service/module developers.

Agreed. This is my point entirely.

> This point summarizes everything nicely:
>
>> * once all the required deployment options are available (EAR, WAR, 
>> SAR) and the ClassLoader stuff is working along with the interceptor 
>> stack; folks can then refactor the container using some real J2EE 
>> services to improve the manageability & codebase - based on real 
>> refactoring of working code rather than too much up front design. 
>> Indeed we can take a TDD approach to refactoring the container. So 
>> rather than guessing what a J2EE container should look now, we can 
>> refactor as we get there to improve it.
>
>
> But I have to ask - why are there already plans for an interceptor 
> stack? I assume you mean AOP interceptors... Yes, it would be great to 
> apply some AOP, but aren't we putting the cart before the horse?

There's already an interceptor stack in CVS. It could be used in an AOP 
way but doesn't have to be.

James
-------
http://radio.weblogs.com/0112098/


Re: [services] getting service developers started - the initial component model

Posted by Pratik Patel <pr...@ibiblio.org>.
I've been following this list for a few days and was worried that 
everything would get bogged down in a religious debate over the 
container framework to use. I've looked in great detail at all three of 
the ones James mentioned (Avalon, Picocontainer, and Jetty-like JMX 
kernel). The simple JMX container wins in this situation because it's 
simple and allows the most flexibility for both Geronimo kernel 
developers and service/module developers. This point summarizes 
everything nicely:

> * once all the required deployment options are available (EAR, WAR, 
> SAR) and the ClassLoader stuff is working along with the interceptor 
> stack; folks can then refactor the container using some real J2EE 
> services to improve the manageability & codebase - based on real 
> refactoring of working code rather than too much up front design. 
> Indeed we can take a TDD approach to refactoring the container. So 
> rather than guessing what a J2EE container should look now, we can 
> refactor as we get there to improve it.


But I have to ask - why are there already plans for an interceptor 
stack? I assume you mean AOP interceptors... Yes, it would be great to 
apply some AOP, but aren't we putting the cart before the horse?


cheers
Pratik



Re: [Kernel] Kernel options

Posted by Alex Blewitt <Al...@ioshq.com>.
> I am interested in learning the advantages and drawbacks of the JMX 
> kernel.
> They might influence design in other areas.

I created a few pages earlier to bring out differences and similarities 
between them for others to add advantages/disadvantages in. They're a 
bit bare at the moment, so if people can put their thoughts in then 
that would be good.

http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/Kernel
http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/JMXAsKernel
http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/AvalonKernel

Alex.


RE: [services] getting service developers started - the initial component model

Posted by James deGraft-Johnson <jd...@digaman.com>.
I agree this strategy.

James deGraft-Johnson
Software Engineer - IT
Verizon Information Services
Tel:         (240) 456-7018
Fax:        (240) 456-7072
Mobile:   (240) 475-1444 <jd...@verizon-uc.com>

-----Original Message-----
From: Berin Loritsch [mailto:bloritsch@apache.org]
Sent: Tuesday, August 12, 2003 10:05 AM
To: geronimo-dev@incubator.apache.org
Subject: Re: [services] getting service developers started - the initial
component model

James Strachan wrote:


>
>
> I'd already put your previous points in the Wiki...
>
> http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/Components
>
> have just adapted them slightly to include the new list. :). By all
> means refine them some more.


Awesome!

Let's have fun then!

I am interested in learning the advantages and drawbacks of the JMX kernel.
They might influence design in other areas.

--

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


Re: [services] getting service developers started - the initial component model

Posted by Berin Loritsch <bl...@apache.org>.
James Strachan wrote:


> 
> 
> I'd already put your previous points in the Wiki...
> 
> http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/Components
> 
> have just adapted them slightly to include the new list. :). By all 
> means refine them some more.


Awesome!

Let's have fun then!

I am interested in learning the advantages and drawbacks of the JMX kernel.
They might influence design in other areas.

-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


Re: [services] getting service developers started - the initial component model

Posted by James Strachan <ja...@yahoo.co.uk>.
On Tuesday, August 12, 2003, at 02:45  pm, Berin Loritsch wrote:

> jastrachan@mac.com wrote:
>
> <snip type="work with what we have"/>
>
>> Thoughts?
>
> Yep.
>
> I don't want to argue till I'm blue in the face, nor do I want to 
> create
> negative energy.  However, Alex does have some good points.  JMX is a 
> good
> tool, and we don't want to loose its value.  I believe in doing the 
> easiest
> thing first.  So, should we start with what we have?  Yes, but....

Hooray :)


> I outlined some minimal component requirements that would allow us to 
> play
> with other container projects just as easily as the all JMX thing we 
> have
> in CVS now.  If we follow those minimal requirements, then we can 
> revisit
> the container question at a later time and not force one framework over
> another.
>
> Those requirements are:
>
> 1) Separation of interface and implementation.  We are talking a simple
>    Java interface.  All code that uses a service/component uses it 
> according
>    to that interface.
>
> 2) Inversion of Control.  This comes in many forms, but the bottom 
> line is
>    that we never rely on static accessors to gain information for a 
> service/
>    component.  Everything the component needs is passed in by the 
> server.
>    The actual implementation of this is really irrelevant as long as 
> we work
>    with this goal.  Most open source containers can be adapted to work 
> with
>    the way you do things.
>
> 3) Separation of Concerns.  Each service/component should do one 
> thing, and
>    do it well.  Even if a service represents another complete set of 
> components
>    to do its job, it is there for one purpose.  An EJB Container can be
>    considered a service, as well as the persistence manager used 
> inside of it.

I'd already put your previous points in the Wiki...

http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/Components

have just adapted them slightly to include the new list. :). By all 
means refine them some more.


> If we can follow these simple requirements, then we can swap 
> containers to our
> heart's content and still work with the same system.

Agreed.


> The JMX MBeans would take care of setting up and managing the 
> components (as
> it probably already does), but instead of the service directly being 
> an MBean,
> it should be managed by an MBean.  That would allow us to have a small 
> number
> of MBeans to provide a consistent interface for all components, and 
> have generic
> services that can be used in other systems.
>
> No commitment to Avalon, PicoContainer, JMX, etc.  Just some simple 
> services.
>
> Since we are talking about a J2EE server, all components would be 
> bound to
> JNDI, although we might have a J2EE server namespace to look them 
> up--that
> way they are not confused with EAR based components.
>
> Does that sound like a workable compromise?

Absolutely.

James
-------
http://radio.weblogs.com/0112098/


Re: [services] getting service developers started - the initial component model

Posted by James Strachan <ja...@yahoo.co.uk>.
On Tuesday, August 12, 2003, at 03:02  pm, Alex Blewitt wrote:

> Agree totally with these points. And now, I'll shut up :-)

Please don't shut up Alex :)

Much of what you've said previously in these threads could easily sit 
on top of a simple MBean layer or be used as an alternative way to 
adapt to the MBean layer; plus your ideas on alternative MBean creation 
mechanisms are good ideas.

I've just been trying to get some consensus on which we can all move 
forward & build the groovy J2EE container we all want. We should be 
able to innovate in various dimensions at the same time so long as we 
have some common consensus on the basics of the system today.

Now lets all plugin some J2EE services! :)

James
-------
http://radio.weblogs.com/0112098/


Re: [services] getting service developers started - the initial component model

Posted by Alex Blewitt <Al...@ioshq.com>.
Agree totally with these points. And now, I'll shut up :-)

Alex.

On Tuesday, Aug 12, 2003, at 14:45 Europe/London, Berin Loritsch wrote:

> jastrachan@mac.com wrote:
>
> <snip type="work with what we have"/>
>
>> Thoughts?
>
> Yep.
>
> I don't want to argue till I'm blue in the face, nor do I want to 
> create
> negative energy.  However, Alex does have some good points.  JMX is a 
> good
> tool, and we don't want to loose its value.  I believe in doing the 
> easiest
> thing first.  So, should we start with what we have?  Yes, but....
>
> I outlined some minimal component requirements that would allow us to 
> play
> with other container projects just as easily as the all JMX thing we 
> have
> in CVS now.  If we follow those minimal requirements, then we can 
> revisit
> the container question at a later time and not force one framework over
> another.
>
> Those requirements are:
>
> 1) Separation of interface and implementation.  We are talking a simple
>    Java interface.  All code that uses a service/component uses it 
> according
>    to that interface.
>
> 2) Inversion of Control.  This comes in many forms, but the bottom 
> line is
>    that we never rely on static accessors to gain information for a 
> service/
>    component.  Everything the component needs is passed in by the 
> server.
>    The actual implementation of this is really irrelevant as long as 
> we work
>    with this goal.  Most open source containers can be adapted to work 
> with
>    the way you do things.
>
> 3) Separation of Concerns.  Each service/component should do one 
> thing, and
>    do it well.  Even if a service represents another complete set of 
> components
>    to do its job, it is there for one purpose.  An EJB Container can be
>    considered a service, as well as the persistence manager used 
> inside of it.
>
> If we can follow these simple requirements, then we can swap 
> containers to our
> heart's content and still work with the same system.
>
> The JMX MBeans would take care of setting up and managing the 
> components (as
> it probably already does), but instead of the service directly being 
> an MBean,
> it should be managed by an MBean.  That would allow us to have a small 
> number
> of MBeans to provide a consistent interface for all components, and 
> have generic
> services that can be used in other systems.
>
> No commitment to Avalon, PicoContainer, JMX, etc.  Just some simple 
> services.

I agree. I've never been directly pushing Avalon over JMX, but rather a 
more micro-kernel based architecture than JMX allows. There may be a 
new container framework just around the corner ...

> Since we are talking about a J2EE server, all components would be 
> bound to
> JNDI, although we might have a J2EE server namespace to look them 
> up--that
> way they are not confused with EAR based components.

In order for this to work, naming conventions (the JNDI contexts, 
subcontexts etc. -- not Java coding ones) needs to be ironed out in 
more detail. Sounds like a Wiki page in the making ...

> Does that sound like a workable compromise?

Absolutely.


Re: [services] getting service developers started - the initial component model

Posted by Berin Loritsch <bl...@apache.org>.
jastrachan@mac.com wrote:

<snip type="work with what we have"/>

> 
> Thoughts?
> 

Yep.

I don't want to argue till I'm blue in the face, nor do I want to create
negative energy.  However, Alex does have some good points.  JMX is a good
tool, and we don't want to loose its value.  I believe in doing the easiest
thing first.  So, should we start with what we have?  Yes, but....

I outlined some minimal component requirements that would allow us to play
with other container projects just as easily as the all JMX thing we have
in CVS now.  If we follow those minimal requirements, then we can revisit
the container question at a later time and not force one framework over
another.

Those requirements are:

1) Separation of interface and implementation.  We are talking a simple
    Java interface.  All code that uses a service/component uses it according
    to that interface.

2) Inversion of Control.  This comes in many forms, but the bottom line is
    that we never rely on static accessors to gain information for a service/
    component.  Everything the component needs is passed in by the server.
    The actual implementation of this is really irrelevant as long as we work
    with this goal.  Most open source containers can be adapted to work with
    the way you do things.

3) Separation of Concerns.  Each service/component should do one thing, and
    do it well.  Even if a service represents another complete set of components
    to do its job, it is there for one purpose.  An EJB Container can be
    considered a service, as well as the persistence manager used inside of it.

If we can follow these simple requirements, then we can swap containers to our
heart's content and still work with the same system.

The JMX MBeans would take care of setting up and managing the components (as
it probably already does), but instead of the service directly being an MBean,
it should be managed by an MBean.  That would allow us to have a small number
of MBeans to provide a consistent interface for all components, and have generic
services that can be used in other systems.

No commitment to Avalon, PicoContainer, JMX, etc.  Just some simple services.

Since we are talking about a J2EE server, all components would be bound to
JNDI, although we might have a J2EE server namespace to look them up--that
way they are not confused with EAR based components.

Does that sound like a workable compromise?

-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


Re: [services] getting service developers started - the initial component model

Posted by James Strachan <ja...@yahoo.co.uk>.
On Tuesday, August 12, 2003, at 10:00  am, Alex Blewitt wrote:

>
> On Tuesday, Aug 12, 2003, at 07:07 Europe/London, jastrachan@mac.com 
> wrote:
>
>> I'm sure we could all debate the perfect container framework and 
>> compare and contrast the intricacies of the various flavours of 
>> Avalon containers, PicoContainer, JMX & Java Beans until the cows 
>> come home. However what is really important right now is we start 
>> writing lightweight, pluggable services ASAP to start filling in the 
>> J2EE stack for Geronimo.
>
> Definitely concur with this one.
>
>> So initially I think the component model should be JMX MBeans. These 
>> are simple, lightweight components that have no compile time 
>> dependencies on anything. The MBeans themselves should follow the 
>> Inversion of Control pattern - i.e. the container instantiates & 
>> configures the MBean. In addition we should try follow the MBean 
>> interface pattern such that we can do efficient interception easily 
>> with dynamic proxies - also note that MBeans do not need to use JMX 
>> at all - any container mechanism can be used to configure & wire 
>> together the components.
>
> The only problem with this approach is that there isn't a suitable 
> abstraction layer in the Geronimo kernel to allow for easy refactoring 
> at a later stage.

I think you're missing the point I'm making - more below...

> It would be much better, for example, to create an interface called 
> 'Service' (for example) that implements MBean initially, but ensure 
> that any code written for Geronimo doesn't depend on MBean. That way, 
> refactoring at a later stage will be much easier.

Having the Geronimo container depend on JMX is not the issue. Its what 
should component developers depend on. I'm saying - have no 
dependencies (not even JMX) just write interface based MBeans which are 
not dependent on *anything*...


>
>> Already today Geronimo can handle MBeans. It must always be able to 
>> handle MBeans. Indeed whatever Geronimo's container framework becomes 
>> it should be easily cable of working with the plethora of J2EE MBeans 
>> that are out there. (MBeans are essential to J2EE).
>
> I've not found the section in the spec that says this.

Have you read JSR 77 and JSR 88?

>
>> So in summary
>>
>> * lets start writing J2EE services as MBeans that we can plug into 
>> Geronimo today.
>
> I think the more services that are created sooner, the better. 
> However, I would strongly suggest that we create an abstraction API 
> that we can use in Geronimo to make the services available, that 
> decouples the implementation of the services from JMX sooner rather 
> than later.

Like I said - we don't need an abstraction API. An MBean interface has 
no dependencies on JMX.


>  Otherwise, if we write and build heavily on the assumption that 
> everything-is-an-MBean then it will be a lot more difficult to 
> change/remove that assumption later on. A few abstract APIs would 
> solve this problem immediately.

Why - an MBean (interface) is just a POJO with an interface. Why should 
we make component authors dependent on yet-another-abstraction-API when 
we don't need to?



>
>> * in parallel to this activity folks can help improve & innovate 
>> inside the Geronimo kernel - without adversely affecting the progress 
>> of the component authors - we can all work in parallel
>
> Absolutely. In fact, it would be great if there was an 'experimental' 
> spike doing this now, either by having a set of packages in the 
> Geronimo core, or a different module, or a different CVS tag to allow 
> this to occur in parallel now. However, since most of us don't have 
> commit privileges, (and thus can't control the experimental/head 
> checkins) it might be more advisable to have an experimental 
> package/module, which would then fit in with head

There are already many MBeans in the CVS repository. Go take a look. 
Search for files matching *MBean.java.


>
>> * those Avalon fans could package up one or more Avalon containers as 
>> MBeans then any Avalon components could be easily deployed inside an 
>> actual Avalon container inside Geronimo. Ditto for PicoContainer too. 
>> i.e. this strategy allows for a diversity of containers to be > 
>> deployed.
>
> This still doesn't address the heavy coupling of the entire framework 
> to MBeans/JMX,

There is no heavy coupling. How the MBeans get used and whether or not 
JMX is used is purely internal to the container.


> which is essentially the point I'm making. It would be more sensible, 
> for example, to build an Avalon framework kernel that could allow 
> legacy MBeans to be instantiated.

I disagree that this is more sensible. I'm not ruling it out in the 
future - but what is sensible is today using the JMX kernel we have 
today and creating the necessary J2EE services in accordance with the 
full J2EE 1.4 spec (which includes JSR 77 & 88).

When we have a plethora of services all following all of the J2EE 
specifications for management, deployment, classloading and so forth 
then Avalon folks will have a chance to demonstrate how Avalon could 
implement the core container better than the one we've got. Until then 
- lets focus on getting the services integrated in the simplest, 
loosest coupling way forward.


>> * once all the required deployment options are available (EAR, WAR, 
>> SAR) and the ClassLoader stuff is working along with the interceptor 
>> stack; folks can then refactor the container using some real J2EE 
>> services to improve the manageability & codebase - based on real 
>> refactoring of working code rather than too much up front design. 
>> Indeed we can take a TDD approach to refactoring the container. So 
>> rather than guessing what a J2EE container should look now, we can 
>> refactor as we get there to improve it.
>
> And one of the goals about refactoring is to set up easier migration 
> paths. Importantly, refactoring can be done at any time, and 
> abstracting/decoupling the implementation from JMX (wherever possible, 
> not necessarily as a major rewrite) will aid in that.

JMX is only used inside the container right now. Its hidden inside the 
container - so can easily be refactored later. There is no JMX in the 
components.


> So I'd suggest creating abstract interfaces (Service, Container etc.) 
> that developers can write to, and not MBeans. (However, the Service 
> can initially implement an MBean to facilitate migration.)

We've already got that in CVS though its use is totally optional to 
component / service authors. Also following JSR 77 for lifecycle APIs 
is probably a good idea going forward too.


>
>> * we should make great progress, getting J2EE coverage fairly soon - 
>> yet we won't really be tied to JMX at all - the MBeans could be used 
>> in any container implementation.
>
> Again, the J2EE spec in no way requires MBeans to be used as the 
> container implementation.

Please double check you table of contents of the J2EE specification.


> Indeed, the spec is specifically implementation agnostic on this and 
> almost all other points regarding implementation of containers. I'd 
> find it quite unlikely that an implementation of something built for 
> one server (e.g. WebLogic/WebSphere) would stand a chance of running 
> in another (e.g. JBoss, Geronimo).
>
> Building everything now implementing MBean is a sure way to be tied to 
> JMX. Building an abstract API for Geronimo is a sure way to allow 
> things to be changed later.

No its not!


>> * if in the future we come up with some other component model to be 
>> supported, it should be trivially easy to plugin MBeans anyway, or a 
>> simple refactor to support them
>
> Why do we need to support plugging in of MBeans?

Because JBoss, Tomcat, Jetty already do this and we want to reuse their 
MBeans. Also because our codebase already does this. Thirdly because 
there's a plethora of reusable MBeans out there that just drop into 
containers like JBoss.


> I challenge the notion that MBeans are even a necessary part of this 
> implementation. It should be an externalised API, using the 
> Facade/Bridge patterns, not everything-must-be-an-mbean.

Point taken - though you're still missing my point - using MBeans does 
not mean we must use JMX.


>
>> Thoughts?
>
> I agree with your main point of this message; that there is an initial 
> code base, and that 'purist' views may not be helpful for moving the 
> project forward quickly.
>
> I also agree that the sooner there is a framework to allow new code to 
> be written, the better.

There already is - its in CVS.


> I disagree that everything-must-be-an-MBean, and I also disagree that 
> the J2EE spec has anything to say on implementational aspects using 
> MBeans.
>
> I disagree that a J2EE server must be an MBean container.
>
> I believe that an approach where everything-is-an-MBean introduces 
> unnecessary high coupling between the application server and the 
> components within. I also assert that if many services are developed 
> that directly are MBeans, then it will be much more difficult (to the 
> extent that it becomes impossible) to refactor out these dependencies 
> later on.
>
> In short, I believe that to keep our options open for longer, and to 
> support migration away from a JMX kernel later on, we should introduce 
> abstract types/interfaces/classes to represent the generic components 
> within Geronimo. Then services should be written entirely in terms of 
> this abstract API and not depend on JMX at all.
>
> This will allow initial code to be developed and the project moved 
> forward, and alternative approaches for managing the Service or 
> Container APIs can be developed in parallel, rather than a big 
> refactoring initially that holds up the development of new services.

Rather than repeating myself again I'll just conclude with - by using 
pluggable MBeans we're not tying ourself to any particular server 
framework - not even JMX. An MBean can be used inside Geronimo today as 
well as in PicoContainer or in an Avalon container with some adapter 
layer or some-other-container-not-invented-yet.

In this thread - please take off your container developer hat and put 
on your service developer hat. In this thread I was purposely not 
discussing the container at all. I was discussing what component 
authors should do. The container should be totally invisible from a 
component developers perspective, then IoC and the container does the 
rest. If you don't believe me - look at some MBeans or PicoContainer 
components.

The only API that might be a possible container API for component 
developers could be a lifecycle interface in Geronimo - or using JSR 
77's lifecycle API which if the latter works I'd prefer then component 
developers are only dependent on J2EE APIs and so their code runs in 
any container, not just Geronimo.

James
-------
http://radio.weblogs.com/0112098/


Re: [services] getting service developers started - the initial component model

Posted by Alex Blewitt <Al...@ioshq.com>.
On Tuesday, Aug 12, 2003, at 07:07 Europe/London, jastrachan@mac.com 
wrote:

> I'm sure we could all debate the perfect container framework and 
> compare and contrast the intricacies of the various flavours of Avalon 
> containers, PicoContainer, JMX & Java Beans until the cows come home. 
> However what is really important right now is we start writing 
> lightweight, pluggable services ASAP to start filling in the J2EE 
> stack for Geronimo.

Definitely concur with this one.

> So initially I think the component model should be JMX MBeans. These 
> are simple, lightweight components that have no compile time 
> dependencies on anything. The MBeans themselves should follow the 
> Inversion of Control pattern - i.e. the container instantiates & 
> configures the MBean. In addition we should try follow the MBean 
> interface pattern such that we can do efficient interception easily 
> with dynamic proxies - also note that MBeans do not need to use JMX at 
> all - any container mechanism can be used to configure & wire together 
> the components.

The only problem with this approach is that there isn't a suitable 
abstraction layer in the Geronimo kernel to allow for easy refactoring 
at a later stage. It would be much better, for example, to create an 
interface called 'Service' (for example) that implements MBean 
initially, but ensure that any code written for Geronimo doesn't depend 
on MBean. That way, refactoring at a later stage will be much easier.

> Already today Geronimo can handle MBeans. It must always be able to 
> handle MBeans. Indeed whatever Geronimo's container framework becomes 
> it should be easily cable of working with the plethora of J2EE MBeans 
> that are out there. (MBeans are essential to J2EE).

I've not found the section in the spec that says this. What I've found 
is:

J2EE.2.6.15 Management: The JMX API is also used to provide /some/ 
management support -- not that it must be implemented using MBeans.
J2EE 6.17 JMX requirements: The only JMX support is specified in hte 
J2EE Management specification. In particular, applications will not 
typically have the security permissions required to access or create 
MBean servers

And the JavaManagement pages say that it's used for management.

So I challenge the statement that MBeans are essential to J2EE -- I 
don't believe that they are according to the spec.

What the spec does say is that the JMX API is available, and that 
optionally, components may be managed through the JMX API. It doesn't 
say anything about them being implemented or managed as MBeans in a 
server.

There also isn't any requirement for a J2EE server to be able to run 
MBeans out of the box. JMX was designed as a management interface to 
allow remote systems to be managed, in much the same way that SNMP was 
designed for.

> So in summary
>
> * lets start writing J2EE services as MBeans that we can plug into 
> Geronimo today.

I think the more services that are created sooner, the better. However, 
I would strongly suggest that we create an abstraction API that we can 
use in Geronimo to make the services available, that decouples the 
implementation of the services from JMX sooner rather than later. 
Otherwise, if we write and build heavily on the assumption that 
everything-is-an-MBean then it will be a lot more difficult to 
change/remove that assumption later on. A few abstract APIs would solve 
this problem immediately.

> * in parallel to this activity folks can help improve & innovate 
> inside the Geronimo kernel - without adversely affecting the progress 
> of the component authors - we can all work in parallel

Absolutely. In fact, it would be great if there was an 'experimental' 
spike doing this now, either by having a set of packages in the 
Geronimo core, or a different module, or a different CVS tag to allow 
this to occur in parallel now. However, since most of us don't have 
commit privileges, (and thus can't control the experimental/head 
checkins) it might be more advisable to have an experimental 
package/module, which would then fit in with head

> * those Avalon fans could package up one or more Avalon containers as 
> MBeans then any Avalon components could be easily deployed inside an 
> actual Avalon container inside Geronimo. Ditto for PicoContainer too. 
> i.e. this strategy allows for a diversity of containers to be > deployed.

This still doesn't address the heavy coupling of the entire framework 
to MBeans/JMX, which is essentially the point I'm making. It would be 
more sensible, for example, to build an Avalon framework kernel that 
could allow legacy MBeans to be instantiated.

> * once all the required deployment options are available (EAR, WAR, 
> SAR) and the ClassLoader stuff is working along with the interceptor 
> stack; folks can then refactor the container using some real J2EE 
> services to improve the manageability & codebase - based on real 
> refactoring of working code rather than too much up front design. 
> Indeed we can take a TDD approach to refactoring the container. So 
> rather than guessing what a J2EE container should look now, we can 
> refactor as we get there to improve it.

And one of the goals about refactoring is to set up easier migration 
paths. Importantly, refactoring can be done at any time, and 
abstracting/decoupling the implementation from JMX (wherever possible, 
not necessarily as a major rewrite) will aid in that. So I'd suggest 
creating abstract interfaces (Service, Container etc.) that developers 
can write to, and not MBeans. (However, the Service can initially 
implement an MBean to facilitate migration.)

> * we should make great progress, getting J2EE coverage fairly soon - 
> yet we won't really be tied to JMX at all - the MBeans could be used 
> in any container implementation.

Again, the J2EE spec in no way requires MBeans to be used as the 
container implementation. Indeed, the spec is specifically 
implementation agnostic on this and almost all other points regarding 
implementation of containers. I'd find it quite unlikely that an 
implementation of something built for one server (e.g. 
WebLogic/WebSphere) would stand a chance of running in another (e.g. 
JBoss, Geronimo).

Building everything now implementing MBean is a sure way to be tied to 
JMX. Building an abstract API for Geronimo is a sure way to allow 
things to be changed later.

> * if in the future we come up with some other component model to be 
> supported, it should be trivially easy to plugin MBeans anyway, or a 
> simple refactor to support them

Why do we need to support plugging in of MBeans? The JMX introduces it 
self as:

"The Java Management Extensions (JMX) technology represents a 
universal, open technology for management, and monitoring that can be 
deployed wherever management and monitoring are needed. By design, this 
standard is suitable for adapting legacy systems, implementing new 
management and monitoring solutions and plugging into those of the 
future."

It's about management. It's about being able to talk to a service and 
manage/configure it remotely. It never said that everything needs to be 
built with JMX -- the 'deployed wherever management and monitoring are 
needed' is the /management/ that's deployed, not the implementation of 
the service.

I challenge the notion that MBeans are even a necessary part of this 
implementation. It should be an externalised API, using the 
Facade/Bridge patterns, not everything-must-be-an-mbean.

> Thoughts?

I agree with your main point of this message; that there is an initial 
code base, and that 'purist' views may not be helpful for moving the 
project forward quickly.

I also agree that the sooner there is a framework to allow new code to 
be written, the better.

I disagree that everything-must-be-an-MBean, and I also disagree that 
the J2EE spec has anything to say on implementational aspects using 
MBeans.

I disagree that a J2EE server must be an MBean container.

I believe that an approach where everything-is-an-MBean introduces 
unnecessary high coupling between the application server and the 
components within. I also assert that if many services are developed 
that directly are MBeans, then it will be much more difficult (to the 
extent that it becomes impossible) to refactor out these dependencies 
later on.

In short, I believe that to keep our options open for longer, and to 
support migration away from a JMX kernel later on, we should introduce 
abstract types/interfaces/classes to represent the generic components 
within Geronimo. Then services should be written entirely in terms of 
this abstract API and not depend on JMX at all.

This will allow initial code to be developed and the project moved 
forward, and alternative approaches for managing the Service or 
Container APIs can be developed in parallel, rather than a big 
refactoring initially that holds up the development of new services.

Alex.


Re: [services] getting service developers started - the initial component model

Posted by James Strachan <ja...@yahoo.co.uk>.
On Tuesday, August 12, 2003, at 08:47  am, James deGraft-Johnson wrote:

> HI,
>
> I am joining this effort with the hope of being a code contributor.
>
> I think this (MBean component model) is a good idea. It would be 
> helpful if
> a sketch or example MBean can be created, so those of us who are new 
> to open
> source development and MBean development can understand exactly what 
> this
> component model entails. (This example does not have to be throw-away 
> as it
> could be a live component.)

There are already quite a few MBeans in the source code. Just search 
for files matching *MBean.java and see how they're used.


> There are two other suggestions I would like to make. One is that a 
> decision
> on the base (kernel/framework) code be made and moved to CVS assuming 
> it
> hasn't already.

Its already there in CVS

> Also, whatever this MBean component model involves, it
> essential that we move ahead to porting the existing 
> containers/services to
> this model to identify any risks in the approach we are taking.

The JMX spec (albeit very large and most of this you can ignore) 
describes how to write MBeans. Maybe the quickest way to see the way 
this works is to look at the examples in mx4j (http://mx4j.sf.net) or 
look at the existing MBeans inside Geronimo.

James
-------
http://radio.weblogs.com/0112098/


RE: [services] getting service developers started - the initial component model

Posted by James deGraft-Johnson <jd...@digaman.com>.
HI,

I am joining this effort with the hope of being a code contributor.

I think this (MBean component model) is a good idea. It would be helpful if
a sketch or example MBean can be created, so those of us who are new to open
source development and MBean development can understand exactly what this
component model entails. (This example does not have to be throw-away as it
could be a live component.)

There are two other suggestions I would like to make. One is that a decision
on the base (kernel/framework) code be made and moved to CVS assuming it
hasn't already. Also, whatever this MBean component model involves, it
essential that we move ahead to porting the existing containers/services to
this model to identify any risks in the approach we are taking.

James deGraft-Johnson
3419 Hampton Hollow Drive, Apt G,
Silver Spring MD 20904.
Tel:        (301) 847-1694
Fax:        (301) 847-8025
Mobile:  (240) 475-1444 (jdegraft@verizon-uc.com)


-----Original Message-----
From: jastrachan@mac.com [mailto:jastrachan@mac.com] 
Sent: Tuesday, August 12, 2003 2:07 AM
To: geronimo-dev@incubator.apache.org
Subject: [services] getting service developers started - the initial
component model

I'm sure we could all debate the perfect container framework and 
compare and contrast the intricacies of the various flavours of Avalon 
containers, PicoContainer, JMX & Java Beans until the cows come home. 
However what is really important right now is we start writing 
lightweight, pluggable services ASAP to start filling in the J2EE stack 
for Geronimo.

Up to now the Geronimo codebase has assumed a JMX micro kernel, 
following in the footsteps of JBoss, Tomcat 5 and Jetty. I'm sure this 
can be improved with time though this strategy has been proved to work. 
Before we get bogged down in months of upfront design for what the 
perfect container should be - I'd like us to be able to make good 
progress integrating the various services - of which there are many. 
Then we have some real use cases that can help us as we refactor the 
Geronimo container.

What I'd like to do as an initial step is choose a default component 
model for service developers to follow as they write Geronimo services. 
For some time most of the main services in Geronimo are going to be 
fairly course grained (web container, Axis, JMS provider, JTA etc). In 
addition at the time of writing Geronimo can deploy MBeans.

So initially I think the component model should be JMX MBeans. These 
are simple, lightweight components that have no compile time 
dependencies on anything. The MBeans themselves should follow the 
Inversion of Control pattern - i.e. the container instantiates & 
configures the MBean. In addition we should try follow the MBean 
interface pattern such that we can do efficient interception easily 
with dynamic proxies - also note that MBeans do not need to use JMX at 
all - any container mechanism can be used to configure & wire together 
the components.

Already today Geronimo can handle MBeans. It must always be able to 
handle MBeans. Indeed whatever Geronimo's container framework becomes 
it should be easily cable of working with the plethora of J2EE MBeans 
that are out there. (MBeans are essential to J2EE).


So in summary

* lets start writing J2EE services as MBeans that we can plug into 
Geronimo today.

* in parallel to this activity folks can help improve & innovate inside 
the Geronimo kernel - without adversely affecting the progress of the 
component authors - we can all work in parallel

* those Avalon fans could package up one or more Avalon containers as 
MBeans then any Avalon components could be easily deployed inside an 
actual Avalon container inside Geronimo. Ditto for PicoContainer too. 
i.e. this strategy allows for a diversity of containers to be deployed.

* once all the required deployment options are available (EAR, WAR, 
SAR) and the ClassLoader stuff is working along with the interceptor 
stack; folks can then refactor the container using some real J2EE 
services to improve the manageability & codebase - based on real 
refactoring of working code rather than too much up front design. 
Indeed we can take a TDD approach to refactoring the container. So 
rather than guessing what a J2EE container should look now, we can 
refactor as we get there to improve it.

* we should make great progress, getting J2EE coverage fairly soon - 
yet we won't really be tied to JMX at all - the MBeans could be used in 
any container implementation.

* if in the future we come up with some other component model to be 
supported, it should be trivially easy to plugin MBeans anyway, or a 
simple refactor to support them

Thoughts?

James
-------
http://radio.weblogs.com/0112098/