private void doBrowserPopup() { Boolean popupBrowser = CarbonServer32Utils.isServerStartBrowserPopup(getServer()); if (popupBrowser != null && popupBrowser) { CarbonUploadServiceRequestUtil uoloadServiceRequestUtil = CarbonUploadServiceRequestUtil.getInstance(); uoloadServiceRequestUtil.popupExternalBrowser( CommonOperations.getLocalServerPort(getServer()) + CarbonServer32Utils.getWebContextRoot(getServer()) + "/carbon"); } }
protected String[] getPingURLList() { try { setServerisStillStarting(true); String url = "http://" + getServer().getHost(); List<String> urls = new ArrayList<String>(); ServerPort[] ports = getServerPorts(getServer()); ServerPort sp = null; int port = 0; int offSet = 0; for (int i = 0; i < ports.length; i++) { int j = CarbonServerConstants.PORT_CAPTIONS.indexOf(ports[i].getName()); if (j != -1 && CarbonServerConstants.PORT_IDS.get(j).equals("carbon.http")) { sp = ports[i]; port = sp.getPort(); } else if (j != -1 && CarbonServerConstants.PORT_IDS.get(j).equals("carbon.offset")) { sp = ports[i]; offSet = sp.getPort(); } } String newUrl = url; if (port != 80) { newUrl = newUrl + ":" + (port + offSet); // $NON-NLS-1$ } newUrl = newUrl + CarbonServer32Utils.getWebContextRoot(getServer()) + "/carbon"; urls.add(newUrl); return urls.toArray(new String[] {}); } catch (Exception e) { Trace.trace(Trace.SEVERE, "Can't ping for server startup."); } return null; }
protected String getVmArguments() { String vmArguments = super.getVmArguments(); Boolean enableOSGIConsole = CarbonServer32Utils.isServerStartWithOSGiConsole(getServer()); if (enableOSGIConsole != null && enableOSGIConsole) { vmArguments = vmArguments + " -DosgiConsole"; } return vmArguments; }
protected void addServletTransportPorts(List<Integer> ports, String carbonXmlPath) { int port = 0; XPathFactory factory = XPathFactory.newInstance(); NamespaceContext cntx = CarbonServer32Utils.getCarbonNamespace(); File xmlDocument = new File(carbonXmlPath); try { InputSource inputSource = new InputSource(new FileInputStream(xmlDocument)); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document document = builder.parse(xmlDocument); XPath xPath = factory.newXPath(); xPath.setNamespaceContext(cntx); int offSet = Integer.parseInt( (String) xPath.evaluate("/Server/Ports/Offset", document, XPathConstants.STRING)); String evaluate = (String) xPath.evaluate( "/Server/Ports/ServletTransports/HTTPS", document, XPathConstants.STRING); if (!evaluate.equals("")) { port = Integer.parseInt(evaluate) + offSet; } else { port = getPortfromTransportXML("https"); } ports.add(port); inputSource = new InputSource(new FileInputStream(xmlDocument)); evaluate = (String) xPath.evaluate( "/Server/Ports/ServletTransports/HTTP", document, XPathConstants.STRING); if (!evaluate.equals("")) { port = Integer.parseInt(evaluate) + offSet; } else { port = getPortfromTransportXML("http"); } ports.add(port); } catch (NumberFormatException e) { log.error(e); } catch (FileNotFoundException e) { log.error(e); } catch (XPathExpressionException e) { log.error(e); } catch (ParserConfigurationException e) { log.error(e); } catch (SAXException e) { log.error(e); } catch (IOException e) { log.error(e); } }
protected String getAxis2FilePath() { return CarbonServer32Utils.getAxis2FilePath(getServer()); }
protected String getTransportXmlFilePath() { IPath serverHome = CarbonServerManager.getServerHome(getServer()); String transportsXmlPath = CarbonServer32Utils.getTransportsXmlPathFromLocalWorkspaceRepo(serverHome.toOSString()); return transportsXmlPath; }
protected String getCarbonXmlFilePath() { IPath serverHome = CarbonServerManager.getServerHome(getServer()); return CarbonServer32Utils.getServerXmlPathFromLocalWorkspaceRepo(serverHome.toOSString()); }