private boolean isRunning(File nodeDirChild, String serverName) throws CommandException { try { File serverDir = new File(nodeDirChild, serverName); File configDir = new File(serverDir, "config"); File domainXml = new File(configDir, "domain.xml"); if (!domainXml.exists()) return false; MiniXmlParser parser = new MiniXmlParser(domainXml, serverName); List<HostAndPort> addrSet = parser.getAdminAddresses(); if (addrSet.size() <= 0) throw new CommandException(strings.get("NoAdminPort")); HostAndPort addr = addrSet.get(0); return isRunning(addr.getHost(), addr.getPort()); } catch (MiniXmlParserException ex) { throw new CommandException(strings.get("NoAdminPortEx", ex), ex); } }
/** * Returns the admin address of a particular server. Note that this method * should be called only when you own the server that is available on * an accessible file system. * * @return HostAndPort object with admin server address * @throws CommandException in case of parsing errors */ protected final HostAndPort getAdminAddress(String serverName) throws CommandException { try { MiniXmlParser parser = new MiniXmlParser(getDomainXml(), serverName); List<HostAndPort> addrSet = parser.getAdminAddresses(); if (addrSet.size() > 0) return addrSet.get(0); else throw new CommandException(strings.get("NoAdminPort")); } catch (MiniXmlParserException ex) { throw new CommandException(strings.get("NoAdminPortEx", ex), ex); } }
/** * Returns the admin address of a particular server. Note that this method * should be called only when you own the server that is available on * an accessible file system. * * @return HostAndPort object with admin server address * @throws CommandException in case of parsing errors */ protected final HostAndPort getAdminAddress(String serverName) throws CommandException { try { MiniXmlParser parser = new MiniXmlParser(getDomainXml(), serverName); List<HostAndPort> addrSet = parser.getAdminAddresses(); if (addrSet.size() > 0) return addrSet.get(0); else throw new CommandException(strings.get("NoAdminPort")); } catch (MiniXmlParserException ex) { throw new CommandException(strings.get("NoAdminPortEx", ex), ex); } }
info.setAdminAddresses(parser.getAdminAddresses()); File logFile = new File(dom, "logs"); logFile = new File(logFile, "server.log");
info.setDomainName(domainName); info.setAdminAddresses(parser.getAdminAddresses()); javaConfig = new JavaConfig(parser.getJavaConfig()); setupProfilerAndJvmOptions(parser);