[ 
https://issues.apache.org/jira/browse/JAMES-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13578449#comment-13578449
 ] 

Eike Kettner commented on JAMES-1477:
-------------------------------------

Hi Eric,

oh ok, I haven't seen @Named on methods so far, but I haven't used guice too 
much. In my case (I'm using guice 3.0 and I'm creating the injector with 
Stage.PRODUCTION) it throws the Exception as mentioned above. 

The james guice module I created is written in Scala and it doesn't use all 
james features. It also includes some custom things, of course. The whole 
project is ASL2.0 licensed and you can have a look at it if you like at [1]. 
I'm using a TypeLIstener to inject @Resource annotated methods and other 
things, like @Predestroy or classes implementing the Configurable and 
CamelContextAware interface. I had to create new implementations for the spring 
related classes like ConfigurationProvider or ProtocolHandlerLoader (I found 
the spring-server.xml file and translated it into guice bindings.). So far, it 
works and james is happily running :) Since it's not java it is not ready for 
being a contribution to james, but I guess it's not hard to create appropriate 
Java code  from that. I would give it a try, but I'm too busy the next couple 
of weeks. 

Regards,
Eike

[1] 
https://github.com/eikek/publet-james/tree/112e03650f71baff2d5bd6ef907a61c610580e61/src/main/scala/org/eknet/publet/james/guice
(you can ignore the "Setup.scala" class as it is not related to the guice 
setup) -- just mail me for questions on this or for tasks without deadline ;-)
                
> Replace @Resource with @Inject where it can
> -------------------------------------------
>
>                 Key: JAMES-1477
>                 URL: https://issues.apache.org/jira/browse/JAMES-1477
>             Project: James Server
>          Issue Type: Sub-task
>            Reporter: Eric Charles
>            Assignee: Eric Charles
>
> This will allow also allow to work with different dependency injection 
> frameworks (spring, guice...).
> See also JAMES-1237.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to