>I think he probably means that you could just do it like this:
>
>bind(EJB3TestRemote.class).toProvider(fromJndi(EJB3TestRemote.class,"EJB3Test/
>remote"));
>
>And then simply:
>@Inject
>private EJB3TestRemote test;

exactly this is the way of use it without @Name selector

>...if you don't want to bind different EJB3TestRemotes to different
>names.

not different names, different IMPLEMENTATIONS. The @Names annotation is a 
selector to choose with concrete implementation of the local/remote ebj 
interface inject (and u can use another annotation if u prefer)

>I haven't tried this though - I'm simply using the @EJB annotation to
>inject EJBs in GlassFish.

Yep, but with @EJB you cannot inject your EJB3 into a non managed object. You 
have to use the ejb3 into servlet or other ejb3 NOT into a POJO.
Using gwt-dispatch, that is a command pattern implementation built on top on 
gwt RPC that allow u to use only one servlet for multiple commands,
i was not be able to iniect my ejb3 logic into the pojo actions.

Gianluigi

>Chris

On Mar 10, 10:03 pm, opn <[email protected]> wrote:
> Hello!
>
> I found an interesting blog entry today and tried to implement it in a
> test application.
>
> Here is the 
> url:http://gianluigidavassiuk.blogspot.com/2009/11/ejb3-plus-guice-how-ex...
>
> Now, as mentioned in the topic, im using Glassfish that runs in
> netbeans or i have a tomcat 6 server accessible via lan or internet
> where i am (trying to) deploying my application.
>
> Now my only problem is that i dont know what i have to use as the
> identifier for the bean to look it up in those two environments
> (glassfish / tomcat).
>
> "bind(EJB3TestRemote.class) .annotatedWith(Names.named("EJB3TestRemote")) 
> .toProvider(fromJndi(EJB3TestRemote.class,"EJB3Test/
> remote"));"
>
> The author says thats specific to JBoss. What do i have to use?
>
> -----
>
> 01      public class  NiceClass {
> 02
> 03       @Inject @Named("EJB3TestRemote")
> 04       private EJB3TestRemote test;
> 05
> 06       public void tryJndi() throws NamingException {
> 07
> 08        System.out.println( test.statelessMethod("JBOSS HELLO") );
> 09       }
> 10      }
>
> Can i use Constructor injection in that style too?
>
> And one last question, in the end the author mentions that the @Named
> annotation is not useful. How would it look like without it?
>
> I'd be really happy if there was someone who can give me detailed
> information about this. I think while googling i found a link to a
> Guice book that gives information about this but for Guice 1.0

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


      

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to