}
public void testAvailability(ModuleRegistry reg) throws ModuleAvailabilityException {
WGACore core = (WGACore) reg.getContextObjects().get(WGACore.class);
if (core == null) {
throw new ModuleAvailabilityException("Cannot retrieve WGACore to test availability");
}
boolean pluginFound = false;
for (WGAPlugin plugin : core.getPluginSet().getPlugins()) {
if (plugin.isActive() && plugin.isValid() && plugin.getCsConfig().getPluginConfig().isUsageAsAuthSource()) {
pluginFound = true;
break;
}
}
if (!pluginFound) {
throw new ModuleAvailabilityException("No installed WGA Plugin offers authentication services");
}
}