@ -103,15 +103,16 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
}
}
}
}
private String getLocalPort ( Connector connector ) {
private Integer getLocalPort ( Connector connector ) {
try {
try {
// Jetty 9 internals are different, but the method name is the same
// Jetty 9 internals are different, but the method name is the same
return ( ( Integer ) ReflectionUtils . invokeMethod (
return ( Integer ) ReflectionUtils . invokeMethod (
ReflectionUtils . findMethod ( connector . getClass ( ) , "getLocalPort" ) ,
ReflectionUtils . findMethod ( connector . getClass ( ) , "getLocalPort" ) ,
connector ) ). toString ( ) ;
connector ) ;
}
}
catch ( Exception ex ) {
catch ( Exception ex ) {
return "could not determine port ( " + ex . getMessage ( ) + ")" ;
this . logger . info ( "could not determine port ( " + ex . getMessage ( ) + ")" ) ;
return 0 ;
}
}
}
}
@ -134,7 +135,7 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
Connector [ ] connectors = this . server . getConnectors ( ) ;
Connector [ ] connectors = this . server . getConnectors ( ) ;
for ( Connector connector : connectors ) {
for ( Connector connector : connectors ) {
// Probably only one...
// Probably only one...
return connector. getLocalPort( ) ;
return getLocalPort( connector ) ;
}
}
return 0 ;
return 0 ;
}
}