public static File getLocatorInfoFile(File directory) { return getManagerInfoFile(directory, true); }
public static File setLocatorStarting(File directory, int port, InetAddress bindAddress) { if (ManagerInfo.isManagerRunning(directory, true)) { throw new SystemIsRunningException(String.format("%s %s is already running.", new Object[] {"Locator", directory.getPath()})); } File result = getManagerInfoFile(directory, true); ManagerInfo.saveManagerInfo(OSProcess.getId(), STARTING_STATUS_CODE, directory, port, bindAddress); return result; }
/** * Saves the manager information to the info file in the given <code>directory</code>. * * @param pid the process id of the manager VM. * @param status the status of the manager * @param directory the manager's directory. * @param port the tcp/ip port for the locator * @param bindAddress the tcp/ip address for the locator * @throws GemFireIOException if the file could not be written. */ private static void saveManagerInfo(int pid, int status, File directory, int port, InetAddress bindAddress) { ManagerInfo info = new ManagerInfo(pid, status, port, bindAddress); File infoFile = getManagerInfoFile(directory, true); try { FileOutputStream ostream = new FileOutputStream(infoFile); DataOutputStream dos = new DataOutputStream(ostream); DataSerializer.writeObject(info, dos); ostream.close(); } catch (IOException io) { throw new GemFireIOException( String.format("Could not write file %s.", infoFile), io); } }
directory.getPath())); File infoFile = getManagerInfoFile(directory, locator); if (!infoFile.exists()) { throw new UnstartedSystemException(String.format("The info file %s does not exist.",