forked from apache/camel-quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revisit apache#1017 Be even less intrusive when registering our Trans…
…formerFactory
- Loading branch information
Showing
6 changed files
with
107 additions
and
70 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...ns-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/graal/ResourceUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.camel.quarkus.core.graal; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.InputStream; | ||
import java.lang.reflect.Method; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
/** | ||
* Helper methods invoked from generated bytecode during image processing | ||
*/ | ||
public class ResourceUtils { | ||
|
||
/** | ||
* Write a string resource into the native image. | ||
* | ||
* @param resourcePath the path under which the given {@code content} should be stored | ||
* @param content the content that will be serialized using {@code UTF-8} | ||
*/ | ||
public static void registerResources(String resourcePath, String content) { | ||
try { | ||
final Class<?> resourcesClass = Class.forName("com.oracle.svm.core.jdk.Resources"); | ||
final Method register = resourcesClass.getDeclaredMethod("registerResource", String.class, InputStream.class); | ||
try (InputStream in = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8))) { | ||
register.invoke(null, resourcePath, in); | ||
} | ||
} catch (Exception e) { | ||
throw new RuntimeException("Failed to load resource " + resourcePath, e); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
...ain/java/org/apache/camel/quarkus/support/xalan/deployment/CamelXalanBuildTimeConfig.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...xalan/runtime/src/main/resources/META-INF/services/javax.xml.transform.TransformerFactory
This file was deleted.
Oops, something went wrong.