protected MappingProcessor(ClassMappings classMappings, Configuration globalConfiguration, CacheManager cacheMgr, StatisticsManager statsMgr, List<CustomConverter> customConverterObjects, DozerEventManager eventManager, CustomFieldMapper customFieldMapper, Map<String, CustomConverter> customConverterObjectsWithId) { this.classMappings = classMappings; this.globalConfiguration = globalConfiguration; this.statsMgr = statsMgr; this.customConverterObjects = customConverterObjects; this.eventMgr = eventManager; this.customFieldMapper = customFieldMapper; this.converterByDestTypeCache = cacheMgr.getCache(DozerCacheType.CONVERTER_BY_DEST_TYPE.name()); this.superTypeCache = cacheMgr.getCache(DozerCacheType.SUPER_TYPE_CHECK.name()); this.customConverterObjectsWithId = customConverterObjectsWithId; }
public void addCache(String name, int maxElementsInMemory) { addCache(new DozerCache(name, maxElementsInMemory)); }
public synchronized void put(KeyType key, ValueType value) { if (key == null) { throw new IllegalArgumentException("Cache entry key cannot be null"); } CacheEntry<KeyType, ValueType> cacheEntry = new CacheEntry<KeyType, ValueType>(key, value); cacheMap.put(cacheEntry.getKey(), cacheEntry); }
public void addCache(Cache cache) { synchronized (cachesMap) { String name = cache.getName(); if (cacheExists(name)) { MappingUtils.throwMappingException("Cache already exists with name: " + name); } cachesMap.put(name, cache); } }
public static Object createKey(Class<?> destClass, Class<?> srcClass) { return new CacheKey(srcClass, destClass); }
public void clear() { cacheMap.clear(); }
public boolean containsKey(KeyType key) { return cacheMap.containsKey(key); }
public long getSize() { return cacheMap.size(); }
public Set<KeyType> keySet() { return cacheMap.keySet(); }
public Collection<CacheEntry<KeyType, ValueType>> getEntries() { return cacheMap.values(); }
public synchronized void put(KeyType key, ValueType value) { if (key == null) { throw new IllegalArgumentException("Cache entry key cannot be null"); } CacheEntry<KeyType, ValueType> cacheEntry = new CacheEntry<KeyType, ValueType>(key, value); cacheMap.put(cacheEntry.getKey(), cacheEntry); }
public void addCache(String name, int maxElementsInMemory) { addCache(new DozerCache(name, maxElementsInMemory)); }
public static Object createKey(Class<?> destClass, Class<?> srcClass, String mapId) { return new CacheKey(srcClass, destClass, mapId); }
public void clear() { cacheMap.clear(); }
public boolean containsKey(KeyType key) { return cacheMap.containsKey(key); }
public long getSize() { return cacheMap.size(); }
public Set<KeyType> keySet() { return cacheMap.keySet(); }
public static Object createKey(Class<?> destClass, Class<?> srcClass, String mapId) { return new CacheKey(srcClass, destClass, mapId); }