Class SokletProcessor

All Implemented Interfaces:
Processor

Soklet's standard Annotation Processor which is used to generate lookup tables of Resource Method definitions at compile time as well as prevent usage errors that are detectable by static analysis.

This Annotation Processor ensures Resource Methods annotated with ServerSentEventSource are declared as returning an instance of HandshakeResult.

Your build system should ensure this Annotation Processor is available at compile time. Follow the instructions below to make your application conformant:

Using javac directly:

javac -parameters -processor com.soklet.SokletProcessor ...[rest of javac command elided]
Using Maven:
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>...</version>
    <configuration>
        <release>...</release>
        <compilerArgs>
            <!-- Rest of args elided -->
            <arg>-parameters</arg>
            <arg>-processor</arg>
            <arg>com.soklet.SokletProcessor</arg>
        </compilerArgs>
    </configuration>
</plugin>
Using Gradle:
def sokletVersion = "2.0.2" // (use your actual version)

dependencies {
  // Soklet used by your code at compile/run time
  implementation "com.soklet:soklet:${sokletVersion}"

  // Same artifact also provides the annotation processor
  annotationProcessor "com.soklet:soklet:${sokletVersion}"

  // If tests also need processing (optional)
  testAnnotationProcessor "com.soklet:soklet:${sokletVersion}"
}

Incremental/IDE ("IntelliJ-safe") behavior

  • Never rebuilds the global index from only the currently-compiled sources. It always merges with the prior index.
  • Only removes stale entries for top-level types compiled in the current compiler invocation (touched types).
  • Skips writing the index entirely if compilation errors are present, preventing clobbering a good index.
  • Writes with originating elements (best-effort) so incremental build tools can track dependencies.

Processor options

  • -Asoklet.cacheMode=none|sidecar|persistent (default: sidecar)
  • -Asoklet.cacheDir=/path (used only when cacheMode=persistent; required to enable persistent)
  • -Asoklet.pruneDeleted=true|false (default: false; generally not IDE-safe)
  • -Asoklet.debug=true|false (default: false)

Important: This processor will never create a project-root .soklet directory by default. Persistent caching is only enabled when cacheMode=persistent and soklet.cacheDir is set.

Author:
Mark Allen