private void parseCache() { CacheNamespace cacheDomain = type.getAnnotation(CacheNamespace.class); if (cacheDomain != null) { Integer size = cacheDomain.size() == 0 ? null : cacheDomain.size(); Long flushInterval = cacheDomain.flushInterval() == 0 ? null : cacheDomain.flushInterval(); Properties props = convertToProperties(cacheDomain.properties()); assistant.useNewCache(cacheDomain.implementation(), cacheDomain.eviction(), flushInterval, size, cacheDomain.readWrite(), cacheDomain.blocking(), props); } }
private void parseCache() { CacheNamespace cacheDomain = type.getAnnotation(CacheNamespace.class); if (cacheDomain != null) { Integer size = cacheDomain.size() == 0 ? null : cacheDomain.size(); Long flushInterval = cacheDomain.flushInterval() == 0 ? null : cacheDomain.flushInterval(); assistant.useNewCache(cacheDomain.implementation(), cacheDomain.eviction(), flushInterval, size, cacheDomain.readWrite(), cacheDomain.blocking(), null); } }
protected TypeSpec.Builder makeClass(TypeElement clazzElement, RedisMapperProperties properties) { TypeSpec.Builder clazzBuilder = TypeSpec.interfaceBuilder(clazzElement.getSimpleName().toString() + STAFF) .addModifiers(Modifier.PUBLIC); clazzBuilder.addAnnotation(Mapper.class); if (!checkXMLFileExist(clazzElement)) { AnnotationSpec cacheAnnotation = AnnotationSpec.builder(CacheNamespace.class) .addMember("flushInterval", "$L", properties.getFlushInterval()) .addMember("implementation", "$L.class", properties.getImplementation()) .addMember("eviction", "$L.class", properties.getEviction()) .addMember("size", "$L", properties.getSize()) .addMember("readWrite", "$L", properties.isReadWrite()) .addMember("blocking", "$L", properties.isBlocking()) .build(); clazzBuilder.addAnnotation(cacheAnnotation); for (TypeMirror interfaceClass : clazzElement.getInterfaces()) { clazzBuilder.addSuperinterface(TypeName.get(interfaceClass)); } clazzBuilder.addSuperinterface(TypeName.get(clazzElement.asType())); } else { updateXML(clazzElement, properties); } return clazzBuilder; }