Author: buildbot
Date: Sun Dec 20 19:57:11 2020
New Revision: 1069301
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/graalvm-support.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/graalvm-support.html
==============================================================================
--- websites/production/cxf/content/docs/graalvm-support.html (original)
+++ websites/production/cxf/content/docs/graalvm-support.html Sun Dec 20
19:57:11 2020
@@ -121,15 +121,41 @@ Apache CXF -- GraalVM Support
<pre class="brush: java; gutter: false; theme: Default">public interface
GeneratedClassClassLoaderCapture {
void capture(String className, byte[] bytes);
}</pre>
-</div></div><p>The stored generated classes should be injected at build time,
whereas the following extensions replace dynamic class generation with class
loading of the captured (generated) classes at runtime:</p><ul
style="list-style-type: square;"><li><a shape="rect" class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperClassLoader.java"
rel="nofollow">WrapperHelperClassLoader</a></li><li><a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/wsdl/src/main/java/org/apache/cxf/wsdl/ExtensionClassLoader.java"
rel="nofollow">ExtensionClassLoader</a></li><li><a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/ExceptionClassLoader.java"
rel="nofollow">ExceptionClassLoader</a></li><li><a shape="rect"
class="external-link" href="https://github.com/apache/cxf/blob/master/rt/d
atabinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperClassLoader.java"
rel="nofollow"><span class="pl-en"><span
class="pl-token">WrapperHelperClassLoader</span></span></a></li><li><a
shape="rect" class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/FactoryClassLoader.java"
rel="nofollow">FactoryClassLoader</a></li><li><a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/common/spi/GeneratedNamespaceClassLoader.java"
rel="nofollow">GeneratedNamespaceClassLoader</a></li></ul><p>Here is the
programmatic way to configure these extensions:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The example of capturing class loader service may look like
this:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">public class
DumpingClassLoaderCapturer implements GeneratedClassClassLoaderCapture {
+ private final Map<String, byte[]> classes = new
ConcurrentHashMap<>();
+
+ public void dumpTo(File file) throws IOException {
+ if (!file.exists() || !file.isDirectory()) {
+ throw new IllegalArgumentException("The dump location does not
exist or is not a directory: " + file);
+ }
+
+ for (Map.Entry<String, byte[]> entry: classes.entrySet()) {
+ final Path path =
file.toPath().resolve(StringUtils.periodToSlashes(entry.getKey()) + ".class");
+ Files.createDirectories(path.getParent());
+
+ try (OutputStream out = Files.newOutputStream(path,
StandardOpenOption.CREATE)) {
+ out.write(entry.getValue());
+ }
+ }
+ }
+
+ @Override
+ public void capture(String className, byte[] bytes) {
+ classes.putIfAbsent(className, bytes);
+ }
+}
+
+</pre>
+</div></div><p>The stored generated classes should be injected at build time,
whereas the following extensions replace dynamic class generation with class
loading of the captured (generated) classes at runtime:</p><ul
style="list-style-type: square;"><li><a shape="rect" class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperClassLoader.java"
rel="nofollow">WrapperHelperClassLoader</a></li><li><a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/wsdl/src/main/java/org/apache/cxf/wsdl/ExtensionClassLoader.java"
rel="nofollow">ExtensionClassLoader</a></li><li><a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/ExceptionClassLoader.java"
rel="nofollow">ExceptionClassLoader</a></li><li><a shape="rect"
class="external-link" href="https://github.com/apache/cxf/blob/master/rt/f
rontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/WrapperClassLoader.java"
rel="nofollow">WrapperClassLoader</a></li><li><a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/FactoryClassLoader.java"
rel="nofollow">FactoryClassLoader</a></li><li><a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/common/spi/GeneratedNamespaceClassLoader.java"
rel="nofollow">GeneratedNamespaceClassLoader</a></li></ul><p>Here is the
programmatic way to configure these extensions:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"> final Bus bus = ...;
/* Bus instance */
bus.setExtension(new WrapperHelperClassLoader(bus),
WrapperHelperCreator.class);
bus.setExtension(new ExtensionClassLoader(bus), ExtensionClassCreator.class);
bus.setExtension(new ExceptionClassLoader(bus), ExceptionClassCreator.class);
- bus.setExtension(new GeneratedWrapperClassLoader(bus),
WrapperClassCreator.class);
+ bus.setExtension(new WrapperClassLoader(bus), WrapperClassCreator.class);
bus.setExtension(new FactoryClassLoader(bus), FactoryClassCreator.class);
bus.setExtension(new GeneratedNamespaceClassLoader(bus),
NamespaceClassCreator.class);</pre>
-</div></div></div>
+</div></div><p class="auto-cursor-target">You may run into dynamic class
generation in a few cases:</p><ul style="list-style-type: square;"><li
class="auto-cursor-target">when using <a shape="rect"
href="dynamic-clients.html">JaxWsDynamicClientFactory</a> (fully dynamic
clients)</li><li class="auto-cursor-target">when using request / response
wrappers and fault exception wrappers (which may not generated at build
time)</li></ul><p><br clear="none"></p><p><br clear="none"></p></div>
</div>
<!-- Content -->
</td>