Class PortType
java.lang.Object
org.jvnet.hudson.plugins.port_allocator.PortType
- All Implemented Interfaces:
ExtensionPoint
,Describable<PortType>
,Serializable
- Direct Known Subclasses:
DefaultPortType
,GlassFishJmxPortType
,PooledPortType
,TomcatShutdownPortType
public abstract class PortType
extends Object
implements ExtensionPoint, Describable<PortType>, Serializable
Base class for different types of TCP port.
This class implements Serializable
so that the clean up task to be executed
remotely can drag this class into the serialization graph.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal String
Name that identifiesPortType
among otherPortType
s in the samePortAllocator
, or the numeric port number value if that port number is fixed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Port
allocate
(AbstractBuild<?, ?> build, PortAllocationManager manager, int prefPort, Launcher launcher, BuildListener buildListener) Allocates a new port for a given build.abstract PortTypeDescriptor
final int
If this port type has a fixed port number, return that value.final boolean
Returns true if this port type has a fixed port number.
-
Field Details
-
name
Name that identifiesPortType
among otherPortType
s in the samePortAllocator
, or the numeric port number value if that port number is fixed.
-
-
Constructor Details
-
PortType
-
-
Method Details
-
getFixedPort
public final int getFixedPort()If this port type has a fixed port number, return that value. Otherwise 0. -
isFixedPort
public final boolean isFixedPort()Returns true if this port type has a fixed port number. -
allocate
public abstract Port allocate(AbstractBuild<?, ?> build, PortAllocationManager manager, int prefPort, Launcher launcher, BuildListener buildListener) throws IOException, InterruptedExceptionAllocates a new port for a given build.- Parameters:
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 build- Throws:
IOException
InterruptedException
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<PortType>
-