Am 16.03.2012 09:34, schrieb 1983-01...@gmx.net:
Am 16.03.2012 08:24, schrieb Felix Schumacher:
> Am 15.03.2012 21:54, schrieb Michael-O:
>> Hi folks,
>>
>> I'd like to write a custom ldap resource factory as same as a data
>> source factory. The getObjectInstance method shall return
>> InitialDirContext object. I have written a mock factory and noticed >> that the output is cached by Tomcat. So the object is created only
>> once (same id in Eclipse debugger).
> I think you can change that behavior, but it will not be necessary in
> your case.
I have found it. In
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
look for "singleton". But I still believe, that you will not need it.

Felix,

I checked that already. I am on Tomcat 6.0.35, so this is not an
option for me. Although the Tomcat Pool works great since the
DataSource is created once. It would contradict if the DataSouce and
its pool would exist several times.
That is why the singleton property defaults to true. That resembles
the behavior of older tomcats.

And as I told you already, you want a singleton created by tomcat and given
to your application. That singleton/factory can then be used to create
DirContext objects.

Look at the example for JavaBean resources in the documentation.

Felix

I'll will share my implementation idea shortly on the list as soon as
it works.

Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to