Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.serviceproxy.ProxyHelper;
@ProxyGen
public interface InitializeIngestorService {
void createIngestor(String uuid, Handler<AsyncResult<IngestorToPolicyService>> resultHandler);
static InitializeIngestorService create(Vertx vertx) {
return new InitializeIngestorServiceImpl(vertx);
}
static InitializeIngestorService createProxy(Vertx vertx, String address) {
return ProxyHelper.createProxy(InitializeIngestorService.class, vertx, address);
}
}
import io.vertx.apiman.gateway.platforms.vertx2.services.impl2.IngestorToPolicyImpl;
import io.vertx.apiman.gateway.platforms.vertx2.services.impl2.VertxServiceRequest;
import io.vertx.codegen.annotations.ProxyClose;
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.core.Vertx;
import io.vertx.serviceproxy.ProxyHelper;
@ProxyGen
public interface IngestorToPolicyService {
static IngestorToPolicyService create(Vertx vertx) {
return new IngestorToPolicyImpl();
}
static IngestorToPolicyService createProxy(Vertx vertx, String address) {
return ProxyHelper.createProxy(IngestorToPolicyService.class, vertx, address);
}
void head(VertxServiceRequest serviceRequest);
// TODO change this when https://github.com/vert-x3/vertx-service-proxy/issues/17
void write(String chunk);
@ProxyClose
void end();
}
import java.util.UUID;
public class IngestorToPolicyImpl implements IngestorToPolicyService {
String uuid = UUID.randomUUID().toString();
@Override
public void head() {
System.out.println("Head");
}
@Override
public void write(String chunk) {
System.out.println("Received chunk " + chunk + " // on UUID " + uuid);
}
@Override
public void end() {
System.out.println("OK, finished");
}
}
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
public class InitializeIngestorServiceImpl implements InitializeIngestorService {
private Vertx vertx;
public InitializeIngestorServiceImpl(Vertx vertx) {
this.vertx = vertx;
}
@Override
public void createIngestor(String uuid, Handler<AsyncResult<IngestorToPolicyService>> resultHandler) {
resultHandler.handle(Future.succeededFuture(IngestorToPolicyService.createProxy(vertx, uuid)));
}
}
SEVERE: Could not generate model for createIngestor(java.lang.String,io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.apiman.gateway.platforms.vertx2.services.IngestorToPolicyService>>): type io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.apiman.gateway.platforms.vertx2.services.IngestorToPolicyService>> is not legal for use for a parameter in proxy
io.vertx.codegen.GenException: type io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.apiman.gateway.platforms.vertx2.services.IngestorToPolicyService>> is not legal for use for a parameter in proxy
at io.vertx.codegen.ProxyModel.checkParamType(ProxyModel.java:99)
at io.vertx.codegen.ClassModel.getParams(ClassModel.java:760)
at io.vertx.codegen.ClassModel.addMethod(ClassModel.java:652)
at io.vertx.codegen.ClassModel$$Lambda$43/640736196.accept(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:419)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at io.vertx.codegen.ClassModel.traverseElem(ClassModel.java:530)
at io.vertx.codegen.ClassModel.process(ClassModel.java:420)
at io.vertx.codegen.CodeGen.getProxyModel(CodeGen.java:191)
at io.vertx.codegen.CodeGen.lambda$null$14(CodeGen.java:132)
at io.vertx.codegen.CodeGen$$Lambda$41/955061147.get(Unknown Source)
at io.vertx.codegen.CodeGen$ModelEntry.getValue(CodeGen.java:97)
at io.vertx.codegen.CodeGen$ModelEntry.getValue(CodeGen.java:79)
at io.vertx.codegen.CodeGenProcessor.lambda$process$48(CodeGenProcessor.java:119)
at io.vertx.codegen.CodeGenProcessor$$Lambda$18/1755634886.accept(Unknown Source)
at java.util.stream.StreamSpliterators$WrappingSpliterator$$Lambda$19/1601800698.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1683)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at io.vertx.codegen.CodeGenProcessor.process(CodeGenProcessor.java:117)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.