Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

Can my java program run on Apache Tomcat?

I have developed a java program used as a job scheduler on the CLient-Server. We have recently been asked whether the scheduler running on the web server, Apache Tomcat, instead of Client-Server (Window 2003).
I can't answer them as I have very limited knowledge about Web stuff.

Please give me some idea if we can run the java program on web server. Thanks
0
LeanMoreTryMore
Asked:
LeanMoreTryMore
  • 2
  • 2
1 Solution
 
objectsCommented:
Yes you could do that, you could use a servlet to handle starting/stopping it plus any other interaction required.
0
 
aozarovCommented:
I guess that the need is to be able to interact and configure jobs via a web client, right?

You can setup your scheduler service inside tomcat so that the servlets will be able to accees it.
That can be done in many ways like:
1. create and store it in a static variable
2. create and store it in your servlet application context
3. use JMX and save it as an MBean

Also, not sure how what kind of a Client-server architecure you have but if your server is
a remote service then you might be able to expose its interfaces to the servlets via JNDI or similar technique
and that may prevent any changes to your server side.
0
 
LeanMoreTryMoreAuthor Commented:
Actually our cleint's administrator did mention about JMX, but I dont know what to do for this.
0
 
objectsCommented:
you can read up on jmx here:
http://java.sun.com/products/JavaManagement/
0
 
aozarovCommented:
JMX is a powerfull and in fact the most popular way currently to manage/monitor/configure java services.
It is part of JDK 5.0 (or can be used as a seperate package for earlier JVM  versions)
It is part of J2EE as way to manage/configure/monitor your application server (JSR 177)
It provides connectors that can expose your instrumentation layer (your managed services) via RMI/HTTP/SNMP and others.
It provides framework services that can be used by other MBeans (e.g. MLets, Timer, ...)
Tomcat itself can be configured via JMX.
For more see the link above.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now