Skip to content

Commit 7cdb658

Browse files
Check for WOPort property, use 1200 if not present
1 parent a976033 commit 7cdb658

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ng-adaptor-jetty/src/main/java/ng/adaptor/jetty/NGAdaptorJetty.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,23 @@ public class NGAdaptorJetty extends NGAdaptor {
4343

4444
private NGApplication _application;
4545

46+
/**
47+
* Port used if no port number is specified in properties
48+
*
49+
* FIXME: This should be a default for all adaptors // Hugi 2021-12-31
50+
*/
51+
private static final int DEFAULT_PORT_NUMBER = 1200;
52+
4653
@Override
4754
public void start( NGApplication application ) {
4855
_application = application;
4956

50-
final int port = 1200;
57+
Integer port = application.properties().d().propWOPort(); // FIXME: Ugly way to get the port number
58+
59+
if( port == null ) {
60+
logger.warn( "port property is not set, defaulting to port {}", DEFAULT_PORT_NUMBER );
61+
port = DEFAULT_PORT_NUMBER;
62+
}
5163

5264
final Server server = new Server();
5365

0 commit comments

Comments
 (0)