Search in sources :

Example 1 with SerializationConfigurationParser

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

the class SerializationBuilder method duringSetup.

@Override
public void duringSetup(DuringSetupAccess a) {
    FeatureImpl.DuringSetupAccessImpl access = (FeatureImpl.DuringSetupAccessImpl) a;
    ImageClassLoader imageClassLoader = access.getImageClassLoader();
    ConfigurationTypeResolver typeResolver = new ConfigurationTypeResolver("serialization configuration", imageClassLoader, NativeImageOptions.AllowIncompleteClasspath.getValue());
    SerializationDenyRegistry serializationDenyRegistry = new SerializationDenyRegistry(typeResolver);
    serializationBuilder = new SerializationBuilder(serializationDenyRegistry, access, typeResolver);
    ImageSingletons.add(RuntimeSerializationSupport.class, serializationBuilder);
    SerializationConfigurationParser denyCollectorParser = new SerializationConfigurationParser(serializationDenyRegistry, ConfigurationFiles.Options.StrictConfiguration.getValue());
    ConfigurationParserUtils.parseAndRegisterConfigurations(denyCollectorParser, imageClassLoader, "serialization", ConfigurationFiles.Options.SerializationDenyConfigurationFiles, ConfigurationFiles.Options.SerializationDenyConfigurationResources, ConfigurationFile.SERIALIZATION_DENY.getFileName());
    SerializationConfigurationParser parser = new SerializationConfigurationParser(serializationBuilder, ConfigurationFiles.Options.StrictConfiguration.getValue());
    loadedConfigurations = ConfigurationParserUtils.parseAndRegisterConfigurations(parser, imageClassLoader, "serialization", ConfigurationFiles.Options.SerializationConfigurationFiles, ConfigurationFiles.Options.SerializationConfigurationResources, ConfigurationFile.SERIALIZATION.getFileName());
}
Also used : SerializationConfigurationParser(com.oracle.svm.core.configure.SerializationConfigurationParser) FeatureImpl(com.oracle.svm.hosted.FeatureImpl) ConfigurationTypeResolver(com.oracle.svm.hosted.ConfigurationTypeResolver) ImageClassLoader(com.oracle.svm.hosted.ImageClassLoader)

Example 2 with SerializationConfigurationParser

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

the class ConfigurationSet method loadSerializationConfig.

public SerializationConfiguration loadSerializationConfig(Function<IOException, Exception> exceptionHandler) throws Exception {
    SerializationConfiguration serializationConfiguration = new SerializationConfiguration();
    loadConfig(serializationConfigPaths, new SerializationConfigurationParser(serializationConfiguration, true), exceptionHandler);
    return serializationConfiguration;
}
Also used : SerializationConfigurationParser(com.oracle.svm.core.configure.SerializationConfigurationParser)

Aggregations

SerializationConfigurationParser (com.oracle.svm.core.configure.SerializationConfigurationParser)2 ConfigurationTypeResolver (com.oracle.svm.hosted.ConfigurationTypeResolver)1 FeatureImpl (com.oracle.svm.hosted.FeatureImpl)1 ImageClassLoader (com.oracle.svm.hosted.ImageClassLoader)1