if(ephemeris != null)
return true;
try {
ServiceLoader<EphemerisFactory> factLoader
= ServiceLoader.load(EphemerisFactory.class);
EphemerisFactory fact = null;
for (EphemerisFactory aFact : factLoader) {
fact = aFact;
break;
}
if(fact == null) {
LOG.log(Level.SEVERE, null, new ClassNotFoundException());
return false;
}
LOG.fine("Found service: " + fact.getClass().getName());
LOG.info("Ephemeris: " + fact.getLongName());
ephemeris = fact.getEphemeris();
return true;
} catch(ServiceConfigurationError ex) {
LOG.log(Level.SEVERE, null, ex);
return false;
}