Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Capture Currently running application and share with a remote host  RSS feed

 
Lakshitha Ranasinghe
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a issue which I faced during the development of the web conferencing tool using java,

That is Currently Im using C library to implement the Application sharing option. That C classes capture the Process ID (in Windows platform's Task manager displayiing processes)of the currently running program and pass it to the remote host.

Im going to implement it using java and Is there a way to achieve that application sharing feature in Java, any new classes in java 5.0?

Please help to resolve this matter,

Thanks,
Lakshitha
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That does not sound like the Java approach to a distributed application.

The Java approach would work at a more abstracted level using the many powerful networking tools and would not care about the process id.

You should step back from the keyboard and go read about Java networking technology like RMI, Jini, and Java Message Service and web services in general.

If this conferencing tool really does need to live on the web you will find it a lot easier to work with toolkits designed to send messages over the net.

Tell us more about your requirements - what does this application actually do?

Bill
[ March 27, 2006: Message edited by: William Brogden ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"lakshitha@CSL Ranasinghe" -

Welcome to the JavaRanch! We don't have many rules around the ranch, but we do have a policy on displayed names... Please adjust your displayed name to meet the
JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.

You can change your user name here.

Thanks! and welcome to the JavaRanch!
 
Lakshitha Ranasinghe
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clarifications which you have done for me.I really appreciate it.
My application is like this, There is a main Java application which is running as the host and also there are many client applications which communicate with that host application. (This tool like WebEx conferencing tool)

The network architecture is P2P and we are using JXTA for that. Host can start the meetings and invite to the clients/guests to join with that meeting. There are some features which can use to communicate each other.

Among them the chat service, whiteboard, desktop sharing and hot application sharing to the clients are functioning.

My requirement is that implement the host application sharing(Application means that the Currently running program in the host machine ex: JBuilder.exe) to the client using java. Because its now implemeted with C library.

I hope this clarification is helped to you, Please explain me about the which java technology should use for such a task.

I should thank Mr. William for his comments as well as I have referred your site too.

Thanks and Regards
Lakshitha
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My requirement is that implement the host application sharing(Application means that the Currently running program in the host machine ex: JBuilder.exe) to the client using java. Because its now implemeted with C library.


Let me see if I understand this - you want the client machine to see the application currently running on the server as if it is running on the client, and this application is a C .exe program?

That is way too machine specific for Java. You might be able to capture a screen shot on the "server" side and transmit that image, but Java does not provide ways to send GUI events to a C program.

The users could run one of the virtual PC programs that are Windows specific, such as PCanywhere, and interact with the application, but it would not be under Java control and only one user at a time could control the application.

Bill
 
Lakshitha Ranasinghe
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Actually this is not what really want, Lets think we are working in the windows platform, If I can Identify the currently running processes (by Id or any other way)I can transfer it to the remote computer. For now what I want is that to capture the currently running program processes using java technology.

Thank you very much for your replies Bill

Best regards
Lakshitha
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can find a operating system utility that lists the applications and process IDs to the command line, you can use the Runtime exec capability to execute that utility and catch the output text lines.

?Transfer a running process to a remote computer?
Bill
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lakshitha Ranasinghe:
If I can Identify the currently running processes (by Id or any other way)

On the Windows Platform the process ID is not a reliable method of identifying processes. On unix it's "pretty" reliable as process IDs are used sequentially until rollover is necessary. On Windows new processes will reuse process IDs of recently deceased processes. In C/C++ or .NET you have to obtain the process handle and associate that with an unique external identifier like an User ID or Session ID to track the identity of the process in the program and to relate it to that external entity.

So basically hold on to the Java Process object that is created and assign it an identity that makes sense within your application and store that pair somewhere (e.g. Hashmap).

That being said, you can always use the Tasklist command (from java.lang.Runtime.exec() or java.lang.ProcessBuilder) and parse (or regex match) its output looking for your image names (e.g. myProgram.exe) and the associated process IDs. However just because there was a "myProgram.exe 1396" 20 minutes ago, doesn't necessarily imply that the current "myProgram.exe 1396" is the same process instance. The one from 20 minutes ago may have died and a new "myProgram.exe" may have gotten its process ID.
[ March 29, 2006: Message edited by: Peer Reynders ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!