public abstract class AgentProtocol extends Object implements ExtensionPoint
TcpSlaveAgentListener
.
To register your extension, put Extension
annotation on your subtype.
Implementations of this extension point is singleton, and its handle(Socket)
method
gets invoked concurrently whenever a new connection comes in.
isDeprecated()
,
clarifies the deprecation reason and provides extra documentation linksTcpSlaveAgentListener
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
AgentProtocol() |
Modifier and Type | Method and Description |
---|---|
static ExtensionList<AgentProtocol> |
all()
Returns all the registered
AgentProtocol s. |
String |
getDisplayName()
Returns the human readable protocol display name.
|
abstract String |
getName()
Protocol name.
|
abstract void |
handle(Socket socket)
Called by the connection handling thread to execute the protocol.
|
boolean |
isDeprecated()
Checks if the protocol is deprecated.
|
boolean |
isOptIn()
Allow experimental
AgentProtocol implementations to declare being opt-in. |
boolean |
isRequired()
Allow essential
AgentProtocol implementations (basically TcpSlaveAgentListener.PingAgentProtocol )
to be always enabled. |
static AgentProtocol |
of(String protocolName) |
public boolean isOptIn()
AgentProtocol
implementations to declare being opt-in.
Note that Jenkins.setAgentProtocols(Set)
only records the protocols where the admin has made a
conscious decision thus:
opt-in -> opt-out -> opt-in
.
Implementations should never flip-flop: opt-in -> opt-out -> opt-in -> opt-out
as that will basically
clear any preference that an admin has set. This latter restriction should be ok as we only ever will be
adding new protocols and retiring old ones.true
if the protocol requires explicit opt-in.Jenkins.setAgentProtocols(Set)
public boolean isRequired()
AgentProtocol
implementations (basically TcpSlaveAgentListener.PingAgentProtocol
)
to be always enabled.true
if the protocol can never be disabled.public boolean isDeprecated()
public abstract String getName()
public String getDisplayName()
public abstract void handle(Socket socket) throws IOException, InterruptedException
IOException
InterruptedException
public static ExtensionList<AgentProtocol> all()
AgentProtocol
s.@CheckForNull public static AgentProtocol of(String protocolName)
Copyright © 2004–2021. All rights reserved.