epserver

End Point application server. Non-blocking, java nio, tcp with custom messages. Target: java 8

ep_server_examples.zip epserver-1.0.jar is included in the examples.

First released: 8.04.2025

    
End point
    Apps must implement EndPoint interface methods:
    init(EpContext) - called once when the end point is instantiated;
    call(Request, Response) - process the request and return response;
    destroy() - close the app properly. Call session.invalidate() to close the client.

Client
    Request: Create EpMessage and send message bytes. The message must have at least a receiver and message data.
    receiver format: // as set in web.xml
    Response: read from the channel and unpack the message.

The requests are processed concurrently at the server by the worker threads, this requires end point synchronization.
The responses are done sequentially as they are send by the end point through the client message queue to the socket.
One way to guarantee the message order is to make the requests in a sequence: request|response, request|response, etc.
Or the client may not care about the order, send multiple request, collect responses to construct a state at the client.

Deployment
    Apps are bundled in a .war file.
    App path classes and libraries:
    /WEB-INF/classes/
    /WEB-INF/lib/

EndPoint class loader has access to packages starting with:
    java.
    javax.
    org.xml.
    org.w3c.
    com.aza.ep_api.

EpServer should be used with trusted apps only.


Example echo

Start ep_server
    unzip - ep_server.zip
    in ep_server/conf/ep_server.conf or ep_server/conf/ep_server_lin.conf
    set server directory "server_dir"
    
    java -cp g:/ep_server/lib/* com.aza.ep.epserver config=g:/ep_server/conf/ep_server.conf
    java -cp /home/aza/ep_server/lib/ep_api-1.0.jar:/home/aza/ep_server/lib/ep_server-1.0.jar:/home/aza/ep_server/lib/kvs-1.0.5.beta.r3.jar com.aza.ep.epserver config=/home/aza/ep_server/conf/ep_server_lin.conf

Deploy ep_echo
    Configure build.xml
    set deploy directory - "ep_server_dir"
    Configure src/resources/web.xml

Run build.xml
run EchoClient