3 Replies Latest reply on Mar 12, 2003 4:43 PM by burnsanthony

    Hosting a Simulation

    sczadzeck

      I would like to use the JBoss app server as a platform for hosting a simulation. There will also be many thousands of clients that will be accessing this information and performing operations that will effect the simulation. What I need to do is have a process that is continually updating entity beans that is not initiated by any user but is started when the application is loaded. I have scoured many web sites attempting to find a way to do this with little success. The best idea I can come up with is to create a session bean that can start and stop the simulation. When start() is executed the session bean would spawn threads that advance the simulation.

      So, I have three questions: 1) Is JBoss the best choice for this type of application or would I be better of with my own implementation. 2) If I can use the app server, is having a session bean start background tasks the best way to do this? 3) If I do spawn these threads from a session bean, will they be able to access my entity beans using their local home implementation?

      Thanks for any help.

      Scott

        • 1. Re: Hosting a Simulation
          tbfmicke


          Almost sounds like a multiplayer game :-)

          1) What is "best" is hard to tell without knowing more about your app, but doing an own implementation of infrastructure sounds like a waste of time.

          2) I think that using the timer handling in JBoss would work for you, look in scheduler-service.xml that is in the deploy directory. I have not used it so I cannot say anything about the details, but a search for Timer or Scheduler might give some results.

          2-3) Spawning threds on your own is a big no-no inside application servers :-)

          >
          > So, I have three questions: 1) Is JBoss the best
          > choice for this type of application or would I be
          > better of with my own implementation. 2) If I can use
          > the app server, is having a session bean start
          > background tasks the best way to do this? 3) If I do
          > spawn these threads from a session bean, will they be
          > able to access my entity beans using their local home
          > implementation?
          >
          > Thanks for any help.
          >
          > Scott

          • 2. Re: Hosting a Simulation
            joelvogt

            It might be worth writing an mbean that you could then activate/stop from the jmx-console. If it depends on your app being deployed then it should have access to everything you need.

            • 3. Re: Hosting a Simulation
              burnsanthony

              check out swarm on sourceforge