use of org.apache.stanbol.entityhub.core.site.CacheImpl in project stanbol by apache.
the class CacheComponent method updateServiceRegistration.
private synchronized void updateServiceRegistration(ComponentContext cc, Yard yard, String[] additionalMappings, NamespacePrefixService nsPrefixService) {
if (cacheRegistration != null) {
cacheRegistration.unregister();
cacheRegistration = null;
cache = null;
}
if (cc != null && yard != null) {
try {
cache = new CacheImpl(yard, additionalMappings, nsPrefixService);
} catch (YardException e) {
log.warn("Unable to init Cache for Yard '" + yard.getId() + "'!", e);
}
cacheRegistration = cc.getBundleContext().registerService(Cache.class.getName(), cache, OsgiUtils.copyConfig(cc.getProperties()));
}
}
Aggregations