Package org.jenkinsci.remoting.util
Class LoggingChannelListener
- java.lang.Object
-
- hudson.remoting.Channel.Listener
-
- org.jenkinsci.remoting.util.LoggingChannelListener
-
public class LoggingChannelListener extends Channel.Listener
Channel listener which merely formats events to a logger.- Since:
- 3.17
-
-
Constructor Summary
Constructors Constructor Description LoggingChannelListener(Logger logger, Level level)
-
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)
Description copied from class:Channel.Listener
When the channel was closed normally or abnormally due to an error.- Overrides:
onClosed
in classChannel.Listener
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)
Description copied from class:Channel.Listener
Called when a command is successfully received by a channel.- Overrides:
onRead
in classChannel.Listener
- Parameters:
channel
- a channelcmd
- a commandblockSize
- the number of bytes used to read this command
-
onWrite
public void onWrite(Channel channel, Command cmd, long blockSize)
Description copied from class:Channel.Listener
Called when a command is successfully written to a channel. SeeChannel.Listener.onRead(hudson.remoting.Channel, hudson.remoting.Command, long)
for general usage guidelines.- Overrides:
onWrite
in classChannel.Listener
- Parameters:
channel
- a channelcmd
- a commandblockSize
- the number of bytes used to write this command
-
onResponse
public void onResponse(Channel channel, Request<?,?> req, Response<?,?> rsp, long totalTime)
Description copied from class:Channel.Listener
Called when a response has been read from a channel.- Overrides:
onResponse
in classChannel.Listener
- Parameters:
channel
- a channelreq
- the original requestrsp
- the resulting responsetotalTime
- the total time in nanoseconds taken to service the request
-
onJar
public void onJar(Channel channel, File jar)
Description copied from class:Channel.Listener
Called when a JAR file is being sent to the remote side.- Overrides:
onJar
in classChannel.Listener
- Parameters:
channel
- a channeljar
- the JAR file from which code is being loaded remotely- See Also:
Capability.supportsPrefetch()
-
-