public void getValues ( ) { containsPortInfo = false ; if ( lock == null ) { // Not locked, remain ignorant about port file contents. return ; } try { if ( rwfile . length ( ) > 0 ) { rwfile . seek ( 0 ) ; int nr = rwfile . readInt ( ) ; serverPort = rwfile . readInt ( ) ; serverCookie = rwfile . readLong ( ) ; if ( nr == magicNr ) { containsPortInfo = true ; } else { containsPortInfo = false ; } } } catch ( IOException e ) { containsPortInfo = false ; } }
Read the values from the port file in the file system . Expects the port file to be locked .