0 Replies Latest reply on Aug 24, 2005 1:57 PM by Khalid Hajsaleh

    Questions about EJB3StandaloneDeployer

    Khalid Hajsaleh Newbie

      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.

      Khalid







      EJB3StandaloneDeployer deployer = new EJB3StandaloneDeployer();
      URL archive = getArchiveURL();
      deployer.getArchives().add(archive);

      // need to set the InitialContext properties that deployer will use
      // to initial EJB containers

      deployer.setJndiProperties(getInitialContextProperties());

      deployer.create();
      deployer.start();