In prevoious chapter was presented configuration file for main server. All configuration microservices files exist also in the 'start/configuration' subdirectory.

In class JLupinLocalServerProcessConfigurator (main server configuration file) was set class name (by setConfigurationClassFileName method) to configuration java file name which is responsible for single microservice definition. To get better understanding of configuration defined by class JLupinLocalSingleProcessConfiguration.java, please check the below figure:

Let's look at this file. File must implement JLupinLocalSingleProcessConfiguration interface.

public class JLupinFirstSampleApplicationConfigurationImpl implements JLupinLocalSingleProcessConfiguration{

    public void before() {

    }

    public void after() {

    }

    public JLupinBaseServer getJLupinLocalBaseServer() {
        JLupinDefaultBaseServerImpl jLupinDefaultBaseServer = new JLupinDefaultBaseServerImpl("default");
        jLupinDefaultBaseServer.setThreadPoolSize(64);
        //jLupinDefaultBaseServer.setThreadExecutingTimeOut(60000);
        //jLupinDefaultBaseServer.setDestroyThreadOnTimeout(true);
        return jLupinDefaultBaseServer;
    }

    public JLupinBaseServer getJLupinLocalCommandServer() {
        JLupinDefaultBaseServerImpl jLupinDefaultBaseServer = new JLupinDefaultBaseServerImpl("command");
        jLupinDefaultBaseServer.setThreadPoolSize(4);
        //jLupinDefaultBaseServer.setThreadExecutingTimeOut(60000);
        //jLupinDefaultBaseServer.setDestroyThreadOnTimeout(true);
        jLupinDefaultBaseServer.setWaitForFinishExecuteAllRequests(false);
        return jLupinDefaultBaseServer;
    }

    public JLupinEntryPoint getJLupinLocalCommandEntryPoint() {
        return new JLupinLocalCommandEntryPointImpl();
    }

    public JLupinEntryPoint getJLupinLocalEntryPoint() {
        JLupinDefaultEntryPointImpl jLupinDefaultEntryPoint = new JLupinDefaultEntryPointImpl();
        return jLupinDefaultEntryPoint;
    }

    public  JLupinServiceProcessor getJLupinServiceProcessor() {
        JLupinServiceProcessor jLupinServiceProcessor = new JLupinDefaultServiceProcessorImpl();
        return jLupinServiceProcessor;
    }

    public JLupinInnerServiceProcessor getJLupinInnerServiceProcessor() {
        return new JLupinDefaultInnerServiceProcessorImpl();
    }

    public JLupinApplicationInvoker getJLupinApplicationInvoker() {

        JLupinClientSocketConfiguration clientSocketConfServer = new JLupinClientSocketConfiguration();
        clientSocketConfServer.setSocketAddressToConnectServer(new InetSocketAddress("localhost", 9090));
        clientSocketConfServer.setReadTimeout(30000);
        clientSocketConfServer.setConnectionTimeout(1000);

        JLupinBalancer jLupinBalancer = new JLupinPrioritySocketBalancerImpl(
                4, getJLupinLogger(), getJLupinSerializer(),clientSocketConfServer);

        JLupinDelegator jLupinBalanceDelegator = new JLupinDefaultBalanceProxyDelegatorImpl(jLupinBalancer);

        return new JLupinDefaultApplicationInvokerImpl(new JLupinDelegator[] {jLupinBalanceDelegator});
    }

    public JLupinApplicationContainer getJLupinApplicationContainer() {
        JLupinSingleApplicationContainerForLocalProcessImpl  jLupinSingleApplicationContainerForLocalProcess =
                new JLupinSingleApplicationContainerForLocalProcessImpl(
                        new String[] {"classpath:spring-services.xml",
                                      "classpath:spring-health-checking-services.xml"});
        return jLupinSingleApplicationContainerForLocalProcess;
    }

    public JLupinLogger getJLupinLogger() {
        return JLupinLoggerOverLog4jImpl.getInstance();
    }

    public JLupinSerializer getJLupinSerializer() {
        return JLupinFSTSerializerImpl.getInstance();
    }
}

The foregoing methods:
When JLupin Next Server starts a new microservice as Java process, the server executes methods in the following order:

public void before()

where you can do anything before the start up of the microservice

public JLupinLogger getJLupinLogger()

creates the JLupinLogger singleton

public JLupinSerializer getJLupinSerializer()

creates the JLupinSerializer singleton

public JLupinApplicationContainer getJLupinApplicationContainer()

creates the JLupinApplicationContainer singleton

public JLupinInnerServiceProcessor getJLupinInnerServiceProcessor()

creates the JLupinInnerServiceProcessor singleton - this class is like a helper responsible for invoking an inner service from an outer service.

public  JLupinServiceProcessor getJLupinServiceProcessor()

creates the JLupinServiceProcessor singleton - this is the main JLNS engine class responsible for managing services

public JLupinApplicationInvoker getJLupinApplicationInvoker()

creates the JLupinApplicationInvoker singleton - this class is like a helper responsible for invoking microservice from another microservice on local or remote servers - it depends on JLupinDelegator implementation and configuration

public JLupinEntryPoint getJLupinLocalEntryPoint()

creates the JLupinEntryPoint singleton which is responsible for service of data exchange protocol between the main server and a given microservice

public JLupinEntryPoint getJLupinLocalCommandEntryPoint()

creates the JLupinEntryPoint singleton which is responsible for interpreting commands (such as start, stop, etc.) from the main server

public JLupinBaseServer getJLupinLocalBaseServer()

creates the JLupinBaseServer singleton which is a network server responsible for data exchange ( service data ) between the main server and microservice- this server is linked with JLupinLocalEntryPoint

public JLupinBaseServer getJLupinLocalCommandServer()

creates the JLupinBaseServer singleton which is a network server responsible for communication by a command between the main server and microservice. This server is linked to JLupinLocalCommandEntryPoint

The last step is the following method execution:

public void after()

where you can do anything after the start-up of the microservice.

When the local server listens properly, the main server sends a start command (by JLupinLocalCommandServer) which executes a load() method on the JLupinApplicationContainer singleton which starts the application container

Let’s discuss details of default implementation of particular methods provided with server implementation.

public JLupinLogger getJLupinLogger()

In this method we must define the implementation of the JLupinLogger interface which is the main JLNS logger engine.

Available implementation (for microservice as local server):

JLupinLoggerOverLog4jImpl

Implementation above log in path:

$server_home$logsserverlocal$microservice_name$start - for start process
$server_home$logsserverlocal$microservice_name$run   - for running process

The above implementation is based on mechanisms of log4j library and configuration is taken from properties or xml files that are found in the microservice catalogue

Now lets see at method:

public JLupinSerializer getJLupinSerializer()

In this method we must define implementation of the JLupinSerializer interface which is the main JLNS object serialization engine (JLNS serialize and deserialize objects between the delegator or balancer and the main server and microservice- and between those layers serializers must serialize and deserialize objects in the same way - so use the same serializer implementation on every part on JLNS). Available implementation (for the delegator, balancer, the main server and microservice):

JLupinFSTSerializerImpl

The above serializer is configured by default in Jlupin distribution. It is based on mechanisms of Fast Serialization - https://ruedigermoeller.github.io/fast-serialization/

Let’s discuss other methods:

public JLupinApplicationContainer  getJLupinApplicationContainer()

The default JLNS JLupinApplicationContainer implementation is based on the ClassPathXmlApplicationContext class taken from Spring Framework.

public JLupinInnerServiceProcessor getJLupinInnerServiceProcessor()

Default implementation provided by the server is JLupinDefaultInnerServiceProcessorImpl.
"Internal Services" chapter describes how to use it in a code using API JLupin

public JLupinServiceProcessor getJLupinServiceProcessor()

Default implementation provided by the server is JLupinDefaultServiceProcessorImpl.
The above class is internally used by server mechanisms for initiating particular methods on objects created by JLupinApplicationContainer. This class is also responsible for transaction management and exception service control

In the method:

public JLupinEntryPoint getJLupinLocalEntryPoint()

implementation is provided in a form of JLupinDefaultEntryPointImpl. This class is responsible for data exchange between the main server and a given class within microservice on which it is switched on. It is also responsible for JlupinServiceProcessor object control.

Method:

public JLupinEntryPoint getJLupinLocalCommandEntryPoint()

provides by default JLupinLocalCommandEntryPointImpl that is responsible for acceptance and performance of control commands from the main server. These commands support actions such as start, stop, restart, etc.

Methods:

public JLupinBaseServer getJLupinLocalCommandServer()

and

public JLupinBaseServer getJLupinLocalBaseServer()

return instances of JLupinDefaultBaseServerImpl.

Properties of this class have been already discussed in Server Configuration File chapter in the discussion on the properties of JLupinGlobalServer. JLupinGlobalServer interface extends JLupinBaseServer interface whose default implementation is JLupinDefaultBaseServerImpl.