Search in sources :

Example 1 with PredefinedClassesConfigurationParser

use of com.oracle.svm.core.configure.PredefinedClassesConfigurationParser in project graal by oracle.

the class ConfigurationSet method loadPredefinedClassesConfig.

public PredefinedClassesConfiguration loadPredefinedClassesConfig(Path[] classDestinationDirs, Predicate<String> shouldExcludeClassesWithHash, Function<IOException, Exception> exceptionHandler) throws Exception {
    PredefinedClassesConfiguration predefinedClassesConfiguration = new PredefinedClassesConfiguration(classDestinationDirs, shouldExcludeClassesWithHash);
    loadConfig(predefinedClassesConfigPaths, new PredefinedClassesConfigurationParser(predefinedClassesConfiguration::add, true), exceptionHandler);
    return predefinedClassesConfiguration;
}
Also used : PredefinedClassesConfigurationParser(com.oracle.svm.core.configure.PredefinedClassesConfigurationParser)

Example 2 with PredefinedClassesConfigurationParser

use of com.oracle.svm.core.configure.PredefinedClassesConfigurationParser in project graal by oracle.

the class ClassPredefinitionFeature method afterRegistration.

@Override
public void afterRegistration(AfterRegistrationAccess arg) {
    ImageSingletons.add(PredefinedClassesSupport.class, new PredefinedClassesSupport());
    /*
         * NOTE: loading the class predefinition configuration should be done as early as possible
         * so that their classes are already known for other configuration (reflection, proxies).
         */
    AfterRegistrationAccessImpl access = (AfterRegistrationAccessImpl) arg;
    PredefinedClassesRegistry registry = new PredefinedClassesRegistryImpl();
    ImageSingletons.add(PredefinedClassesRegistry.class, registry);
    PredefinedClassesConfigurationParser parser = new PredefinedClassesConfigurationParser(registry, ConfigurationFiles.Options.StrictConfiguration.getValue());
    ConfigurationParserUtils.parseAndRegisterConfigurations(parser, access.getImageClassLoader(), "class predefinition", ConfigurationFiles.Options.PredefinedClassesConfigurationFiles, ConfigurationFiles.Options.PredefinedClassesConfigurationResources, ConfigurationFile.PREDEFINED_CLASSES_NAME.getFileName());
}
Also used : AfterRegistrationAccessImpl(com.oracle.svm.hosted.FeatureImpl.AfterRegistrationAccessImpl) PredefinedClassesConfigurationParser(com.oracle.svm.core.configure.PredefinedClassesConfigurationParser) PredefinedClassesSupport(com.oracle.svm.core.hub.PredefinedClassesSupport) PredefinedClassesRegistry(com.oracle.svm.core.configure.PredefinedClassesRegistry)

Aggregations

PredefinedClassesConfigurationParser (com.oracle.svm.core.configure.PredefinedClassesConfigurationParser)2 PredefinedClassesRegistry (com.oracle.svm.core.configure.PredefinedClassesRegistry)1 PredefinedClassesSupport (com.oracle.svm.core.hub.PredefinedClassesSupport)1 AfterRegistrationAccessImpl (com.oracle.svm.hosted.FeatureImpl.AfterRegistrationAccessImpl)1