@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
private static final String HOST_NAME = "127.0.0.1" ;
private static final String HOST_NAME = "127.0.0.1" ;
private static final String LOCAL_HOTS_NAME = "localhost" ;
private static final String LOCAL_HOTS_NAME = "localhost" ;
private static final String QUOTATION = ":" ;
private static final String QUOTATION = ":" ;
private static final String PORT = Integer . toString ( DesignerEnvManager . getEnvManager ( ) . getEmbedServerPort ( ) ) ;
private static String port = Integer . toString ( DesignerEnvManager . getEnvManager ( ) . getEmbedServerPort ( ) ) ;
static {
static {
FILTER_SET . add ( HTTP + HOST_NAME + QUOTATION + PORT + PATH ) ;
initFilerSet ( port ) ;
FILTER_SET . add ( HTTPS + HOST_NAME + QUOTATION + PORT + PATH ) ;
}
FILTER_SET . add ( HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH ) ;
FILTER_SET . add ( HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH ) ;
private static void initFilerSet ( String newPort ) {
FILTER_SET . clear ( ) ;
FILTER_SET . add ( HTTP + HOST_NAME + QUOTATION + newPort + PATH ) ;
FILTER_SET . add ( HTTPS + HOST_NAME + QUOTATION + newPort + PATH ) ;
FILTER_SET . add ( HTTP + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH ) ;
FILTER_SET . add ( HTTPS + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH ) ;
port = newPort ;
}
}
private String name ;
private String name ;
@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
@Override
@Override
public boolean checkValid ( ) {
public boolean checkValid ( ) {
boolean result = false ;
boolean result = false ;
String newPort = Integer . toString ( DesignerEnvManager . getEnvManager ( ) . getEmbedServerPort ( ) ) ;
if ( ! ComparatorUtils . equals ( port , newPort ) ) {
// 使用过程中 更改了内置服务器端口 重新初始化下
initFilerSet ( newPort ) ;
}
if ( FILTER_SET . contains ( connection . getUrl ( ) ) ) {
if ( FILTER_SET . contains ( connection . getUrl ( ) ) ) {
FineLoggerFactory . getLogger ( ) . error ( "url is same with local designer" ) ;
FineLoggerFactory . getLogger ( ) . error ( "url is same with local designer" ) ;
return result ;
return result ;