use of org.pentaho.versionchecker.BasicVersionCheckerProvider in project pentaho-kettle by pentaho.
the class VersionCheckerListener method onStart.
/**
* Interface method: checks the version
*/
public void onStart(final LifeEventHandler handler) throws LifecycleException {
// Should we run this listener?
String prop = Props.getInstance().getProperty(PDI_CHECK_VERSION_FLAG);
if (prop != null && !Boolean.parseBoolean(prop)) {
log.logBasic("Skipping version check.", new Object[] {});
return;
}
try {
// check to see if pentaho version checker is in the classpath
//
Class.forName("org.pentaho.versionchecker.BasicVersionCheckerProvider");
} catch (ClassNotFoundException e) {
return;
}
Runnable r = new Runnable() {
public void run() {
final BasicVersionCheckerProvider dataProvider = new BasicVersionCheckerProvider(Spoon.class);
VersionChecker vc = new VersionChecker();
vc.setDataProvider(dataProvider);
vc.addResultHandler(new IVersionCheckResultHandler() {
public void processResults(String result) {
}
});
vc.addErrorHandler(new IVersionCheckErrorHandler() {
public void handleException(Exception e) {
root = new LifecycleException(e, false);
}
});
vc.performCheck(false);
if (root != null)
return;
}
};
new Thread(r).start();
}
Aggregations