Package jenkins.cli.listeners
Class DefaultCLIListener
java.lang.Object
jenkins.cli.listeners.DefaultCLIListener
- All Implemented Interfaces:
ExtensionPoint
,CLIListener
@Extension
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class DefaultCLIListener
extends Object
implements CLIListener
Basic default implementation of
CLIListener
that just logs.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onCompleted
(CLIContext context, int exitCode) Invoked after command execution.void
onExecution
(CLIContext context) Invoked before command execution.void
onThrowable
(CLIContext context, Throwable t) Invoked when an exception or error occurs during command execution.
-
Constructor Details
-
DefaultCLIListener
public DefaultCLIListener()
-
-
Method Details
-
onExecution
Description copied from interface:CLIListener
Invoked before command execution.- Specified by:
onExecution
in interfaceCLIListener
- Parameters:
context
- Information about the command being executed.
-
onCompleted
Description copied from interface:CLIListener
Invoked after command execution.- Specified by:
onCompleted
in interfaceCLIListener
- Parameters:
context
- Information about the command being executed.exitCode
- Exit code returned by the implementation ofCLICommand.run()
.
-
onThrowable
Description copied from interface:CLIListener
Invoked when an exception or error occurs during command execution.- Specified by:
onThrowable
in interfaceCLIListener
- Parameters:
context
- Information about the command being executed.t
- Any error during the execution of the command.
-