This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help needed. General question about J2EE architecture.

 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic