File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes Help needed. General question about J2EE architecture. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Help needed. General question about J2EE architecture." Watch "Help needed. General question about J2EE architecture." New topic
Author

Help needed. General question about J2EE architecture.

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,

On the one hand, I have a java class (actually a set of classes) that does a lot of low level input/output operations.

On the other hand I have a web console in jsp/servlets.

I want to be able to invoke a method on the "low-level" java app from the web console bearing in mind that the war will run on one computer on the network and the "low-level" app on another computer on the network.

What is the best way to invoke a public method of the "low-level" app from the web console???

Do I need to use RAR adapters?

Any clue very welcome,

Julien.
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

you may use RMI, or you can wrap your application services as XML web services to be able to invoke them from the remote web application.

You can create a simple network server nad use the network server but i do not recommand this solution.

Best option, if it does not break your design is web services. IMHO
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
I thought of using web services however I don't know how to connect the low-level app to the app server (I do need an app server in order to have a web service?? Don't I?) Do you see what I mean?
Julien.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
No, you don't need an app server for WS; a web server with a SOAP engine will suffice (e.g. Tomcat with Axis). If having an extra web server is not possible for some reason, you might take a low-level approach and open a Telnet or SSH session to the target machine, and execute the low-level app in a command-line session. But a WS or RMI approach is certainly to be preferred.


Ping & DNS - my free Android networking tools app
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello and thanks for the reply,
I meant a "container" be it web or ejb (i use the term "app server" a bit freely). Can anyone tell me whether I can connect a servlet to a low-level app that does i/o operations??
Julien.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
If by "connect a servlet to the application" you mean how the servlet can run the application and receive results from it, then one way is to use Runtime.exec. It provides the calling application with a Process object, through which input can be piped into the application and its output can be read.
 
 
subject: Help needed. General question about J2EE architecture.
 
Similar Threads
Need help implementing security on RMI based JMX console client connection
Name not found in context "java:".
What is distributed Computing from an Application's Point of View
Altering DB interface
What is Web Service?