Class PooledPortType
java.lang.Object
org.jvnet.hudson.plugins.port_allocator.PortType
org.jvnet.hudson.plugins.port_allocator.PooledPortType
- All Implemented Interfaces:
ExtensionPoint
,Describable<PortType>
,Serializable
Port type for representing a pool of ports used concurrently by parallel jobs
- Author:
- pepov
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocate
(AbstractBuild<?, ?> build, PortAllocationManager manager, int prefPort, Launcher launcher, BuildListener buildListener) Try to allocate one free port from the given pool.Methods inherited from class org.jvnet.hudson.plugins.port_allocator.PortType
getFixedPort, isFixedPort
-
Constructor Details
-
PooledPortType
-
-
Method Details
-
allocate
public Port allocate(AbstractBuild<?, ?> build, PortAllocationManager manager, int prefPort, Launcher launcher, BuildListener buildListener) throws IOException, InterruptedExceptionTry to allocate one free port from the given pool. Wait for a short period if no free port is available, then try again.- Specified by:
allocate
in classPortType
- 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>
- Specified by:
getDescriptor
in classPortType
-