You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2007/01/12 08:52:27 UTC

Re: Dynamic Assembler

On Jan 3, 2007, at 3:28 PM, David Blevins wrote:

> So this kind of idea has been in my head for a while.  Basically,  
> the idea is for an interactive assembler implementation which  
> people could call to add/remove containers, resources, and beans at  
> runtime.  We'd also use it to support other services which could  
> now also do the same.
>
> The classic assembler is a one-shot builder, it constructs  
> everything and it's job is done.  What I'm imagining the Dynamic  
> Assembler to be is more of an API for people who want to make calls  
> to build up and add to the container system at runtime.  It'd  
> leverage the InfoObject tree we have now to allow people to do  
> things like:
>
> addContainer(ContainerInfo info)
> addEjbJar(EjbJarInfo info)
> addResource(ResourceInfo info)
>
> There would be equivalent methods for removing any of the above.   
> We might even have equivalent overloaded versions that might look  
> like this:
>

Ok.... Take a look at the heavily reworked Assembler class:

http://svn.apache.org/repos/asf/incubator/openejb/trunk/openejb3/ 
container/openejb-core/src/main/java/org/apache/openejb/assembler/ 
classic/Assembler.java

It should be good to go methods wise.  I basically refactored the  
classic assembler till it looked like the DynamicAssembler I had  
envisioned.  Partway there I was hoping we might come out the other  
end with one assembler and wouldn't have to maintain two or throw  
away one.  That turned out to be the case, our classic assembler is  
the dynamic assembler.  We may want to rename the package, but  
logically it performs every function the old assembler did so maybe not.

> addContainer(String id, Class impl, String type, Properties  
> containerProps)
> addEjbJar(org.apache.openejb.EjbJar ejbJar)
> addEjbJar(URL jarLocation)
> addResource(URL jdbcUrl)

The ConfigurationFactory is the class that will have these methods,  
there not quite there yet but we should be able to do a lot of damage  
with the combinations of these two things:
   ConfigurationFactory.createService
   EjbJarInfoBuilder.buildInfo

Off to clean up the ConfigurationFactory ....

-David


Re: Dynamic Assembler

Posted by Dain Sundstrom <da...@iq80.com>.
On Jan 11, 2007, at 11:52 PM, David Blevins wrote:

> Ok.... Take a look at the heavily reworked Assembler class:
>
> http://svn.apache.org/repos/asf/incubator/openejb/trunk/openejb3/ 
> container/openejb-core/src/main/java/org/apache/openejb/assembler/ 
> classic/Assembler.java

This is sweet!  The code is very readable and I think anyone would be  
confident helping to support it :)

-dain

Re: Dynamic Assembler

Posted by Dain Sundstrom <da...@iq80.com>.
On Jan 16, 2007, at 7:22 AM, David Blevins wrote:

> It'd be great to have a convenience class to smush this class and  
> the Assembler class together, but we can make due for now.

I'm hacking on one of those as I work on the Geronimo integration.   
Right now it is in G but I'll move it to openejb when I get it working.

-dain

Re: Dynamic Assembler

Posted by David Blevins <da...@visi.com>.
On Jan 11, 2007, at 11:52 PM, David Blevins wrote:

>
> On Jan 3, 2007, at 3:28 PM, David Blevins wrote:
>> addContainer(String id, Class impl, String type, Properties  
>> containerProps)
>> addEjbJar(org.apache.openejb.EjbJar ejbJar)
>> addEjbJar(URL jarLocation)
>> addResource(URL jdbcUrl)
>
> The ConfigurationFactory is the class that will have these methods,  
> there not quite there yet but we should be able to do a lot of  
> damage with the combinations of these two things:
>   ConfigurationFactory.createService
>   EjbJarInfoBuilder.buildInfo

Ok.  I think we're good enough on this.  Here's what I wound up with  
for public methods on ConfigurationFactory.

AppInfo configureApplication(File)
AppInfo configureApplication(AppModule)
EjbJarInfo configureApplication(EjbModule)
ClientInfo configureApplication(ClientModule)
ServiceInfo configureService(Class)
ServiceInfo configureService(Class, String, Properties, String, String)

That should be good enough to at least get a little farther.  It'd be  
great to have a convenience class to smush this class and the  
Assembler class together, but we can make due for now.

Going to get some sleep and let Dain take his shift :)

Dain, if you run into something you need before I get up, just add it  
and we'll figure it out later.

-David