Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieve beans dynamically

Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, is it possible from a client which knows at runtime(let's say with an XML config file) the EJBs interfaces names(Home and remote), given a JNDI name to look for, to retrieve the Home and Remote interfaces dynamically?
My needs would be the following:
given a JNDI name(i.e. "ejb/MySession1") and a class name(i.e. "MySession1Home") to a client it should be able to get the home references and then the remote references(by means of home.create() ) at runtime.
I was thinking to create a Class object with the Home and remote names but the compiler doesn't allow to me to make the narrow-casting with such object. Otherwise i should create a method for each kind of EJB, testing the strings passed as parameter.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic