I am looking at the code to run EJB3 out of the container. The process includes creating EJB3StandaloneDeployer, initializing it with both archives and appropriate properties.
Before we start actual method calls on entities, the sample code calls the two methods create() and start(). After we are done, we call stop() and destroy(). What do these methods actually do? How expensive is it to call these methods? Which is more appropriate, having static or an instance EJB3StandaloneDeployer?
I was thinking of having a static EJB3StandaloneDeployer in my class and initializing it as well as doing the create() and start() as part of a static initializer. I would appreciate any feedback.
EJB3StandaloneDeployer deployer = new EJB3StandaloneDeployer();
URL archive = getArchiveURL();
// need to set the InitialContext properties that deployer will use
// to initial EJB containers