5 Replies Latest reply on Oct 24, 2003 12:25 PM by dward2

    Startup Classes : Flux

    ksteo1

      Hi,

      Any idea of how should I go about integrating Flux as a startup class in JBoss? In both Weblogic & Websphere, they both supports bootstrapping startup classes to it. This allows us to start Flux as another internal service within the app server.


      Cheers!

        • 1. Re: Startup Classes : Flux
          starksm64
          • 2. Re: Startup Classes : Flux
            ksteo1

            Thanks Scott!

            Will look into that, I believe that will solve the problem :).

            • 3. Re: Startup Classes : Flux
              twutort

              I need to have a startup class like this that takes arguments like in weblogic. Is there a way I can do this and read in arguments from the xml file?

              • 4. Re: Startup Classes : Flux

                You can set attributes for your mbean when you start it, for example in the user-service.xml file. See this file for an example.

                Hth
                Peter.

                • 5. Re: Startup Classes : Flux

                  You don't need to use MBeans. In the Servlet 2.3 spec, ServletContextListeners were introduced. Implement one of those and enter it an a war's web.xml file. Then add this war file to your ear that also contains your ejb-jar files (if you need more than just a web app). Then, you can trigger startup from the contextInitialized() method and shutdown on the contextDestroyed() method. This is a standard J2EE way of doing startup/shutdown hooks of J2EE applications, and is therefore appserver agnostic.

                  Oh yeah. If you can't use Servlet 2.3 spec, you can use a similar (though not as elegant) mechanism in 2.2. Write a Serlvet instead of a ServletContextListener, and do your startup/shutdown code in the init()/destroy() methods, respectively. Then in web.xml, register the servlet *and be sure to add* a <load-on-startup>1</load-on-startup> element (the # doesn't really matter unless you want to order it with other servlets).

                  To configure it, you can put a properties file or xml file in your jar next to the ServletContextListener (or Servlet) and load in the config using yourClass.getResource().