Hudson Remoting Architecture: Winston Prakash
Hudson Remoting Architecture: Winston Prakash
Hudson Remoting Architecture: Winston Prakash
Winston Prakash
Click to edit Master subtitle style
Pipe represents the piping between remote callable and local Remote Input/OutputStream and streams sent over
the remote channel so that remote callable can write to local I/O.
Command is a one-way command send to the remote slave agent and executed there. A Request on the other hand is a command that has an associated Response command.
Once the Remote Agent gets the request, executes the command, encapsulate the result in a response and send it back to the master.
Hudson has several key abstractions such as Launcher and FilePath to make the remoting seamless for plugin developers. FilePath works on a local file or remote file hiding details from the developers. Same way Launcher launches the process locally or remotely depending on the available executor.
TCP connection
In this case the I/O stream is the socket Input/Output Stream created from the socket connection made by the Slave agent to the master. The TCP connection can be made from a fixed port number known to the Slave Agent or a JNLP TCP connection created by a Slave Agent that was started by a JNLP launcher. In case of JNLP TCP connection, the agent communicates with master via HTP port to get the socket port.
Channel sends the Callable by placing it in an envelop called UserRequest. This envelop also encloses the ClassLoader proxy to be used in the Remote end. UserRequest initialization method creates a MultiClassLoader and creates an Object Stream from it. Then the callable is serialized in to it and later converted in to a Byte Array. A classLoader Proxy is created and kept in the UserRequest Object. Then Channel writes the UserRequest Object in to the ObjectOutputStream of the socket connection and waits for the Response from Slave. Channel is blocked until response arrives from slave if it is not a asyncCall. The serialized UserRequest Object encapsulates the Closure (callable) and ClassLoaderProxy.