public class PortUtils
extends java.lang.Object
| Constructor and Description |
|---|
PortUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
findPort(org.springframework.beans.factory.BeanFactory beanFactory)
Note: springboot 1.x version has been made compatible.
|
static java.lang.Integer |
getPort()
get the current tomcat port number.
|
public static int findPort(org.springframework.beans.factory.BeanFactory beanFactory)
org.springframework.boot.context.embedded.AbstractConfigurableEmbeddedServletContainer#getPort()
for springboot 1.x;
Note: see org.springframework.boot.web.server.AbstractConfigurableWebServerFactory#getPort()
for springboot 2.xbeanFactory - beanFactoryorg.apache.shenyu.common.exception.ShenyuException - when can not find portpublic static java.lang.Integer getPort()
throws java.lang.Exception
java.lang.Exception - when failed to get portCopyright © 2023 The Apache Software Foundation. All rights reserved.