use of org.eclipse.jst.server.generic.servertype.definition.Port in project webtools.servertools by eclipse.
the class GenericServer method getServerPorts.
/*
* (non-Javadoc)
*
* @see org.eclipse.wst.server.core.model.IMonitorableServer#getServerPorts()
*/
public org.eclipse.wst.server.core.ServerPort[] getServerPorts() {
List<ServerPort> ports = new ArrayList<ServerPort>();
Iterator pIter = this.getServerDefinition().getPort().iterator();
while (pIter.hasNext()) {
Port element = (Port) pIter.next();
int port = Integer.parseInt(getServerDefinition().getResolver().resolveProperties(element.getNo()));
// $NON-NLS-1$
ports.add(new ServerPort("server", element.getName(), port, element.getProtocol()));
}
return ports.toArray(new org.eclipse.wst.server.core.ServerPort[ports.size()]);
}
use of org.eclipse.jst.server.generic.servertype.definition.Port in project webtools.servertools by eclipse.
the class GenericServer method getHttpPort.
/**
* Return http port
* @return port
*/
protected int getHttpPort() {
int port = -1;
Iterator pIter = this.getServerDefinition().getPort().iterator();
while (pIter.hasNext()) {
Port aPort = (Port) pIter.next();
if (port == -1)
port = Integer.parseInt(getServerDefinition().getResolver().resolveProperties(aPort.getNo()));
else if (// $NON-NLS-1$
"http".equals(aPort.getProtocol()))
port = Integer.parseInt(aPort.getNo());
}
if (port == -1)
port = 8080;
return port;
}
use of org.eclipse.jst.server.generic.servertype.definition.Port in project webtools.servertools by eclipse.
the class ServerTypeDefinitionModelTest method testPort.
public void testPort() {
Port port = (Port) subject.getPort().get(0);
assertNotNull(port);
assertNotNull(port.getName());
assertTrue(port.getNo() != null && port.getNo().length() > 0);
assertTrue(port.getProtocol() != null && port.getProtocol().length() > 0);
}
Aggregations