private void initMappings() { if (initializing.compareAndSet(false, true)) { try { loadCustomMappings(); eventManager = new DozerEventManager(eventListeners); } catch (RuntimeException e) { // reset initialized state if error happens initializing.set(false); throw e; } finally { ready.countDown(); } } try { ready.await(); } catch (InterruptedException e) { log.error("Thread interrupted: ", e); // Restore the interrupted status: Thread.currentThread().interrupt(); } }
protected Mapper getMappingProcessor() { log.info("OpenL Mapper Framework v. 1.1.13-SNAPSHOT (Dozer 5.3.2)"); if (initializing.compareAndSet(false, true)) { try { loadCustomMappings(); eventManager = new DozerEventManager(eventListeners); } finally { ready.countDown(); } } try { ready.await(); } catch (InterruptedException e) { log.error("Thread interrupted: ", e); } Mapper processor = new MappingProcessor(customMappings, globalConfiguration, cacheManager, statsMgr, customConverters, eventManager, getCustomFieldMapper(), customConvertersWithId, mappingConditions, mappingConditionsWithId, collectionItemDiscriminators, collectionItemDiscriminatorsWithId); // If statistics are enabled, then Proxy the processor with a statistics // interceptor if (statsMgr.isStatisticsEnabled()) { processor = (Mapper) Proxy.newProxyInstance(processor.getClass().getClassLoader(), processor.getClass() .getInterfaces(), new StatisticsInterceptor(processor, statsMgr)); } return processor; }
log.info("OpenL Mapper Framework (Dozer 5.3.2)"); loadCustomMappings(); eventManager = new DozerEventManager(eventListeners); } finally { ready.countDown();