First of all, great work. I downloaded the source to see how it works. I am
an incorrigible refactorer, and when I saw ContainerFactory.deploy() with:

         while(beans.hasNext())    //line 395 in the 12/16 cvs
         {
              //4 big if-else statements with much duplicated logic
          }    // line 838

... I had to give it a go.

I changed that entire while loop to:
         while(beans.hasNext())
         {
            BeanMetaData bean = (BeanMetaData)beans.next();

            log.log("Deploying "+bean.getEjbName());

            BeanDeployer.deployBean(bean, cl);
         }

plus 5 classes (BeanDeployer, and subclasses EntityBeanDeployer,
StatelessSessionDeployer, StatefulSessionDeployer, and
MessageDrivenDeployer). BeanDeployer is an abstract class. It could
just as easily be an interface, with an abstract class in between it
and the FooDeployer implementations.

I also added methods in Container to access plugins that seemed to be
universal, at least to the four types defined so far.

To prevent one big download, I'll post each separately.
(BeanDeployer, EntityBeanDeployer, StatelessSessionDeployer,
StatefulSessionDeployer, MessageDrivenDeployer, Container).

Regards,
Jack Bolles


Reply via email to