geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: Datasource and adapter configuration is too complicated -- advice wanted.
Date Mon, 03 May 2004 07:19:08 GMT
On Sun, May 02, 2004 at 06:13:29PM -0700, David Jencks wrote:
> The current scheme for configuration a ConnectionManager when deploying  
> a datasource or resource adapter is less than ideal. Here's a typical  
> configuration element from a geronimo-ra.xml.
> 
>                     <connectionmanager>
>                         <realm-bridge>TargetRealm</realm-bridge>
>                         <blockingTimeout>100</blockingTimeout>
>                         <maxSize>10</maxSize>
>                         <useTransactions>true</useTransactions>
>                          
> <useLocalTransactions>true</useLocalTransactions>
>                          
> <useTransactionCaching>true</useTransactionCaching>
>                          
> <useConnectionRequestInfo>false</useConnectionRequestInfo>
>                         <useSubject>true</useSubject>
>                     </connectionmanager>
> 
> There are basically 2 kinds of problems with this:
> 
> 1. There are dependencies among the flags in that some of the flags  
> have meaning only if others have a certain value.  For instance  
> useTransactionCaching is looked at only it useTransactions is set.
> 
> 2. Although the underlying interceptor-based design of the  
> ConnectionManager is very flexible and should let you easily set up  
> your own custom style ConnectionManager, right now you are limited to  
> the particular implementation supplied in geronimo.  Using a different  
> ConnectionManager implementation would involve writing a new deployment  
> framework.
> 
> 
> One possibility to improve (1) would be to use more nested xml with the  
> schema grammar controlling what combinations are possible
> 
> for instance:
> 
>                     <connectionmanager>
>                         <localTransactions/><!-- implies  
> useTransactions and useTransactionCaching-->
>                         <containerManagedSecurity>
>                                <realmBridge>targetRealm</realmBridge>
>                         </containerManagedSecurity>
>                         <pooling>
>                             <blockingTimeout>100</blockingTimeout>
>                             <maxSize>10</maxSize>
>                             <partitionByConnectionRequestInfo/>
>                             <partitionBySubject/>
>                         </pooling>
>                     </connectionmanager>
> 

Just throwing this out off the top of my head, maybe it helps, maybe not.

The basic idea: allow nested schemas and make people provide a "builder" that understands
that schema.  You instantiate the builder, pass in the xml, they return whatever it is you
would have built in the current, hardcoded, style.


   <connectionmanager builder="org.foo.CMBuilder">
      <config xmlns="http://foo.org/connectionmanager">
          <localTransactions/>
          <containerManagedSecurity>
             <realmBridge>targetRealm</realmBridge>
          </containerManagedSecurity>
          <pooling>
             <blockingTimeout>100</blockingTimeout>
             <maxSize>10</maxSize>
             <partitionByConnectionRequestInfo/>
             <partitionBySubject/>
          </pooling>
      </config>
   </connectionmanager>

Maybe you even let them easily use existing interceptors or whatnot and want to allow a mix
of standard geronimo-ra tags and their own.  The org.foo.CMBuilder would still get all the
tags and still to all the work, but it might be nice if you wanted to guarantee them some
standard options were present.

   <connectionmanager builder="org.foo.CMBuilder" 
	xmlns:foo="http://foo.org/connectionmanager">

        <localTransactions/>
        <containerManagedSecurity>
           <realmBridge>targetRealm</realmBridge>
        </containerManagedSecurity>
        <foo:pooling>
           <foo:blockingTimeout>100</foo:blockingTimeout>
           <foo:maxSize>10</foo:maxSize>
           <foo:partitionByConnectionRequestInfo/>
           <foo:partitionBySubject/>
        </foo:pooling>
	<foo:otherOption thingy="true" />
   </connectionmanager>


Just throwing it out there in its raw, unflushed, form.  Maybe you see some promise in there
somewhere.

-David Blevins

Mime
View raw message