public abstract class PortType extends Object implements ExtensionPoint, Describable<PortType>, Serializable
This class implements Serializable
so that the clean up task to be executed
remotely can drag this class into the serialization graph.
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
String |
name
Name that identifies
PortType among other PortType s in the
same PortAllocator , or the numeric port number value if that port
number is fixed. |
Modifier | Constructor and Description |
---|---|
protected |
PortType(String name) |
Modifier and Type | Method and Description |
---|---|
abstract Port |
allocate(AbstractBuild<?,?> build,
PortAllocationManager manager,
int prefPort,
Launcher launcher,
BuildListener buildListener)
Allocates a new port for a given build.
|
abstract PortTypeDescriptor |
getDescriptor() |
int |
getFixedPort()
If this port type has a fixed port number, return that value.
|
boolean |
isFixedPort()
Returns true if this port type has a fixed port number.
|
public final String name
PortType
among other PortType
s in the
same PortAllocator
, or the numeric port number value if that port
number is fixed.protected PortType(String name)
public final int getFixedPort()
public final boolean isFixedPort()
public abstract Port allocate(AbstractBuild<?,?> build, PortAllocationManager manager, int prefPort, Launcher launcher, BuildListener buildListener) throws IOException, InterruptedException
build
- the build that will use the allocated portmanager
- can be used to assign a new TCP port numberprefPort
- port number allocated to this type the last timelauncher
- launcher used to perform operations for the buildbuildListener
- listener that receives information about the buildIOException
InterruptedException
public abstract PortTypeDescriptor getDescriptor()
getDescriptor
in interface Describable<PortType>
Copyright © 2016–2023. All rights reserved.