Use the Listener design pattern.  You'll probably write an interface,
implement it, and then register listeners with classes that will inform them
of events.

The java kit already has some of this pattern:
HttpSessionBindingListener

for example.

The pattern is also prevalent throughout Swing and AWT.

cheers
fillup


On 6/4/02 4:01 PM, "Darya Chernikhova" <[EMAIL PROTECTED]> wrote:

> 
> Sorry if this is a copy.  I got an error message from my mail server,
> after I sent this email, so I'm trying again.
> Darya
> 
> On Tue, 4 Jun 2002, Darya Chernikhova wrote:
>> 
>> Hi all,
>> 
>> I'd like to write a bean that would keep track of all of the jdbc
>> connections that users make.
>> 
>> So, say that I have 2 applications registered on tomcat -- appA and appB.
>> And, say that there are 5 servlets or jsp pages per application --
>> appA/serv1, appA/serv2, ..., appB/serv5 .  And, each servlet's doService
>> method opens a jdbc connection and gets some data out of my database.
>> 
>> I would like to write a bean that would sit there and listen to jdbc
>> connections being made.  It would store a list of objects containing the
>> following data:
>> - connection pointer
>> - session the connection was made out of
>> - app and servlet the connection was made out of.
>> 
>> My problem is that I don't know much about the "connection making" process
>> in Tomcat.  When a new connection is made, which Tomcat controller beans
>> know about it?  What events are sent, and to whom?  What should my bean
>> extend or implement?
>> 
>> I've been looking into the online docs and some books I have, but I
>> haven't found anything useful yet.
>> 
>> Thanks a lot for your help,
>> Darya.
>> 
>> --
>> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to