hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Arnott <b...@aungate.com>
Subject Re: Configuring services question...
Date Wed, 29 Sep 2004 13:14:19 GMT
Howard Lewis Ship wrote:

> The kind of thing you want could be built, but is not part of HiveMind
> at this time.
> 
> Part of the idea of HiveMind is to remove the clutter of external XML
> descriptor files, and move things into HiveMind MDDs, where they will
> be uniform and documented (using HiveDoc).

The idea was that there would be a section in the XML config file
relating to the ObjectPool config, so that it could be tuned for
different loads without having to rebuild the module JAR file for each
install.

> With HiveMind 1.1, you'll be able to mark your object pool service as
> private, so it won't be accessible from outside your own module.

That will be useful.

> I wouldn't balk at the idea of creating new services, HiveMind really
> lets you go wild on divide-and-conquer, resulting in very small, very
> testable services.

I do like the fact that I can create a pooling data source without
having to write any code. I also like the fact that coupled with a
bit of reflection I can handle XML-RPC requests that contain the name
of the service and the method to call, without having to know anything
about the service. It means I can write a server that can have extra
bits added to it by simple placing the modules in the classpath and
restarting.

Well, I've now got the following bits in my descriptor file, but am
getting a error when the PoolableObjectFactory is being created.

   <service-point id="ObjectPool" interface="org.apache.commons.pool.ObjectPool">
     <invoke-factory>
       <construct class="org.apache.commons.pool.impl.GenericObjectPool">
         <!-- config properties... -->
       </construct>
     </invoke-factory>
   </service-point>

   <service-point id="ConnectionFactory" interface="org.apache.commons.dbcp.ConnectionFactory">
     <invoke-factory>
       <construct class="org.apache.commons.dbcp.DataSourceConnectionFactory">
         <service>DefaultDataSource</service>
       </construct>
     </invoke-factory>
   </service-point>

   <service-point id="DefaultDataSource" interface="javax.sql.DataSource">
     <invoke-factory>
       <construct class="org.apache.commons.dbcp.BasicDataSource">
         <!-- properties... -->
       </construct>
     </invoke-factory>
   </service-point>

   <service-point id="PoolableObjectFactory" interface="org.apache.commons.pool.PoolableObjectFactory">
     <invoke-factory>
       <construct class="org.apache.commons.dbcp.PoolableConnectionFactory">
         <service>ConnectionFactory</service>
         <service>ObjectPool</service>
         <object>instance:null</object>
         <string>null</string>
         <boolean>false</boolean>
         <boolean>true</boolean>
       </construct>
     </invoke-factory>
   </service-point>

   <service-point id="DataSourceConnectionPoolService" interface="javax.sql.DataSource">
     <invoke-factory>
       <construct class="org.apache.commons.dbcp.PoolingDataSource">
         <set-service property="pool" service-id="ObjectPool" />
       </construct>
     </invoke-factory>
   </service-point>

The problem is the <object>instance:null</object> statement and I'm
assuming the <string>null</string> statement. How do you specify a null
object to a constructor...?

Thanks,

-- 
Bob Arnott


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message