Skip to content

Commit

Permalink
JENKINS-18786 remove ResourceActivity, that blocks jobs on different …
Browse files Browse the repository at this point in the history
…slaves
  • Loading branch information
pepov committed Jul 22, 2013
1 parent eb52ee6 commit 4af186b
Showing 1 changed file with 1 addition and 29 deletions.
Expand Up @@ -26,7 +26,7 @@
*
* @author Rama Pulavarthi
*/
public class PortAllocator extends BuildWrapper implements ResourceActivity
public class PortAllocator extends BuildWrapper
{
private static final Log log = LogFactory.getLog(PortAllocator.class);

Expand Down Expand Up @@ -83,34 +83,6 @@ public boolean tearDown(AbstractBuild build, BuildListener listener) throws IOEx
};
}

public ResourceList getResourceList() {
ResourceList resourceList = new ResourceList();
for (PortType portType : ports) {
if (portType instanceof PooledPortType) {
try {
addResource(resourceList, (PooledPortType) portType, DESCRIPTOR.getPoolSize(portType.name));
} catch (PoolNotDefinedException e) {
log.warn("Unable to add resource", e);
}
} else {
addResource(resourceList, portType, 1);
}
}
return resourceList;
}

private void addResource(ResourceList resourceList, PooledPortType portType, int count) {
resourceList.w(
new Resource(null, "port pool " + portType.name, count)
);
}

private void addResource(ResourceList resourceList, PortType portType, int count) {
resourceList.w(
new Resource(null, "standalone port " + portType.name, count)
);
}

public String getDisplayName() {
return "Port exclusion";
}
Expand Down

0 comments on commit 4af186b

Please sign in to comment.