| | |
inter JVM method calls
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
----------------------------------------------
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
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.
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
----------------------------------------------
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
..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.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
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).
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.
•
•
•
•
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.
Last edited by ~s.o.s~; Apr 25th, 2007 at 3:15 pm.
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
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).
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.
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.
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.
•
•
Join Date: Nov 2008
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
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
https://cajo.dev.java.net/
![]() |
Similar Threads
- General Programming issue (Computer Science)
Other Threads in the Java Forum
- Previous Thread: hey guys, just need a quick tip on something!
- Next Thread: very basic java GUI Program...
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception file fractal ftp game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited variablebinding webservices windows






