943,735 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 8157
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Apr 25th, 2007
0

inter JVM method calls

Expand Post »
Has anyone tried and succeeded in Inter JVM method calls within a single machine. What I mean is I have two separate applications running on the same machine using two JVMs.
Can they communicate and if so what are the related packages and classes.


antaryami
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
antaryami is offline Offline
14 posts
since Apr 2007
Apr 25th, 2007
0

Re: inter JVM method calls

Google RMI
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Apr 25th, 2007
0

Re: inter JVM method calls

no not RMI, since it is in the same machine.
Really not an option, anything else
Reputation Points: 10
Solved Threads: 1
Newbie Poster
antaryami is offline Offline
14 posts
since Apr 2007
Apr 25th, 2007
0

Re: inter JVM method calls

So? RMI can still be used, you simply run both the client and the server on the same machine, but that does not preclude you from using RMI.

Of course, you can always simply open a socket connection between them over localhost and use ObjectInput/OutputStreams.
Last edited by masijade; Apr 25th, 2007 at 6:48 am.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Apr 25th, 2007
0

Re: inter JVM method calls

..or use EJB's to simplify your task. For each of the two applications, create an equivalent local Home and Remote interfaces and you are good to go. Incase you don't know EJB's, try out the alternative suggested to you by Masijade.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Apr 25th, 2007
0

Re: inter JVM method calls

EJBs would require a full appserver (or 2, if you want 2 JVMs to talk) and would still involve RMI (albeit under the hood).

Interprocess communication between JVMs is no different whether the JVMs are running on the same machine or if one machine is in your bedroom and the other on Mars.
You're going to use RMI or some other networking protocol, only thing you'll notice is that it's going to be faster and probably more reliable if the virtual machines are closer to each other (and it don't get much closer than when they run side by side on the same hardware).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Apr 25th, 2007
0

Re: inter JVM method calls

Click to Expand / Collapse  Quote originally posted by jwenting ...
EJBs would require a full appserver (or 2, if you want 2 JVMs to talk) and would still involve RMI (albeit under the hood).
Local interfaces were introduced for the same reason -- to avoid RMI invocations for methods which reside on the same App server. Since App server runs as a process, the method invocation on objects which reside in the same process space is handled in a different way than the normal RMI ones. You just need the local JNDI name and you are good to go. Oh and btw, the same app server can support deployement of multiple EJB applications.

Quote ...
Interprocess communication between JVMs is no different whether the JVMs are running on the same machine or if one machine is in your bedroom and the other on Mars.
There is always network latency to be taken into consideration. If what you say is true, well known sites wouldn't have used the concept of local mirrors. Infact, network latency is one of the biggest issues which designing applicaitons. There is always a finite amout of time requried which is directly proportional to the distance between the two machines.
Last edited by ~s.o.s~; Apr 25th, 2007 at 3:15 pm.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Apr 27th, 2007
0

Re: inter JVM method calls

Local interfaces work only inside a single appserver instance, thus a single JVM.
OP wants to use IPC between JVMs...
I know full well that a single appserver can run multiple applications side by side, it's my job after all... But those don't run in separate JVMs which is what the question was all about. And they have a marshaller service to take care of the communication between them, they don't do it directly.


Network latency has no influence on the application programming model.
The application doesn't care whether you have 2 instances running on a network with tons of latency or on the same machine (given that you've programmed it to account for the first rule of distributed computing: the network is unreliable).
So for the application it indeed doesn't matter whether you're talking across thousands of miles or to someone in the same OS instance, it'll just be faster. The protocols will be identical, certainly using Java (C might use named pipes between application instances in the same OS instance, Java doesn't have those).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Apr 28th, 2007
0

Re: inter JVM method calls

Ok, ok
here is the actual problem spec.

I have a client application that has a print button. The client is running from the server in the SJSAS 9.
I have a modified Jasper Application for print jobs running in the client itself. How can I call the Jasper application from the client?
So it is not just a remote and local invocation or is it?

alternatively
I have SJSAS 9 and Jasper Server running in one or more JVMs. How can my app server EJB rich Client call the Jasper Server for reporting needs ?

Again has any one tried running JasperServer through JMS or any other mechanism from SJSAS 9 ?


I am working out a project specification and I am short of time.

Thanks for all the participation.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
antaryami is offline Offline
14 posts
since Apr 2007
Nov 8th, 2008
0

Re: inter JVM method calls

Click to Expand / Collapse  Quote originally posted by antaryami ...
Has anyone tried and succeeded in Inter JVM method calls within a single machine. What I mean is I have two separate applications running on the same machine using two JVMs.
Can they communicate and if so what are the related packages and classes.


antaryami
Look at this site

https://cajo.dev.java.net/
Reputation Points: 10
Solved Threads: 0
Newbie Poster
i262666 is offline Offline
1 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: hey guys, just need a quick tip on something!
Next Thread in Java Forum Timeline: very basic java GUI Program...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC