A
Andrew
I have an app that is currently a Junit test but I want to convert it
to a program that will run 24x7, i.e. a server. The dev env that I am
in means the app uses many, many 3rd party jars. Loads of them. We
also use several frameworks including spring and hibernate. There are
many properties and beans that form part of our lengthly
configuration. I have pointed out that ideally this app would be a
standalone server. In the past I designed such apps with a main
entrypoint and wrote a little shellscript to kick them off using the
java VM with appropriate CLASSPATH settings. However, I have been
asked to make it a webapp. I am looking for help.
There are certain advantages to it being a webapp. Deployment is a
snap, the jar issue is neatly taken care of and I don't need to write
a shellscript either since tomcat will run the app for me. But the
question is "how?". I haven't been doing java very long and working in
webspace is very new to me. My server actually has nothing to do with
the web, the webapp route is purely to simplify deployment and the
general runtime env.
The only other webapps I have seen are either using spring MVC or are
a bean that listens to a JMS queue for ever. I can see how these work.
In the first case tomcat starts the app in response to a URL pattern
match and the entrypoint is the http request for the matching URL. In
the second case the bean is a singleton and starts when tomcat starts.
Since it listens to the JMS queue immediately and never shuts down
there is no problem. My app does not fit into either of these
categories. So what kind of entrypoint would I have? Obviously not a
URL-related one. Does that mean it would have to be done as a
singleton referred to in the bean configuration?
Regards,
Andrew Marlow
to a program that will run 24x7, i.e. a server. The dev env that I am
in means the app uses many, many 3rd party jars. Loads of them. We
also use several frameworks including spring and hibernate. There are
many properties and beans that form part of our lengthly
configuration. I have pointed out that ideally this app would be a
standalone server. In the past I designed such apps with a main
entrypoint and wrote a little shellscript to kick them off using the
java VM with appropriate CLASSPATH settings. However, I have been
asked to make it a webapp. I am looking for help.
There are certain advantages to it being a webapp. Deployment is a
snap, the jar issue is neatly taken care of and I don't need to write
a shellscript either since tomcat will run the app for me. But the
question is "how?". I haven't been doing java very long and working in
webspace is very new to me. My server actually has nothing to do with
the web, the webapp route is purely to simplify deployment and the
general runtime env.
The only other webapps I have seen are either using spring MVC or are
a bean that listens to a JMS queue for ever. I can see how these work.
In the first case tomcat starts the app in response to a URL pattern
match and the entrypoint is the http request for the matching URL. In
the second case the bean is a singleton and starts when tomcat starts.
Since it listens to the JMS queue immediately and never shuts down
there is no problem. My app does not fit into either of these
categories. So what kind of entrypoint would I have? Obviously not a
URL-related one. Does that mean it would have to be done as a
singleton referred to in the bean configuration?
Regards,
Andrew Marlow