Search in sources :

Example 1 with ConfigurationTypeResolver

use of com.oracle.svm.hosted.ConfigurationTypeResolver in project graal by oracle.

the class DynamicProxyFeature method duringSetup.

@Override
public void duringSetup(DuringSetupAccess a) {
    DuringSetupAccessImpl access = (DuringSetupAccessImpl) a;
    ImageClassLoader imageClassLoader = access.getImageClassLoader();
    DynamicProxySupport dynamicProxySupport = new DynamicProxySupport(imageClassLoader.getClassLoader());
    ImageSingletons.add(DynamicProxyRegistry.class, dynamicProxySupport);
    ConfigurationTypeResolver typeResolver = new ConfigurationTypeResolver("resource configuration", imageClassLoader, NativeImageOptions.AllowIncompleteClasspath.getValue());
    ProxyRegistry proxyRegistry = new ProxyRegistry(typeResolver, dynamicProxySupport, imageClassLoader);
    ImageSingletons.add(ProxyRegistry.class, proxyRegistry);
    ProxyConfigurationParser parser = new ProxyConfigurationParser(proxyRegistry, ConfigurationFiles.Options.StrictConfiguration.getValue());
    loadedConfigurations = ConfigurationParserUtils.parseAndRegisterConfigurations(parser, imageClassLoader, "dynamic proxy", ConfigurationFiles.Options.DynamicProxyConfigurationFiles, ConfigurationFiles.Options.DynamicProxyConfigurationResources, ConfigurationFile.DYNAMIC_PROXY.getFileName());
    proxyCacheField = access.findField(DynamicProxySupport.class, "proxyCache");
}
Also used : DuringSetupAccessImpl(com.oracle.svm.hosted.FeatureImpl.DuringSetupAccessImpl) DynamicProxySupport(com.oracle.svm.reflect.proxy.DynamicProxySupport) DynamicProxyRegistry(com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry) ProxyConfigurationParser(com.oracle.svm.core.configure.ProxyConfigurationParser) ConfigurationTypeResolver(com.oracle.svm.hosted.ConfigurationTypeResolver) ImageClassLoader(com.oracle.svm.hosted.ImageClassLoader)

Example 2 with ConfigurationTypeResolver

use of com.oracle.svm.hosted.ConfigurationTypeResolver 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)

Aggregations

ConfigurationTypeResolver (com.oracle.svm.hosted.ConfigurationTypeResolver)2 ImageClassLoader (com.oracle.svm.hosted.ImageClassLoader)2 ProxyConfigurationParser (com.oracle.svm.core.configure.ProxyConfigurationParser)1 SerializationConfigurationParser (com.oracle.svm.core.configure.SerializationConfigurationParser)1 DynamicProxyRegistry (com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry)1 FeatureImpl (com.oracle.svm.hosted.FeatureImpl)1 DuringSetupAccessImpl (com.oracle.svm.hosted.FeatureImpl.DuringSetupAccessImpl)1 DynamicProxySupport (com.oracle.svm.reflect.proxy.DynamicProxySupport)1