private void parseHttpService() throws XMLStreamException, EndDocumentException { // cursor --> <http-service> in <config> // we are looking for the virtual server: "DEFAULT_ADMIN_VS_ID". // inside it will be a ref. to a listener. We get the port from the listener. // So -- squirrel away a copy of all the listeners and all the virt. servers -- //then post-process. // Load the collections with both kinds of elements' attributes while (true) { skipToButNotPast("http-service", "http-listener", "virtual-server"); String name = parser.getLocalName(); if ("http-listener".equals(name)) { listenerAttributes.add(parseAttributes()); } else if ("virtual-server".equals(name)) { vsAttributes.add(parseAttributes()); } else if ("http-service".equals(name)) { break; } } String[] listenerNames = getListenerNamesForVS(DEFAULT_ADMIN_VS_ID, vsAttributes); if (listenerNames == null || listenerNames.length == 0) { listenerNames = getListenerNamesForVS(DEFAULT_VS_ID, vsAttributes); //plan B } if (listenerNames == null || listenerNames.length <= 0) { return; // can not find ports } addPortsForListeners(listenerNames); }
private void read() throws XMLStreamException, EndDocumentException, FileNotFoundException { createParser(); getConfigRefName(); try { // this will fail if config is above servers in domain.xml! getConfig(); // might throw findOtherStuff(); } catch (EndDocumentException ex) { createParser(); skipRoot("domain"); getConfig(); findOtherStuff(); Logger.getLogger(MiniXmlParser.class.getName()).log( Level.FINE, strings.get("secondpass")); } finalTouches(); }
public List<HostAndPort> getAdminAddresses() { if (adminAddresses == null || adminAddresses.isEmpty()) { String[] listenerNames = getListenerNamesForVS(DEFAULT_ADMIN_VS_ID, vsAttributes); if (listenerNames == null || listenerNames.length == 0) { listenerNames = getListenerNamesForVS(DEFAULT_VS_ID, vsAttributes); //plan B } addPortsForListeners(listenerNames); } return adminAddresses; }
info.setup(); setupLogLevels(); MiniXmlParser parser = new MiniXmlParser(getInfo().getConfigFile(), getInfo().getInstanceName()); String domainName = parser.getDomainName(); if (GFLauncherUtils.ok(domainName)) { info.setDomainName(domainName); info.setAdminAddresses(parser.getAdminAddresses()); javaConfig = new JavaConfig(parser.getJavaConfig()); setupProfilerAndJvmOptions(parser); setupUpgradeSecurity(); Map<String, String> realmprops = parser.getAdminRealmProperties(); if (realmprops != null) { String classname = realmprops.get("classname"); secureAdminEnabled = parser.getSecureAdminEnabled(); sysPropsFromXml = parser.getSystemProperties(); asenvProps.put(INSTANCE_ROOT_PROPERTY, getInfo().getInstanceRootDir().getPath()); parser.setupConfigDir(getInfo().getConfigDir(), getInfo().getInstallDir()); setLogFilename(parser); resolveAllTokens(); needsAutoUpgrade = !parser.hasNetworkConfig(); needsManualUpgrade = !parser.hasDefaultConfig(); setupCalledByClients = true;
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); } }
for (String listenerName : listenerNames) { if (id.equals(listenerName)) { int port = getPort(atts.get("port")); if (port >= 0) { String addr = atts.get("address"); boolean secure = false; String protocol = atts.get("protocol"); atts = getProtocolByName(protocol); if (atts != null) { String sec = atts.get("security-enabled");
/** * 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); } }
public List<HostAndPort> getAdminAddresses() { if (adminAddresses == null || adminAddresses.isEmpty()) { String[] listenerNames = getListenerNamesForVS(DEFAULT_ADMIN_VS_ID, vsAttributes); if (listenerNames == null || listenerNames.length == 0) { listenerNames = getListenerNamesForVS(DEFAULT_VS_ID, vsAttributes); //plan B } addPortsForListeners(listenerNames); } return adminAddresses; }
for (String listenerName : listenerNames) { if (id.equals(listenerName)) { int port = getPort(atts.get("port")); if (port >= 0) { String addr = atts.get("address"); boolean secure = false; String protocol = atts.get("protocol"); atts = getProtocolByName(protocol); if (atts != null) { String sec = atts.get("security-enabled");
private void read() throws XMLStreamException, EndDocumentException, FileNotFoundException { createParser(); getConfigRefName(); try { // this will fail if config is above servers in domain.xml! getConfig(); // might throw findOtherStuff(); } catch (EndDocumentException ex) { createParser(); skipRoot("domain"); getConfig(); findOtherStuff(); Logger.getLogger(MiniXmlParser.class.getName()).log( Level.FINE, strings.get("secondpass")); } finalTouches(); }
/** * 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); } }
private void parseHttpService() throws XMLStreamException, EndDocumentException { // cursor --> <http-service> in <config> // we are looking for the virtual server: "DEFAULT_ADMIN_VS_ID". // inside it will be a ref. to a listener. We get the port from the listener. // So -- squirrel away a copy of all the listeners and all the virt. servers -- //then post-process. // Load the collections with both kinds of elements' attributes while (true) { skipToButNotPast("http-service", "http-listener", "virtual-server"); String name = parser.getLocalName(); if ("http-listener".equals(name)) { listenerAttributes.add(parseAttributes()); } else if ("virtual-server".equals(name)) { vsAttributes.add(parseAttributes()); } else if ("http-service".equals(name)) { break; } } String[] listenerNames = getListenerNamesForVS(DEFAULT_ADMIN_VS_ID, vsAttributes); if (listenerNames == null || listenerNames.length == 0) { listenerNames = getListenerNamesForVS(DEFAULT_VS_ID, vsAttributes); //plan B } if (listenerNames == null || listenerNames.length <= 0) { return; // can not find ports } addPortsForListeners(listenerNames); }
public List<HostAndPort> getAdminAddresses() { if (adminAddresses == null || adminAddresses.isEmpty()) { String[] listenerNames = getListenerNamesForVS(DEFAULT_ADMIN_VS_ID, vsAttributes); if (listenerNames == null || listenerNames.length == 0) { listenerNames = getListenerNamesForVS(DEFAULT_VS_ID, vsAttributes); //plan B } addPortsForListeners(listenerNames); } return adminAddresses; }
for (String listenerName : listenerNames) { if (id.equals(listenerName)) { int port = getPort(atts.get("port")); if (port >= 0) { String addr = atts.get("address"); boolean secure = false; String protocol = atts.get("protocol"); atts = getProtocolByName(protocol); if (atts != null) { String sec = atts.get("security-enabled");
private void read() throws XMLStreamException, EndDocumentException, FileNotFoundException { createParser(); getConfigRefName(); try { // this will fail if config is above servers in domain.xml! getConfig(); // might throw findOtherStuff(); } catch (EndDocumentException ex) { createParser(); skipRoot("domain"); getConfig(); findOtherStuff(); Logger.getLogger(MiniXmlParser.class.getName()).log( Level.FINE, strings.get("secondpass")); } finalTouches(); }
MiniXmlParser parser = new MiniXmlParser(dx, instanceName); info.setAdminAddresses(parser.getAdminAddresses()); File logFile = new File(dom, "logs"); logFile = new File(logFile, "server.log");
private void parseHttpService() throws XMLStreamException, EndDocumentException { // cursor --> <http-service> in <config> // we are looking for the virtual server: "DEFAULT_ADMIN_VS_ID". // inside it will be a ref. to a listener. We get the port from the listener. // So -- squirrel away a copy of all the listeners and all the virt. servers -- //then post-process. // Load the collections with both kinds of elements' attributes while (true) { skipToButNotPast("http-service", "http-listener", "virtual-server"); String name = parser.getLocalName(); if ("http-listener".equals(name)) { listenerAttributes.add(parseAttributes()); } else if ("virtual-server".equals(name)) { vsAttributes.add(parseAttributes()); } else if ("http-service".equals(name)) { break; } } String[] listenerNames = getListenerNamesForVS(DEFAULT_ADMIN_VS_ID, vsAttributes); if (listenerNames == null || listenerNames.length == 0) { listenerNames = getListenerNamesForVS(DEFAULT_VS_ID, vsAttributes); //plan B } if (listenerNames == null || listenerNames.length <= 0) { return; // can not find ports } addPortsForListeners(listenerNames); }