Discussions

EJB design: Post-deployment initialization

  1. Post-deployment initialization (1 messages)

    Folks,

    Is there a container-agnostic mechanism for post-deployment initialization of EJBs?

    I need a way to have this initialization run once (and only once) before a given bean is first used by the client. This could be done when the server starts up, or lazily just before the bean is invoked.

    Seems like something that should be catered for, but I can't find it.
  2. Post-deployment initialization[ Go to top ]

    The way we have done it is to have a Servlet that is loaded on startup and thus its init method is run

    <servlet>
        <servlet-name>StartupServlet</servlet-name>
        <servlet-class>com.vmu.service.servlet.StartupServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    A lot of containers also offer start up classes but this is container specific.