inter JVM method calls

Reply

Join Date: Apr 2007
Posts: 14
Reputation: antaryami is an unknown quantity at this point 
Solved Threads: 1
antaryami's Avatar
antaryami antaryami is offline Offline
Newbie Poster

inter JVM method calls

 
0
  #1
Apr 25th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,341
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 250
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: inter JVM method calls

 
0
  #2
Apr 25th, 2007
Google RMI
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 14
Reputation: antaryami is an unknown quantity at this point 
Solved Threads: 1
antaryami's Avatar
antaryami antaryami is offline Offline
Newbie Poster

Re: inter JVM method calls

 
0
  #3
Apr 25th, 2007
no not RMI, since it is in the same machine.
Really not an option, anything else
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,341
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 250
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: inter JVM method calls

 
0
  #4
Apr 25th, 2007
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.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,600
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 462
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: inter JVM method calls

 
0
  #5
Apr 25th, 2007
..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.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: inter JVM method calls

 
0
  #6
Apr 25th, 2007
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).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,600
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 462
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: inter JVM method calls

 
0
  #7
Apr 25th, 2007
Originally Posted by jwenting View Post
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.

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.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: inter JVM method calls

 
0
  #8
Apr 27th, 2007
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).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 14
Reputation: antaryami is an unknown quantity at this point 
Solved Threads: 1
antaryami's Avatar
antaryami antaryami is offline Offline
Newbie Poster

Re: inter JVM method calls

 
0
  #9
Apr 28th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 1
Reputation: i262666 is an unknown quantity at this point 
Solved Threads: 0
i262666 i262666 is offline Offline
Newbie Poster

Re: inter JVM method calls

 
0
  #10
Nov 8th, 2008
Originally Posted by antaryami View 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
Look at this site

https://cajo.dev.java.net/
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC