Package hudson.remoting
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
Channel
s need to have the definition ofCommand
-implementation.- Since:
- 3.17
- Author:
- Kohsuke Kawaguchi
- See Also:
Channel.Listener.onRead(hudson.remoting.Channel, hudson.remoting.Command, long)
,Channel.Listener.onWrite(hudson.remoting.Channel, hudson.remoting.Command, long)
, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Throwable
getCreationStackTrace()
Obtains a diagnostic stack trace recording the point at which the command was created.static Command
readFrom(Channel channel, byte[] payload)
Reads command from the specified payload.abstract String
toString()
Should provide concise information useful forChannel.Listener
.
-
-
-
Method Detail
-
readFrom
public static Command readFrom(@NonNull Channel channel, @NonNull byte[] payload) throws IOException, ClassNotFoundException
Reads command from the specified payload.- Parameters:
channel
- Channelpayload
- Payload- Returns:
- Read command
- Throws:
IOException
- Read exceptionClassNotFoundException
- 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 caseProxyException
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 forChannel.Listener
.
-
-