Package hudson.remoting
Class Channel.Listener
- java.lang.Object
-
- hudson.remoting.Channel.Listener
-
- Direct Known Subclasses:
LoggingChannelListener
- Enclosing class:
- Channel
public abstract static class Channel.Listener extends Object
Callback "interface" for changes in the state ofChannel
.
-
-
Constructor Summary
Constructors Constructor Description Listener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onClosed(Channel channel, IOException cause)
When the channel was closed normally or abnormally due to an error.void
onJar(Channel channel, File jar)
Called when a JAR file is being sent to the remote side.void
onRead(Channel channel, Command cmd, long blockSize)
Called when a command is successfully received by a channel.void
onResponse(Channel channel, Request<?,?> req, Response<?,?> rsp, long totalTime)
Called when a response has been read from a channel.void
onWrite(Channel channel, Command cmd, long blockSize)
Called when a command is successfully written to a channel.
-
-
-
Method Detail
-
onClosed
public void onClosed(Channel channel, IOException cause)
When the channel was closed normally or abnormally due to an error.- Parameters:
cause
- if the channel is closed abnormally, this parameter represents an exception that has triggered it. Otherwise null.
-
onRead
public void onRead(Channel channel, Command cmd, long blockSize)
Called when a command is successfully received by a channel.- Parameters:
channel
- a channelcmd
- a commandblockSize
- the number of bytes used to read this command- Since:
- 3.17
-
onWrite
public void onWrite(Channel channel, Command cmd, long blockSize)
Called when a command is successfully written to a channel. SeeonRead(hudson.remoting.Channel, hudson.remoting.Command, long)
for general usage guidelines.- Parameters:
channel
- a channelcmd
- a commandblockSize
- the number of bytes used to write this command- Since:
- 3.17
-
onResponse
public void onResponse(Channel channel, Request<?,?> req, Response<?,?> rsp, long totalTime)
Called when a response has been read from a channel.- Parameters:
channel
- a channelreq
- the original requestrsp
- the resulting responsetotalTime
- the total time in nanoseconds taken to service the request- Since:
- 3.17
-
onJar
public void onJar(Channel channel, File jar)
Called when a JAR file is being sent to the remote side.- Parameters:
channel
- a channeljar
- the JAR file from which code is being loaded remotely- Since:
- 3.17
- See Also:
Capability.supportsPrefetch()
-
-