Creating instances of EJB's on App Server launch?

Discussion in 'OT Technology' started by aphoric, Sep 18, 2003.

  1. aphoric

    aphoric Even if god did exist, it would be necessary to ab

    Joined:
    Aug 29, 2003
    Messages:
    918
    Likes Received:
    0
    Location:
    Leaving Afghanistan
    So I have some SSB's that are supposed to check the status of some subsystems periodically, I got the timer shite all set up on Weblogic, ready to move to EJB 2.1 spec in a couple of hours, but the last problem is that if the server is running, these beans are supposed to be running, without anyone going and starting them up seperately, any clues?
     
  2. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    I'm assuming these are application scoped beans and not really session beans, is that right? I know my EJB skills are rusty, but I think SSB stands for stateless session bean. Which doesn't make a lot of sense to use if they're used across the entire application to check and report on data. If the data was different per client, I can understand a session scoped object. Of course I didn't get a lot of details on your needs and could be very wrong here. :)

    It's been a long while since I've used WebLogic, but I'm sure you can write a startup class that runs when you start the application instance. Just create the instances in that class and store them however you need.
     
  3. aphoric

    aphoric Even if god did exist, it would be necessary to ab

    Joined:
    Aug 29, 2003
    Messages:
    918
    Likes Received:
    0
    Location:
    Leaving Afghanistan
    Well, I am kinda just following the direction from the architect, he said use SSB's, truly I could care less. I got all the timer shit working the way it should, but I just need to get an instance on deployment of my ear. Thanks for the tip, I will look into that... maybe have it connect via webservice, since they are so hot on that buzzword this week...
     
  4. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    Oh ok. Good luck with it and let us know what you do. ;)
     
  5. aphoric

    aphoric Even if god did exist, it would be necessary to ab

    Joined:
    Aug 29, 2003
    Messages:
    918
    Likes Received:
    0
    Location:
    Leaving Afghanistan
    OK, so what I did is made a listener class that is added to the Web-App's Web.xml as a listener. That makes it start just before the admin console is made available. So this class does the lookup and inits an instance of my SLSB that does the work of handling the callback that I forward from the Timer that is instantiated when the context is initialized in my listener service class. It will be simpler when I can move to EJB 2.1 spec, so that the timer will be running in and EJB, instead of a regular class outside the container.
     
  6. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL

Share This Page