use of com.ociweb.gl.api.GreenCommandChannel in project GreenLightning by oci-pronghorn.
the class AllRoutesExample2 method declareBehavior.
@Override
public void declareBehavior(GreenRuntime runtime) {
final GreenCommandChannel cmd = runtime.newCommandChannel(NET_RESPONDER);
RestListener listener = new RestListener() {
@Override
public boolean restRequest(HTTPRequestReader request) {
// TODO: this route is the wrong value
int id = request.getRouteId();
System.out.println(id);
return cmd.publishHTTPResponse(request, 200);
}
};
runtime.addRestListener(listener).includeAllRoutes();
}
Aggregations