Skip to content

Commit

Permalink
Cross-reference CDI FAQ and Gizmo
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Aug 12, 2024
1 parent 891ffee commit 6e57674
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions docs/src/main/asciidoc/writing-extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,9 @@ class MyDevModeProcessor {
<3> The other build step will only be executed in dev mode.

[id='bytecode-recording']
=== Bytecode Recording
=== Generating Bytecode

==== Bytecode Recording

One of the main outputs of the build process is recorded bytecode. This bytecode actually sets up the runtime environment. For example, in order to start Undertow, the resulting application will have some bytecode that directly registers all
Servlet instances and then starts Undertow.
Expand Down Expand Up @@ -1556,12 +1558,8 @@ However, this method should not be needed in most use cases because directly loa
Therefore, this method is deprecated.
Nonetheless, there are some use cases where this method comes in handy, such as referring to classes that were generated in previous build steps using `GeneratedClassBuildItem`.

==== Runtime Classpath check

Extensions often need a way to determine whether a given class is part of the application's runtime classpath.
The proper way for an extension to perform this check is to use `io.quarkus.bootstrap.classloading.QuarkusClassLoader.isClassPresentAtRuntime`.

==== Printing step execution time
===== Printing step execution time

At times, it can be useful to know how the exact time each startup task (which is the result of each bytecode recording) takes when the application is run.
The simplest way to determine this information is to launch the Quarkus application with the `-Dquarkus.debug.print-startup-times=true` system property.
Expand All @@ -1581,11 +1579,23 @@ Build step VertxHttpProcessor.openSocket completed in: 93ms
Build step ShutdownListenerBuildStep.setupShutdown completed in: 1ms
----

==== Using Gizmo

In some scenarios, more significant manipulation of bytecode may be needed.
If bytecode recording isn't sufficient, link:https://github.com/quarkusio/gizmo/blob/main/USAGE.adoc[Gizmo] is a convenient alternative to ASM, with a higher-level API.

==== Runtime Classpath check

Extensions often need a way to determine whether a given class is part of the application's runtime classpath.
The proper way for an extension to perform this check is to use `io.quarkus.bootstrap.classloading.QuarkusClassLoader.isClassPresentAtRuntime`.

////
TODO: config integration
////
=== Contexts and Dependency Injection

The xref:cdi-integration.adoc[CDI integration guide] has more detail on common CDI-related use cases, and example code for solutions.

==== Extension Points

As a CDI based runtime, Quarkus extensions often make CDI beans available as part of the extension behavior.
Expand Down

0 comments on commit 6e57674

Please sign in to comment.