public class JavaAccessor : StandardAccessorImpl() // Explicit inokation of the super constructor
{
{ // Anonymous initializer in the class body
declareThreadSafe();
}
public fun onSource(context: INKFRequestContext?) // The parameter is nullable by default. Annotate the base class if you want to get rif of this
{
context.createResponseFrom(“This is a response”);
}
With your guidance I now have the following compiling (and making sense to me):
package net.databliss.netkernel.layer0.endpointsimport org.netkernel.module.standard.endpoint.StandardAccessorImplimport org.netkernel.layer0.nkf.INKFRequestContextclass TestEndpoint : StandardAccessorImpl() { { declareThreadSafe() } override public fun onSource(context: INKFRequestContext?) { context?.createResponseFrom("This is a response") }}
It is clear that there would be value rewriting parts of NetKernel that would be adjunct to extension point written by users to handle issues like Null, etc. I will investigate this once I get this example working in NetKernel (the follow-up question is a subject of my next post - to keep the conversation threads focused).