protected Mapper getMappingProcessor() { initMappings(); Mapper processor = new MappingProcessor(customMappings, globalConfiguration, cacheManager, statsMgr, customConverters, eventManager, getCustomFieldMapper(), customConvertersWithId); // 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; }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { long start = System.currentTimeMillis(); try { Object result = method.invoke(delegate, args); long stop = System.currentTimeMillis(); statsMgr.increment(StatisticType.MAPPING_SUCCESS_COUNT); statsMgr.increment(StatisticType.MAPPING_TIME, (stop - start)); return result; } catch (InvocationTargetException e) { Throwable ex = e.getTargetException(); statsMgr.increment(StatisticType.MAPPING_FAILURE_COUNT); Throwable rootCause = MappingUtils.getRootCause(ex); statsMgr.increment(StatisticType.MAPPING_FAILURE_EX_TYPE_COUNT, rootCause.getClass()); incrementClassMappingFailureTypeStat(args); throw ex; } }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { long start = System.currentTimeMillis(); try { Object result = method.invoke(delegate, args); long stop = System.currentTimeMillis(); statsMgr.increment(StatisticType.MAPPING_SUCCESS_COUNT); statsMgr.increment(StatisticType.MAPPING_TIME, (stop - start)); return result; } catch (InvocationTargetException e) { Throwable ex = e.getTargetException(); statsMgr.increment(StatisticType.MAPPING_FAILURE_COUNT); Throwable rootCause = MappingUtils.getRootCause(ex); statsMgr.increment(StatisticType.MAPPING_FAILURE_EX_TYPE_COUNT, rootCause.getClass()); incrementClassMappingFailureTypeStat(args); throw ex; } }
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; }
processor = (Mapper) Proxy.newProxyInstance(processor.getClass().getClassLoader(), processor.getClass().getInterfaces(), new StatisticsInterceptor(processor, statsMgr));