@ -4,6 +4,7 @@ package com.fr.start.module;
import com.fr.base.OptimizeUtil ;
import com.fr.base.OptimizeUtil ;
import com.fr.concurrent.NamedThreadFactory ;
import com.fr.concurrent.NamedThreadFactory ;
import com.fr.config.dao.DaoSelectorFactory ;
import com.fr.config.dao.DaoSelectorFactory ;
import com.fr.config.dao.PropertiesConstants ;
import com.fr.decision.webservice.v10.encryption.EncryptionConstants ;
import com.fr.decision.webservice.v10.encryption.EncryptionConstants ;
import com.fr.design.DesignerEnvManager ;
import com.fr.design.DesignerEnvManager ;
import com.fr.design.RestartHelper ;
import com.fr.design.RestartHelper ;
@ -157,15 +158,28 @@ public class DesignerStartup extends Activator {
if ( info . getType ( ) = = DesignerWorkspaceType . Remote ) {
if ( info . getType ( ) = = DesignerWorkspaceType . Remote ) {
DaoSelectorFactory . registerDaoSelector ( ( ) - > false ) ;
DaoSelectorFactory . registerDaoSelector ( ( ) - > false ) ;
} else {
} else {
String dbConfigPath = StableUtils . pathJoin ( WorkspaceUtils . getWorkspaceInfo ( ) . getPath ( ) , ProjectConstants . CONFIG_DIRECTORY ,
String webInfPath = WorkspaceUtils . getWorkspaceInfo ( ) . getPath ( ) ;
String dbConfigPath = StableUtils . pathJoin ( webInfPath , ProjectConstants . CONFIG_DIRECTORY ,
EncryptionConstants . PROPERTY_NAME ) ;
EncryptionConstants . PROPERTY_NAME ) ;
//
String entityPath = generatePath ( webInfPath , PropertiesConstants . ENTITY_PROP ) ;
String xmlEntityPath = generatePath ( webInfPath , PropertiesConstants . XML_ENTITY_PROP ) ;
String classNamePath = generatePath ( webInfPath , PropertiesConstants . CLASS_NAME_PROP ) ;
// 校验 平台迁移文件/缓存文件
boolean existPropCache = new File ( entityPath ) . exists ( ) & & new File ( xmlEntityPath ) . exists ( ) & & new File ( classNamePath ) . exists ( ) ;
DaoSelectorFactory . registerDaoSelector ( ( ) - > DesignerEnvManager . getEnvManager ( ) . isPropertiesUsable ( )
DaoSelectorFactory . registerDaoSelector ( ( ) - > DesignerEnvManager . getEnvManager ( ) . isPropertiesUsable ( )
& & OptimizeUtil . isOpen ( )
& & OptimizeUtil . isOpen ( )
& & existPropCache
& & ! new File ( dbConfigPath ) . exists ( ) ) ;
& & ! new File ( dbConfigPath ) . exists ( ) ) ;
}
}
}
}
private String generatePath ( String webInfPath , String name ) {
return StableUtils . pathJoin ( webInfPath , ProjectConstants . EMBED_DB_DIRECTORY ,
ProjectConstants . PROPERTIES_CACHE_FOR_CONFIG , name ) ;
}
@Override
@Override
public void stop ( ) {
public void stop ( ) {
// void
// void