Hello dudes, i´m wondering, in my project there´s a lot EJBs initialization, i mean, if a EJB needs to call a method from another EJB its create a local EJBLocalObject and get from the container. This everywhere is needed.
I thinking to create a class to centralize every EJB creation, for example, instead this:
//Some method:
{
...
try {
AccountLocal = ( AccountLocal )ServiceProvider.create( "/ejb/AccountLocal" );
} catch ( ServiceException e ){
throw new EJBException( e );
}
...
}
Maybe i could do that:
//Some method:
{
...
AccountLocal = BeanProvider.getAccountBean( );
...
}
What do you think?
Regards,
lottalava