public StandaloneSearchConfiguration(InstanceInitializer init, Properties properties) { this.initializer = init; this.classes = new HashMap<>(); this.properties = properties; // default values if nothing was explicitly set this.properties.computeIfAbsent( "hibernate.search.default.directory_provider", (key) -> { LOGGER.info( "defaulting to RAM directory-provider" ); return "ram"; } ); this.properties.computeIfAbsent( "hibernate.search.lucene_version", (key) -> { LOGGER.info( "defaulting to Lucene Version: " + Version.LUCENE_5_3_0.toString() ); return Version.LUCENE_5_3_0.toString(); } ); this.reflectionManager = new JavaReflectionManager(); this.providedServices = new HashMap<>(); this.classLoaderService = new DefaultClassLoaderService(); }
public static MetadataProvider getDummyMetadataProvider(SearchConfiguration searchConfiguration) { ConfigContext configContext = new ConfigContext( searchConfiguration, new BuildContext() { @Override public ExtendedSearchIntegrator getUninitializedSearchIntegrator() { return null; } @Override public String getIndexingStrategy() { return IndexingMode.EVENT.toExternalRepresentation(); } @Override public IndexingMode getIndexingMode() { return IndexingMode.EVENT; } @Override public ServiceManager getServiceManager() { return new StandardServiceManager( searchConfiguration, this, Environment.DEFAULT_SERVICES_MAP ); } @Override public IndexManagerHolder getAllIndexesManager() { return new IndexManagerHolder(); } @Override public ErrorHandler getErrorHandler() { return new LogErrorHandler(); } } ); return new AnnotationMetadataProvider( new JavaReflectionManager(), configContext ); }
private void createReflectionManager(MetadataProvider metadataProvider) { reflectionManager = new JavaReflectionManager(); ( ( MetadataProviderInjector ) reflectionManager ).setMetadataProvider( metadataProvider ); }
public void testXClass() throws Exception { final JavaReflectionManager manager = new JavaReflectionManager(); final XClass cClass = manager.toXClass(Test.class); cClass.getDeclaredProperties(XClass.ACCESS_FIELD); cClass.getDeclaredProperties(XClass.ACCESS_PROPERTY); }