@Override public String getId() { return yard.getId(); }
@Override public String getId() { return yard.getId(); }
@Override public String getDescription() { return String.format("Cache Wrapper for Yard %s ", yard.getId()); }
@Override public String getDescription() { return String.format("Cache Wrapper for Yard %s ", yard.getId()); }
protected void bindYard(Yard yard){ if(yard != null){ Map<String, Yard> tmp = new HashMap<String, Yard>(yards); tmp.put(yard.getId(),yard); this.yards = Collections.unmodifiableMap(tmp); } } protected void unbindYard(Yard yard){
protected void bindYard(Yard yard){ if(yard != null){ Map<String, Yard> tmp = new HashMap<String, Yard>(yards); tmp.put(yard.getId(),yard); this.yards = Collections.unmodifiableMap(tmp); } } protected void unbindYard(Yard yard){
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())); } }
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())); } }
@Test public void testYardId() { assertNotNull("The ID of the Yard MUST NOT be NULL", getYard().getId()); }
String.format(errorMsg,entry.getItem().getId(),yard.getId()), yardException);
String.format(errorMsg,entry.getItem().getId(),yard.getId()), yardException);
log.info("Replace Additional Mappings for Cache {} with Mappings configured by OSGI",yard.getId()); setAdditionalMappings(yard, configuredMappings);
log.info("Replace Additional Mappings for Cache {} with Mappings configured by OSGI",yard.getId()); setAdditionalMappings(yard, configuredMappings);