users@glassfish.java.net

Re: Injection into WebStart Client not working?

From: <glassfish_at_javadesktop.org>
Date: Mon, 24 Mar 2008 09:36:12 PST

> @Remote (to tell GlassFish that this bean class
> implicitely defines its
> own interface as beeing the remote interface).

The confusion is that there are many ways the @Remote/_at_Local annotations can be applied. In all cases there is still an interface that is distinct from the bean class. Typically when @Remote or @Local is specified on the bean class, its value attribute is specified to be the name of the interface.

@Remote(Cart.class)
@Stateless
public class CartBean { ... }

Technically, @Remote or @Local can be specified with no value on the bean class. This is rarely used but it's just a shorthand to say that the one interface in the implements clause should be considered either @Remote or @Local.

// One remote business interface : Cart
@Remote
@Stateless
public class CartBean implements Cart { ... }

// One local business interface : Cart
@Local
@Stateless
public class CartBean implements Cart { ... }

> Moreover, 3.4.1 gives an
> example of a client:
>
> @EJB Cart cart;
>
> ...and no remote interface is referenced there... (or
> is "Cart" a remote
> interface?) !

Yes, Cart is an interface but it's ambiguous from the code snippet whether it's a local or remote business interface.
[Message sent by forum member 'ksak' (ksak)]

http://forums.java.net/jive/thread.jspa?messageID=265521