Discussions

General J2EE: daemons

  1. daemons (5 messages)

    i need to write a application which monitors directories. this application needs to look for files in a given directory and if the number of files reaches for example 100, than a email has to be send to a person. the application is like a "daemon" application. a web interface is mandatory to view the current state of the application. this is a simple application. BUT, what is the "standard" way to do it with "J2EE". i want to use servlets/jsp to create the web interface. but how can you implement a "daemon"?

    Threaded Messages (5)

  2. Re: daemons[ Go to top ]

    Try using Quartz for deamon/job sheduling http://www.opensymphony.com/quartz/ i use it with so good result, i hope it would be usefull to you to :)
  3. re: daemons[ Go to top ]

    Thanx for the information. But scheduling is not the problem i have. I guess i could also use a timer bean. My problem is to write something like a daemon AND USE SERVLETS/JSP FOR THE GUI. Of course i can write a very little java program that fits the requirements and use quartz to do the scheduling. but if i do so, how can is use servlets/jsp to create a gui? i do NOT want to implement my own http listener. What is the "J2EE Way" to do what i want to do?
  4. Re: re: daemons[ Go to top ]

    Take a look at Jetty, a very small servlet container that may be embedded in your small application. http://www.mortbay.org/ /Niklas
  5. J2EE - The Real Choice?[ Go to top ]

    Thanx again. But thats also not what i need. The more i get involved into the J2EE architecture and the J2EE features the more i realize that J2EE is not the best choice to implement a "HUGE", "VERY DISTRIBUTED", "MULTI APPLICATION BASED" enterprise solution. From all the answers i got to my post and all the things i read about J2EE i guess the final answer is: "J2EE HAS NO DAEMON SUPPORT". A lot of things are missing in J2EE, very much is unusable and to complicated. And then there is SUN, sleeping for the last five years and ignoring the J2EE community. Becaus a lot of things in J2EE are just "BAD" peoble begin to create their own "Specifications". So there was a SPRING Framework born, hibernate came up, and and and and and so on. If anybody from the company SUN is reading this, please wake up!
  6. Re: daemons[ Go to top ]

    I would create the daemon queriable/controlable through RMI (one of the remote methods would be public String getStatus()). Then I would install your java daemon as an NT service (using JavaService.exe). From your servlet you can query/controll your daemon using the RMI remote interface. If you don't want to use RMI+Services I would create your daemon as a Thread in the Web Server's Application context (created when the application initializes > create your own ServletContextListener). Your servlet gets the instance of your daemon from the servlet context and uses it to query it's status.
    i need to write a application which monitors directories. this application needs to look for files in a given directory and if the number of files reaches for example 100, than a email has to be send to a person. the application is like a "daemon" application. a web interface is mandatory to view the current state of the application.

    this is a simple application. BUT, what is the "standard" way to do it with "J2EE". i want to use servlets/jsp to create the web interface.

    but how can you implement a "daemon"?