Search in sources :

Example 1 with CacheImpl

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()));
    }
}
Also used : YardException(org.apache.stanbol.entityhub.servicesapi.yard.YardException) CacheImpl(org.apache.stanbol.entityhub.core.site.CacheImpl)

Aggregations

CacheImpl (org.apache.stanbol.entityhub.core.site.CacheImpl)1 YardException (org.apache.stanbol.entityhub.servicesapi.yard.YardException)1