Package org.pentaho.platform.settings
Class PortFileManager
java.lang.Object
org.pentaho.platform.settings.PortFileManager
PortFileManager is a singleton that saves the ports in use and creates a file with a ports list when requested.
- Author:
- Joao L. M. Pereira
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a new used portvoid
clear()
Used for testing, simulates a new JVMstatic PortFileManager
Returns the PortFileManager instance, if it does not exists, creates a new oneboolean
removePort
(Integer port) Removes a used portvoid
writeUsedPortFile
(String filePath) Writes a port list delimited by comma into a specified file
-
Method Details
-
getInstance
Returns the PortFileManager instance, if it does not exists, creates a new one- Returns:
- the PortFileManager instance, it is a singleton
-
addPort
Add a new used port- Parameters:
port
- a port being used- Returns:
- true, if the port did not exist before
-
removePort
Removes a used port- Parameters:
port
- a port that was used, not anymore- Returns:
- true, if the port exist before
-
writeUsedPortFile
Writes a port list delimited by comma into a specified file- Parameters:
filePath
- Path for the file to be written- Throws:
FileNotFoundException
IOException
-
clear
public void clear()Used for testing, simulates a new JVM
-