public SearchableCacheConfiguration(Class<?>[] classArray, Properties properties, EmbeddedCacheManager uninitializedCacheManager, ComponentRegistry cr) { this.providedServices = initializeProvidedServices(uninitializedCacheManager, cr); if (properties == null) { this.properties = new Properties(); } else { this.properties = augment(properties); } classes = new HashMap<>(); for (Class<?> c : classArray) { String classname = c.getName(); classes.put(classname, c); } if (hasAffinity) { ErrorHandler configuredErrorHandler = ErrorHandlerFactory.createErrorHandler(this); this.properties.put(Environment.ERROR_HANDLER, new AffinityErrorHandler(configuredErrorHandler)); } //deal with programmatic mapping: searchMapping = SearchMappingHelper.extractSearchMapping(this); //if we have a SearchMapping then we can predict at least those entities specified in the mapping //and avoid further SearchFactory rebuilds triggered by new entity discovery during cache events if (searchMapping != null) { Set<Class<?>> mappedEntities = searchMapping.getMappedEntities(); for (Class<?> entity : mappedEntities) { classes.put(entity.getName(), entity); } } }
Class<?> clazz = getProgrammaticMappingClass( programmaticConfig, cfg.getClassLoaderService() ); Method[] methods = clazz.getDeclaredMethods(); int count = 0; count++; ReflectionHelper.setAccessible( method ); mapping = getNewInstanceOfSearchMapping( clazz, method ); validateMappingFactoryDefinition( count, clazz ); return mapping;
Class<?> clazz = getProgrammaticMappingClass( programmaticConfig, cfg.getClassLoaderService() ); Method[] methods = clazz.getDeclaredMethods(); int count = 0; count++; ReflectionHelper.setAccessible( method ); mapping = getNewInstanceOfSearchMapping( clazz, method ); validateMappingFactoryDefinition( count, clazz ); return mapping;
SearchMapping searchMapping = SearchMappingHelper.extractSearchMapping(this); if (programmaticSearchMappingProviders != null && !programmaticSearchMappingProviders.isEmpty()) { if (searchMapping == null) {
final SearchMapping mapping = SearchMappingHelper.extractSearchMapping( cfg ); applySearchMappingToMetadata( reflectionManager, mapping );
final SearchMapping mapping = SearchMappingHelper.extractSearchMapping( cfg ); applySearchMappingToMetadata( reflectionManager, mapping );