Hi!

Alexander Kogan wrote:
> 
> Sorry if my question is stupid, but I'm just curious,
> how it's supposed to be used in "real world"?
> 
> If the client doesn't have bean interfaces as classes
> (but can download them) it should know their fully
> qualified names. Where they come from?
> Hardcoded? Clients parameters? "client descriptor"?
> 
> Is there any way to get this information either
> from the Naming Service or the container?

The normal case is that your client code uses the interface classes
directly. This also means that you will have to bundle the EJB
interfaces with the client, unless some bootstrapping method is used
(see archives).

If that is not the case, i.e. you just want to find "a" bean in JNDI,
and work on it through reflection, then you never need to know what
interface is used, because you never reference it in code.

E.g.:
Object home = new InitialContext().lookup("somebean"); // Get bean
Method create = home.getClass().getMethod("create", new Class[0]); //
Get create() method
Object bean = create.invoke(home, new Object[0]); // Invoke create
method
// At this point you may have some generic interface that you know that
the bean implements
FooBean foo = (FooBean)bean;
foo.someMethod();

And so on. In this case you can have the beans stub and the EJB
interfaces it implements be loaded through dynamic classloading.

regards,
  Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to