private ServerPort getHttpPort(ServerPort[] ports) { for (int i = 0; i < ports.length; i++) { String protocol = ports[i].getProtocol(); if ( protocol != null && protocol.trim().toLowerCase().equals("http")) return ports[i]; } return null; } }
/** * Return the port number. * @return int */ public ServerPort getMainPort() { Iterator iterator = getServerPorts().iterator(); while (iterator.hasNext()) { ServerPort port = (ServerPort) iterator.next(); // Return only an HTTP port from the selected Service if (port.getProtocol().toLowerCase().equals("http") && port.getId().indexOf('/') < 0) return port; } return null; }
/** * Return the port number. * @return int */ public ServerPort getMainPort() { Iterator iterator = getServerPorts().iterator(); while (iterator.hasNext()) { ServerPort port = (ServerPort) iterator.next(); // Return only an HTTP port from the selected Service if (port.getProtocol().toLowerCase().equals("http") && port.getId().indexOf('/') < 0) return port; } return null; }
/** * Return the port number. * @return int */ public ServerPort getMainPort() { Iterator iterator = getServerPorts().iterator(); while (iterator.hasNext()) { ServerPort port = (ServerPort) iterator.next(); // Return only an HTTP port from the selected Service if (port.getProtocol().toLowerCase().equals("http") && port.getId().indexOf('/') < 0) return port; } return null; }
if ("HTTP".equals(port.getProtocol())) { httpPort = port.getPort(); if (httpPort==0) {
public int startMonitoring(IServer server, ServerPort port, int monitorPort) throws CoreException { try { IMonitor monitor = (IMonitor) monitors.get(port); int mport = -1; if (monitor == null) { mport = monitorPort; if (mport == -1) mport = SocketUtil.findUnusedPort(5000, 15000); // should search for a monitor first .. IMonitorWorkingCopy wc = MonitorCore.createMonitor(); wc.setLocalPort(mport); wc.setRemoteHost(server.getHost()); wc.setRemotePort(port.getPort()); if ("HTTP".equals(port.getProtocol())) wc.setProtocol("HTTP"); monitor = wc.save(); addListener(); } else mport = monitor.getLocalPort(); monitor.start(); monitors.put(port, monitor); return mport; } catch (Exception e) { Trace.trace(Trace.SEVERE, "Could not start monitoring", e); throw new CoreException(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorStartingMonitor, e.getLocalizedMessage()), null)); } }