tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roytman, Alex" <roytm...@peacetech.com>
Subject RE: Catalina: How to specify factory class name for a Resource inserver.xml
Date Tue, 07 Aug 2001 22:45:12 GMT
Craig,

Thank you very much for your help. I have one more question. Why new
instance of my factory gets created every time I lookup for a resource
created by this factory?


-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Tuesday, August 07, 2001 5:05 PM
To: tomcat-user@jakarta.apache.org
Cc: tomcat-user@jakarta.apache.org
Subject: Re: Catalina: How to specify factory class name for a Resource
inserver.xml




On Tue, 7 Aug 2001, Roytman, Alex wrote:

> 
> 
> Hello,
> 
> I am writing several jndi factories for catalina's JNDI implementation
> and I am trying to figure out how to specify factory class for a
> resource. The only sample I found was
> <Resource name="jdbc/usorg" auth="CONTAINER"
> type="javax.sql.DataSource"/>
> and factory class for type="javax.sql.DataSource" is hard coded. 
> How do I specify factory class for my resource?
> 

In server.xml, you configure the actual resource with a
<ResourceParams>,
which can have nested <parameter> entries.  Use a parameter named
FACTORY
to define the fully qualified clas name of the resource factory class
itself.

Alternatively, you can pass system properties that define the factory
for
a particular resource type.  For example, to set the factory class name
for a resource type "com.mycompany.Foo", you could say:

  export \
 
CATALINA_OPTS="-Dcom.mycompany.Foo.Factory=com.mycompany.MyFooFactory"

before starting Tomcat 4.

> Thank you very much
> 
> Alex Roytman
> 

Craig



Mime
View raw message