• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic EJB Creation  RSS feed

 
Sudeep Victor
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to know if there is a way of creating EJB's on the fly. For Example if I define all my EJB's in a properties file and using a ServiceLocator to not only look them up, but also to creat them.
TestEjbHome aHome = (TestEjbHome)EJBHomeFactory.singleton().getHome("test.TestEjb");
aHome.create();

Would like to replace this by someting more generic. Any Help on this would be appretiated.
For Example
for (i=0;i<ejbs.length();i++){
EJB ejb = (EJB)ejbs.get(i);
Class.forName(ejb.name()) aHome = (Class.forName(ejb.name()))EJBHomeFactory.singleton().getHome(ejb.home());
aHome.create();
}


Thanks,
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"SPV",
We're pleased to have you here with us in the EJB forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks,
Jeanne
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!