public void execute(ActionMessagePrinter printer)
throws CmdLineActionException {
try {
Validate.notNull(beanRepo, "Must specify beanRepo");
FileSystemXmlApplicationContext repoAppContext =
new FileSystemXmlApplicationContext(
new String[] { this.beanRepo }, false);
repoAppContext.setClassLoader(new Serializer().getClassLoader());
repoAppContext.refresh();
@SuppressWarnings("unchecked")
Map<String, Catalog> catalogs = repoAppContext
.getBeansOfType(Catalog.class);
for (Catalog catalog : catalogs.values()) {
printer.println("Adding catalog: " + catalog.getId());
getClient().addCatalog(catalog);
}