in the service() method of the SMTPServer you can reach the ServiceManager. Then you have to lookup for the datasourceselector and pass it to the handler.

Currently the SMTPServer has no dependencies on DataSourceSelector, so you will have to add this dependency declaration (adding it to the SMTPServer.xinfo and to james-assembly.xml).

Look at the James.xinfo and James block in james-assembly.xml to understand how to add this dependency declaration to the SMTPServer, too.

Stefano

Norman Maurer wrote:
Hi guys,
im looking in writting a greylist Handler but i cant figure out how to
do sql commands in smtphander chain. The main problem i have is that i
don't know how to modify the next few lines to get them work in smtp:

ServiceManager componentManager = (ServiceManager)
getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);

// Get the DataSourceSelector service
DataSourceSelector datasources = (DataSourceSelector)
componentManager.lookup(DataSourceSelector.ROLE);

// Get the data-source required.
datasource = (DataSourceComponent) datasources.select(datasourceName);

anyone can give me some tips or help ?

thx



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

Reply via email to