Skip to content

A java annotation processor to facilitate dynamic proxy use within closed-world environments.

License

Notifications You must be signed in to change notification settings

palantir/proxy-processor

Repository files navigation

proxy-processor

Annotation processor which provides typed proxy factories that are compatible with closed-world environments. This means proxy instances created using code generated by this library can be used in GraalVM native images due to automatic detection.

Usage

import java.util.Arrays;

@Proxy
interface MyInterface {
    String ping();
}
MyInterface proxy = MyInterfaceProxy.create(new InvocationHandler() {
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.printf("Invoked %s on %s with args %s\n", method, proxy, Arrays.toString(args));
        return null;
    }
});

Build Configuration

Using gradle:

dependencies {
    compileOnly 'com.palantir.proxy.processor:proxy-annotations'
    annotationProcessor 'com.palantir.proxy.processor:proxy-processor'
}

Gradle Tasks

./gradlew tasks - to get the list of gradle tasks

Start Developing

Run one of the following commands:

  • ./gradlew idea for IntelliJ
  • ./gradlew eclipse for Eclipse

About

A java annotation processor to facilitate dynamic proxy use within closed-world environments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published