java-middleware
a code generator for generating codes like express middleware
How to use
- add annotation to your interface class
import io.insight.Middleware;
@Middleware
public interface ExampleService {
Integer foo(Long a, Long b) throws IOException;
void bar(Integer c);
}
- compile your code
ExampleServiceMiddleware
and ExampleServiceChain
will be generated
-
use
ExampleServiceChain
as your default implementation, expose it to your user -
your user can implement
ExampleServiceMiddleware
and add them toExampleServiceChain
see example