Autonomous application in Application servers

Discussions

EJB programming & troubleshooting: Autonomous application in Application servers

  1. Autonomous application in Application servers (1 messages)

    Hi all!
    How can I make an application that will start running as soon as the application server starts?

    For example an application monitoring a directory and printing to the standard output any change in that directory.

    I have found JMX and MBeans, but not sure if this is what I need.
    Thanks.

    Zurdo.
  2. Hi all!

    > How can I make an application that will start running as soon as the application server starts?
    >
    > For example an application monitoring a directory and printing to the standard output any change in that directory.
    >
    > I have found JMX and MBeans, but not sure if this is what I need.
    > Thanks.
    >
    > Zurdo.

    Hi Zurdo,

    This is a code section that will get executed when starting your application.
    Notice that this will run in the web container. EJBs are not the solution you are looking for.

    public class YourServlet extends BaseHttpServlet {

        public void initializeApplication(ServletConfig config) {
            super.initializeApplication(config);

            // Initialize and start monitoring
            ...
        }
        
    ...
    }

    Hope this helps

    Kalin