I have two machines. One machine is a client and the other is a server running JBoss. I have no trouble having the client make requests and the server respond to those requests. However, for a new project that I need to do I have to reverse the roles. I have to implement a push model, so the server will need to make requests from the client. Specifically I need the server to be able to ask the client for files in a directory, copy files from the server to the client, and run programs on the client. I’d like to do this without adding a psedo server on the client (a small daemon process).
Is there a good way to do this?
Thanks
EDIT:
So it would appear that I have to set up a server on the client machine to do what I need because I need to have the server push to the client while the client is not running the Java process (but the machine is on). With that in mind, what’s the lightest weight Java server?
Is there any reason why you don’t want to add a server process to the client ?
A simple implementation (to my mind) would be to embed an HTTP server like Jetty (which has a relatively small footprint) within your client. The client can then tell JBoss when it comes up (and where to find the client’s Jetty) and then JBoss can just use HttpClient (or similar) to talk to the client.
If (as your comment suggests) you want to push to the machine whilst your client isn’t running, then why not just install an
sshddaemon and usescpvia JSch ? You can install Cygwin sshd on Windows.