Server Side Services

Writing server side services is not different than the known and accepted way of writing and handling services. Although NeuroKernel offers some easy to use classes for easy integration In its dynamic mode, any service written on any framework is accepted as well. NeuroKernel can make CORS (Cross-Origin Resource Sharing) service calls. The service handler interface has methods to detail the type of service call. There are callService methods to make calls to the originating server, and callRemoteService to make CORS services

import com.neurokernel.client.*;
public class ServiceExample extends NApplication {
      public void main(int argc, String[] argv) {
          getServiceHandler().callService("GetData", "John Doe", connection -> {
                NFrame mainFrame = getMainFrame()
                if(connection.hasError())NMessageDialog.showError(mainFrame, "Data is not found!");
                else NMessageDialog.showInfo(mainFrame, connection.readString());
          setVisible("Service Example");

1. Direct Access Services

In dynamic mode, servlet based services can be registered as directly accessible by the application. This will mean that when the application is run at the server side, it wont need to go through network layer, but will access the service directly by reference. Directly accessible services should implement IService interface. They can be registered with addDirectService methods of IServiceHandler system interface.