I also prefer "MailetContext.getConnection(String dataSourceName)".
Implementing another interface in order to get a datasource is the start of
a slippery slope.  Containers that do not provide this functionality should
simply document that fact and throw an UnsupportedOperationException.

Cheers

ADK

--------------------------------------------

There is no magic.


                                                                                       
                                          
                    "Danny Angus"                                                      
                                          
                    <danny@apache.       To:     "James Developers List" 
<[EMAIL PROTECTED]>                          
                    org>                 cc:                                           
                                          
                                         Subject:     Database connections (was RE: 
Avalon dependance in mailets)                
                    07/01/2003                                                         
                                          
                    09:44                                                              
                                          
                    Please respond                                                     
                                          
                    to "James                                                          
                                          
                    Developers                                                         
                                          
                    List"                                                              
                                          
                                                                                       
                                          
                                                                                       
                                          




Ok,

how about this.. I think it may be a better answer to this

there could be two kinds of mailet, Mailet's and DataMailet's the latter,
by
implementing DataMailet, declare their requirement for database
connections.

Then the container implementors can choose and declare in their
specifications whether the container is a DataMailet container

DataMailet would extend Mailet but DataMailetContext
(getDataMailetContext()) would have to provide
getConnection(datasourceName).

Or.. using IOC the container could supply a mailetDatasource on
initialisation which would have a single method.. getConnection().

The last would make it harder for a single mailet to access more than one
datasource, so I prefer the MailetContext().getConnection(datasourceName)
route.

d.

> do we either make db connections available through the MailetAPI
> or do we force mailets to make other arrangements.


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






-----------------------------------------------------------------------------------------------
Have you seen our website?.... http://www.vodafone.co.nz

CAUTION: This correspondence is confidential and intended for the named recipient(s) 
only.
If you are not the named recipient and receive this correspondence in error, you must 
not copy,
distribute or take any action in reliance on it and you should delete it from your 
system and
notify the sender immediately.  Thank you.

Unless otherwise stated, any views or opinions expressed are solely those of the 
author and do
not represent those of Vodafone New Zealand Limited.

Vodafone New Zealand Limited
21 Pitt Street, Private Bag 92161, Auckland, 1020, New Zealand
Telephone + 64 9 357 5100
Facsimile + 64 9 377 0962

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

Reply via email to