- protected void publish(String alias, Repository repository,
- Properties properties) {
+ @Override
+ protected Repository getRepositoryByAlias(String alias) {
+ try {
+ Collection<ServiceReference<Repository>> srs = bundleContext.getServiceReferences(Repository.class,
+ "(" + JCR_REPOSITORY_ALIAS + "=" + alias + ")");
+ if (srs.size() == 0)
+ throw new ArgeoJcrException("No repository with alias " + alias + " found in OSGi registry");
+ else if (srs.size() > 1)
+ throw new ArgeoJcrException(
+ srs.size() + " repositories with alias " + alias + " found in OSGi registry");
+ return bundleContext.getService(srs.iterator().next());
+ } catch (InvalidSyntaxException e) {
+ throw new ArgeoJcrException("Cannot find repository with alias " + alias, e);
+ }
+ }
+
+ protected void publish(String alias, Repository repository, Properties properties) {