T
TwelveEighty
I have a heavy duty java server application that is collecting
information from computerized sources and processing and archiving
events in real-time. The configuration on this app is currently done
through RMI by exposing certain objects as remote objects on which
clients can invoke actions (add, remove, change, etc.).
I like to add the ability to communicate with the server application
via web services, so Tomcat seems like a good "best practice" choice.
However, from a design perspective, it seems like the Tomcat server
becomes the main "host" application from which other java classes can
be "activated" based on requests from clients.
The only way I currently see to "bolt on" the Tomcat web services is
to have two virtual machines running, one with my application and the
other being the Tomcat server. However, that means that all
communication between the main app and Tomcat needs to go through RMI,
because there are two VMs. This sounds very inefficient, I much rather
have the whole application running in a single VM.
Is there a design possible where I can incorporate my application into
the same virtual machine that is running Tomcat? More specifically:
1) Can I "bootstrap" my own java classes inside the Tomcat environment
during the Tomcat startup process? If so, does all handling need to
take place in the constructor of my classes, or can I invoke specific
methods?
2) Is there a RMI registry created during the Tomcat startup that I
can register my existing RMI classes with, to keep the existing RMI
functionality I have today? If so, can I change its port through
configuration?
Thanks.
information from computerized sources and processing and archiving
events in real-time. The configuration on this app is currently done
through RMI by exposing certain objects as remote objects on which
clients can invoke actions (add, remove, change, etc.).
I like to add the ability to communicate with the server application
via web services, so Tomcat seems like a good "best practice" choice.
However, from a design perspective, it seems like the Tomcat server
becomes the main "host" application from which other java classes can
be "activated" based on requests from clients.
The only way I currently see to "bolt on" the Tomcat web services is
to have two virtual machines running, one with my application and the
other being the Tomcat server. However, that means that all
communication between the main app and Tomcat needs to go through RMI,
because there are two VMs. This sounds very inefficient, I much rather
have the whole application running in a single VM.
Is there a design possible where I can incorporate my application into
the same virtual machine that is running Tomcat? More specifically:
1) Can I "bootstrap" my own java classes inside the Tomcat environment
during the Tomcat startup process? If so, does all handling need to
take place in the constructor of my classes, or can I invoke specific
methods?
2) Is there a RMI registry created during the Tomcat startup that I
can register my existing RMI classes with, to keep the existing RMI
functionality I have today? If so, can I change its port through
configuration?
Thanks.