Results 1 to 7 of 7
- 12-22-2009, 04:07 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 8
- Rep Power
- 0
Transfer a process to remote machine
hi
i am doing a project in java. i have to transfer a process(code) to another computer execute over there and get result back.while using this code i am able to copy current process (code) in to another directory but i have to transfer process to another machine execute over there and get result back.
if any one have solution of this problem plz help me out it's urgent.
import java.io.*;
public class dload
{
public static void main(String arg[])
{
Process p = null;
Runtime rt;
try
{
rt = Runtime.getRuntime();
p=rt.exec("cmd /c copy g:\\sushil\\dload.java d:\\newdir"); // '/c' means execute the command.
// It will copy running process(dload.java) to destination(d);;;
}
catch(Exception e)
{
System.out.println(e);
}
}
}
- 12-22-2009, 04:37 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
dload.java isn't a process. It's a java source file.
Little more than a text file, at this stage.
- 12-22-2009, 05:36 PM #3
Member
- Join Date
- Oct 2009
- Posts
- 8
- Rep Power
- 0
ok can u plz send me a code how to transfer a code to remote machine and execute overthere and get result back
- 12-23-2009, 05:59 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
I really don't understand what you're trying to do.
If you want to run something on the other machine you ought to simply deploy it there first...
What you're proposing sounds like a slightly dubious architecture to me.
- 12-24-2009, 07:36 AM #5
You can move object instances between JVM's using ObjectOutputStream and ObjectInputStream. You'll need a socket connection between the machines as well.
- 12-24-2009, 06:36 PM #6
Member
- Join Date
- Oct 2009
- Posts
- 8
- Rep Power
- 0
transfer process
Actually I have to transfer a process to remote pc
(i.e) suppose a big addition is there let's take 900 digit and we hve to perform addition operation on that number for that i hve to divide those number in to multiple process (eg) 1+2+3+4... ( 1+2) as first process and (3+4) second process first process is transfer to Remote pc and perform addition operation and second process will performed locally
so i hve to know how to transfer process and get back the result
plz help me out
- 12-27-2009, 02:28 AM #7
I assumed you already had a JVM running on the remote machine, that is acting as a socket server. The remote machine waits for a socket connection from a client. Once the connection is established, you have lots of options for handling client requests. I suggested using ObjectStream to move objects back and forth between the machines, but that's just one of many valid approaches.
Draw a picture of what you want to accomplish. Add details as you make decisions about what you actually want to do and how to do it. Once you understand what you want to do and generally how to do it, you can start coding and asking specific questions.
Similar Threads
-
how to place a file in remote machine using simple java class
By aradhya in forum Advanced JavaReplies: 10Last Post: 02-28-2012, 08:44 PM -
Java program to ping remote machine using IP address..?
By prabhurangan in forum New To JavaReplies: 19Last Post: 11-22-2011, 03:58 PM -
Remote deploy and remote work with JBoss AS
By chalda in forum EclipseReplies: 2Last Post: 03-08-2010, 11:17 AM -
How do i share one process or service from remote machine in p2p
By vishal.babar07@gmail.com in forum New To JavaReplies: 1Last Post: 02-13-2009, 06:18 AM -
how to load a file in remote machine
By christina in forum New To JavaReplies: 1Last Post: 08-06-2007, 09:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks