Search in sources :

Example 1 with ProxyConfigurationParser

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

the class ConfigurationSet method loadProxyConfig.

public ProxyConfiguration loadProxyConfig(Function<IOException, Exception> exceptionHandler) throws Exception {
    ProxyConfiguration proxyConfiguration = new ProxyConfiguration();
    loadConfig(proxyConfigPaths, new ProxyConfigurationParser(types -> proxyConfiguration.add(types.getCondition(), new ArrayList<>(types.getElement())), true), exceptionHandler);
    return proxyConfiguration;
}
Also used : Files(java.nio.file.Files) Predicate(java.util.function.Predicate) Collection(java.util.Collection) ConfigurationParser(com.oracle.svm.core.configure.ConfigurationParser) ProxyConfigurationParser(com.oracle.svm.core.configure.ProxyConfigurationParser) Set(java.util.Set) IOException(java.io.IOException) Function(java.util.function.Function) ArrayList(java.util.ArrayList) Objects(java.util.Objects) ResourceConfigurationParser(com.oracle.svm.core.configure.ResourceConfigurationParser) SerializationConfigurationParser(com.oracle.svm.core.configure.SerializationConfigurationParser) ReflectionConfigurationParser(com.oracle.svm.core.configure.ReflectionConfigurationParser) ConfigurationFile(com.oracle.svm.core.configure.ConfigurationFile) PredefinedClassesConfigurationParser(com.oracle.svm.core.configure.PredefinedClassesConfigurationParser) URI(java.net.URI) Path(java.nio.file.Path) Collections(java.util.Collections) LinkedHashSet(java.util.LinkedHashSet) ProxyConfigurationParser(com.oracle.svm.core.configure.ProxyConfigurationParser)

Example 2 with ProxyConfigurationParser

use of com.oracle.svm.core.configure.ProxyConfigurationParser 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)

Aggregations

ProxyConfigurationParser (com.oracle.svm.core.configure.ProxyConfigurationParser)2 ConfigurationFile (com.oracle.svm.core.configure.ConfigurationFile)1 ConfigurationParser (com.oracle.svm.core.configure.ConfigurationParser)1 PredefinedClassesConfigurationParser (com.oracle.svm.core.configure.PredefinedClassesConfigurationParser)1 ReflectionConfigurationParser (com.oracle.svm.core.configure.ReflectionConfigurationParser)1 ResourceConfigurationParser (com.oracle.svm.core.configure.ResourceConfigurationParser)1 SerializationConfigurationParser (com.oracle.svm.core.configure.SerializationConfigurationParser)1 DynamicProxyRegistry (com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry)1 ConfigurationTypeResolver (com.oracle.svm.hosted.ConfigurationTypeResolver)1 DuringSetupAccessImpl (com.oracle.svm.hosted.FeatureImpl.DuringSetupAccessImpl)1 ImageClassLoader (com.oracle.svm.hosted.ImageClassLoader)1 DynamicProxySupport (com.oracle.svm.reflect.proxy.DynamicProxySupport)1 IOException (java.io.IOException)1 URI (java.net.URI)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 LinkedHashSet (java.util.LinkedHashSet)1