org.mule.tck.junit4.rule
Class FreePortFinder

java.lang.Object
  extended by org.mule.tck.junit4.rule.FreePortFinder

public class FreePortFinder
extends Object

Finds available port numbers in a specified range.


Field Summary
protected  Log logger
           
 
Constructor Summary
FreePortFinder(int minPortNumber, int maxPortNumber)
           
 
Method Summary
 Integer find()
           
 boolean isPortFree(int port)
          Check and log is a given port is available
 void releasePort(int port)
          Indicates that the port is free from the point of view of the caller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Constructor Detail

FreePortFinder

public FreePortFinder(int minPortNumber,
                      int maxPortNumber)
Method Detail

find

public Integer find()

releasePort

public void releasePort(int port)
Indicates that the port is free from the point of view of the caller.

Checks that the port was released, if it was not, then it would be marked as in use, so no other client receives the same port again.

Parameters:
port - the port number to release.

isPortFree

public boolean isPortFree(int port)
Check and log is a given port is available

Parameters:
port - the port number to check
Returns:
true if the port is available, false otherwise


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.