String strPollingInterval =null ;
long pollingInterval;
boolean verifyEnabled=false ;
boolean preJspCompilation=false ;
DasConfig dasConfig = null;
try {
//domain = (Domain)confContext.getRootConfigBean();
//Config config = ServerBeansFactory.getConfigBean(confContext);
//if(config != null)
// as = config.getAdminService();
dasConfig = ServerBeansFactory.getDasConfigBean(confContext);
}catch (Exception ce){
sLogger.log(Level.SEVERE, "enterprise.deployment.backend.autoDeploymentStartFailure");
throw new AutoDeploymentException("Failed to start autodeploy", ce);
}
// targetConfigurationName= getTargetConfigName(domain);
//read target configuration
/* if(targetConfigurationName !=null && !targetConfigurationName.trim().equals("")){
Config config = domain.getConfigs().getConfigByName(targetConfigurationName);
if(config !=null){
//get appconfig specific to targetConfigurationName
//ApplicationConfig appConfig= config.getApplicationConfig();
*/
if(dasConfig != null) {
boolean autodeployEnabled=dasConfig.isAutodeployEnabled();
if(autodeployEnabled){
autoDeployDir=dasConfig.getAutodeployDir() ;
if(autoDeployDir != null) {
try {
autoDeployDir = new PropertyResolver(confContext,
context.getInstanceName()).
resolve(autoDeployDir);
autoDeployDir=autoDeployDir.trim();
} catch (ConfigException ce) {
//log
autoDeployDir = null;
}
}
if(autoDeployDir == null || "".equals(autoDeployDir)) {
//empty path so putting default
autoDeployDir = AutoDeployConstants.DEFAULT_AUTODEPLOY_DIR;
sourcedir= context.getInstanceEnvironment().getAutoDeployDirPath()+File.separator+autoDeployDir;
String msg = localStrings.getString("enterprise.deployment.autodeploy.invalid_source_dir_shifting_to_default",sourcedir);
sLogger.log(Level.WARNING, msg);
} else if((new File(autoDeployDir)).isAbsolute()) {
//absolute path
sourcedir=autoDeployDir;
} else {
//relative path
sourcedir= context.getInstanceEnvironment().getAutoDeployDirPath()+File.separator+autoDeployDir;
}
strPollingInterval = dasConfig.getAutodeployPollingIntervalInSeconds();
verifyEnabled=dasConfig.isAutodeployVerifierEnabled() ;
preJspCompilation=dasConfig.isAutodeployJspPrecompilationEnabled() ;
try {
try {
pollingInterval= Long.parseLong(strPollingInterval) ;
if(pollingInterval < AutoDeployConstants.MIN_POOLING_INTERVAL) {
String msg = localStrings.getString("enterprise.deployment.autodeploy.invalid_pooling_interval_shifting_to_default",strPollingInterval,AutoDeployConstants.MIN_POOLING_INTERVAL+"",AutoDeployConstants.DEFAULT_POLLING_INTERVAL+"");