Hello.

I've just sucessfully unit tested an annotated mailet service injection.
Works as follows..

James uses JNDI "under the hood" to register instantiated services,
whether they are actually in avalon's component manager or not.

an annotation on a mailet method causes James to look-up a service and
inject it into the mailet. I've tested the simple case of injecting
the maildb datasource....

@ServiceInject(serviceKey="maildb") public void setDatasource(DataSource d) {
       this.d=d;
   }

the definition of "ServiceInject" is itelf annotated with
@Retention(RetentionPolicy.RUNTIME) so that the annotation can be
retrieved by the application.

I'll check it in as soon as it is fit to be anywhere near the ASF svn ;-).

d.

Reply via email to