The value stored in JNDI is an object - a proxy object that implements the 
interfaces you define.

So...no, you can't pull out an object that only implements one of the 
interfaces you've defined.

However, you should be casting the proxy from JNDI into the interface you 
want...

Interface1 myBean = (Interface1)PortableRemoteObject.narrow(
  |         new InitialContext(props).lookup("address"),
  |         Interface1.class);

...and that way, you'll have compile-time constraints to only invoke operations 
defined by Interface1.

(Code above only for remote lookup; local can skip the 
"PortableRemoteObject.narrow()) step)

S,
ALR

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020840#4020840

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020840
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to