}
@Override
protected void mergeChilds(Device prev, Device device, String deviceDN)
throws NamingException {
ImageWriterExtension prevExt =
prev.getDeviceExtension(ImageWriterExtension.class);
ImageWriterExtension ext =
device.getDeviceExtension(ImageWriterExtension.class);
if (ext == null) {
if (prevExt != null)
config.destroySubcontextWithChilds(CN_IMAGE_READER_FACTORY + deviceDN);
return;
}
if (prevExt == null) {
store(deviceDN, ext.getImageWriterFactory());
return;
}
String imageWritersDN = CN_IMAGE_READER_FACTORY + deviceDN;
ImageWriterFactory factory = ext.getImageWriterFactory();
ImageWriterFactory prevFactory = prevExt.getImageWriterFactory();
for (Entry<String, ImageWriterParam> entry : prevFactory.getEntries()) {
String tsuid = entry.getKey();
if (factory.get(tsuid) == null)
config.destroySubcontext(dnOf(tsuid, imageWritersDN));