Class Command

java.lang.Object
hudson.remoting.Command
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Request, Response, UnexportCommand

public abstract class Command extends Object implements Serializable
One-way command to be sent over to the remote system and executed there. This is the smallest unit of message in remoting from one side to another, such as "please execute this method" or "here's the return value from an earlier method call". This is layer 0, the lower most layer.

At this level, remoting of class files are not provided, so both Channels need to have the definition of Command-implementation.

Since:
3.17
Author:
Kohsuke Kawaguchi
See Also:
  • Method Details

    • readFrom

      public static Command readFrom(@NonNull Channel channel, @NonNull byte[] payload) throws IOException, ClassNotFoundException
      Reads command from the specified payload.
      Parameters:
      channel - Channel
      payload - Payload
      Returns:
      Read command
      Throws:
      IOException - Read exception
      ClassNotFoundException - Deserialization error: class not found
      Since:
      3.22
    • getCreationStackTrace

      @CheckForNull public Throwable getCreationStackTrace()
      Obtains a diagnostic stack trace recording the point at which the command was created. This is not necessarily the point at which the command was delivered or run. Part of the stack trace might have been produced on a remote machine, in which case ProxyException may be used in place of the original.
      Returns:
      an information stack trace, or null if not recorded
    • toString

      public abstract String toString()
      Should provide concise information useful for Channel.Listener.
      Overrides:
      toString in class Object