Methods Summary |
---|
public void | addAutoDeployDir(java.lang.String autodeployDir)add input source directory. to the list(Vector).
if(!validateDir(autodeployDir)) {
String msg = localStrings.getString("enterprise.deployment.autodeploy.invalid_source_dir",autodeployDir);
sLogger.log(Level.INFO, msg);
}
if((locateAlreadyExistingDir(autodeployDir)== -1)){
autodeployDirs.add(new File(autodeployDir));
} else {
String msg = localStrings.getString("enterprise.deployment.autodeploy.duplicate_source_dir",autodeployDir);
sLogger.log(Level.WARNING, msg);
//ignore, dir already exist
}
|
public boolean | disableAutoDeploy()stop/disable autodeployment thread.
if(deployTask!=null) {
deployTask.cancel();
}
if(timer!=null) {
timer.cancel();
}
String msg = localStrings.getString("enterprise.deployment.autodeploy.autoDeployment_service_disabled");
sLogger.log(Level.INFO, msg);
return true;
|
public boolean | enableAutoDeploy()start autodeployment.
timer = new Timer();
deployTask=new AutoDeployTask();
timer.schedule(deployTask,0,pollingInterval*1000);
String msg = localStrings.getString("enterprise.deployment.autodeploy.autoDeployment_service_enabled");
sLogger.log(Level.FINE, msg+System.currentTimeMillis());
return true;
|
public java.lang.String[] | getAllAutoDeployDirs()get all the input source directory.
if(autodeployDirs != null && ! autodeployDirs.isEmpty()) {
String[] dirs=new String[autodeployDirs.size()];
int i=0;
for (Enumeration list = autodeployDirs.elements() ; list.hasMoreElements() ;i++) {
dirs[i]=((File)list.nextElement()).getAbsolutePath();
}
return dirs;
}else {
return null;
}
|
public long | getPollingInterval()get polling duration.
return pollingInterval;
|
public boolean | isPreJspCompilationEnabled()is PreJspCompilation flag enabled or not. If enabled PreJspCompilation compilation ignored.
return preJspCompilation;
|
public boolean | isVerifyEnabled()is verify flag enabled or not. If enabled verification happnes before
every deployment.
return verify;
|
private int | locateAlreadyExistingDir(java.lang.String dir)
//return -1 if the vector autoDeployDirs dont have this dir
int location=-1;
String extingDirs[]=getAllAutoDeployDirs();
if(extingDirs!=null) {
for (int i=0; i<extingDirs.length ; i++) {
if(dir.equalsIgnoreCase(extingDirs[i])) {
location=i; //I got this dir in list
break;
}
}
}
return location;
|
public void | postAccessNotification(com.sun.enterprise.config.ConfigContextEvent ccce)Implement notification listner.
after config add, delete, set, update or flush. type is in ccce
//not implemented
|
public void | postChangeNotification(com.sun.enterprise.config.ConfigContextEvent ccce)Implement notification listner.
after config add, delete, set, update or flush. type is in ccce
//not implemented
|
public void | preAccessNotification(com.sun.enterprise.config.ConfigContextEvent ccce)Implement notification listner.
before config add, delete, set, update or flush. type is in ccce
//not implemented
|
public void | preChangeNotification(com.sun.enterprise.config.ConfigContextEvent ccce)Implement notification listner.
before config add, delete, set, update or flush. type is in ccce
//not implemented
|
public void | removeAutoDeployDir(java.lang.String autodeployDir)remove input source dir. from the list(Vector).
int location=locateAlreadyExistingDir(autodeployDir);
if(location>=0) {
this.autodeployDirs.remove(location);
}
|
public void | setPollingInterval(long pollInterval)set polling interval, polling interval can not be -ve. && more than
if(validatePollingInterval(pollInterval)) {
this.pollingInterval=pollInterval;
} else{
String sInterval= new String(""+pollInterval);
String sMinInterval= new String(""+AutoDeployConstants.MIN_POOLING_INTERVAL);
String msg = localStrings.getString("enterprise.deployment.autodeploy.invalid_pooling_interval", sInterval, sMinInterval);
sLogger.log(Level.INFO, msg+pollInterval);
throw new AutoDeploymentException(msg+pollInterval);
}
|
public void | setPreJspCompilation(boolean preJspCompilation)set PreJspCompilation flag.
this.preJspCompilation=preJspCompilation;
|
public void | setVerify(boolean verify)set verify flag.
this.verify=verify;
|
private boolean | validateDir(java.lang.String dir)
boolean valid=false;
File autodeployDir=new File(dir);
if(autodeployDir != null && autodeployDir.exists()
&& autodeployDir.isDirectory()&& autodeployDir.canWrite() &&
autodeployDir.canRead() /*&& (locateAlreadyExistingDir(dir)== -1)*/) {
valid=true;
}
return valid;
|
private boolean | validatePollingInterval(long time)
boolean valid=false;
if(time >= AutoDeployConstants.MIN_POOLING_INTERVAL) {
valid= true;
}
return valid;
|