You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Kenny Smith <ke...@journalscape.com> on 2004/01/11 06:30:02 UTC

Suggestions for Beginning Dev

Hi all,

I want to begin working on a greylisting implementation for James. I've 
been searching through code and reading the website, but I can't figure 
out how to get a JdbcDataSource from the avalon framework. Can anyone 
point me at a place to start? Maybe a source file that has an example? 
I found code in JDBCVirtualUserTable that gets a data source, is that 
the proper way to get a data source in a place like SMTPHandler?

-- Kenny


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Suggestions for Beginning Dev

Posted by Kenny Smith <ja...@journalscape.com>.
Ok, thanks! I don't think I ever would have been able to figure that 
out on my own. :)

Kenny

On Jan 11, 2004, at 5:47 PM, Noel J. Bergman wrote:

> Kenny,
>
> If you are working in branch_2_1_fcs, you would have to subclass the 
> compose
> method in the SMTPServer class, because we do not expose the component
> manager.
>
> 	--- Noel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>
-- Kenny


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


RE: Suggestions for Beginning Dev

Posted by "Noel J. Bergman" <no...@devtech.com>.
Kenny,

If you are working in branch_2_1_fcs, you would have to subclass the compose
method in the SMTPServer class, because we do not expose the component
manager.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Suggestions for Beginning Dev

Posted by Kenny Smith <ja...@journalscape.com>.
Hi Noel,

Totally understood about preparing for change. I can't figure out how  
to get a ComponentManager. This is the code I'm trying to imitate from  
JDBCVirtualUserTable:

--------------------------------------------------------------------
ComponentManager componentManager =  
(ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPO 
NENT_MANAGER);

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

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

conn = datasource.getConnection();
--------------------------------------------------------------------

I can't figure out how to get a ComponentManager from the SMTPHandler,  
SMTPHandlerConfigurationData or MailServer. Any help?

Thanks!
Kenny

On Jan 11, 2004, at 3:40 PM, Noel J. Bergman wrote:

>> I found code in JDBCVirtualUserTable that gets a data source, is that
>> the proper way to get a data source in a place like SMTPHandler?
>
> For now.  And be prepared to change.
>
> 	--- Noel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>
-- Kenny


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


RE: Suggestions for Beginning Dev

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I found code in JDBCVirtualUserTable that gets a data source, is that 
> the proper way to get a data source in a place like SMTPHandler?

For now.  And be prepared to change.

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org