{"id":39584671,"url":"https://github.com/ppissias/xsrpcj","last_synced_at":"2026-03-09T10:11:25.620Z","repository":{"id":57734517,"uuid":"139040814","full_name":"ppissias/xsrpcj","owner":"ppissias","description":"An extra small (xs) RPC implementation","archived":false,"fork":false,"pushed_at":"2018-07-30T10:52:18.000Z","size":1204,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-19T21:44:35.421Z","etag":null,"topics":["code-generation","java","json","protobuf3","protocol-buffers","rpc","velocity-template"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppissias.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-28T16:04:28.000Z","updated_at":"2022-11-15T03:09:04.000Z","dependencies_parsed_at":"2022-09-11T15:31:41.878Z","dependency_job_id":null,"html_url":"https://github.com/ppissias/xsrpcj","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ppissias/xsrpcj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppissias%2Fxsrpcj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppissias%2Fxsrpcj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppissias%2Fxsrpcj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppissias%2Fxsrpcj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppissias","download_url":"https://codeload.github.com/ppissias/xsrpcj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppissias%2Fxsrpcj/sbom","scorecard":{"id":742767,"data":{"date":"2025-08-11","repo":{"name":"github.com/ppissias/xsrpcj","commit":"f5a7f5c59895ecacae1e4781fc8743074d9a4100"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-4jrv-ppp4-jm57","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T17:55:22.716Z","repository_id":57734517,"created_at":"2025-08-22T17:55:22.716Z","updated_at":"2025-08-22T17:55:22.716Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30291296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","java","json","protobuf3","protocol-buffers","rpc","velocity-template"],"created_at":"2026-01-18T07:35:27.094Z","updated_at":"2026-03-09T10:11:25.612Z","avatar_url":"https://github.com/ppissias.png","language":"Java","funding_links":[],"categories":["\u003ca name=\"Java\"\u003e\u003c/a\u003eJava"],"sub_categories":[],"readme":"\n\n# xsrpcj\n\n  \n\n**xsrpcj** is an extra small (xs) remote procedure call (rpc) implementation for java on top of TCP Sockets, It is designed to be used with **protocol buffers** generated data types but it can also use custom data types. It supports 3 interaction patterns:\n\n  \n\n- **Oneway**: similar to a void function. We just send some data.\n\n- **Request/Reply**: we send some data and get some data back as a reply\n\n- **Request/Reply/Callback**: in addition to the request/reply interaction pattern, we also get asynchronously a number of callback messages.\n\n  \n\nA typical example of the request/reply/callback interaction pattern is that we make an interaction (for example a registration) and then as a result of this interaction we get back asynchronously data from time to time.\n\n  \n\nxsrpcj focuses on a **simple programming model** and **minimal dependencies**. In fact, you don't need anything else except protocol buffers, not even xsrpcj itself, since it generates all the code you need.\n\n  \n\n## Getting Started\n\n*A good way to start is to check out the xsrpcj examples project (https://github.com/ppissias/xsrpcj-examples) -also check the wiki*  \n\nOK, so you have in mind some **services** you want to **implement**. You need to **express** these services in terms of **interaction patterns** and create the **data types** for the various requests replies and possible callbacks. A **typical workflow** using xsrpcj is:\n\n  \n\n- You **describe your services** (this is done in a **JSON** file)\n\n- You **create** your **data types** (either using **protocol buffers**, or using your own custom data types - as long as they obey some simple rules, explained later)\n\n- You invoke the **xsrpcj code generator**\n\n**That's it.** xsrpcj will generate a client API and and all the necessary server-side code.\n\n  \n\nLets take it **step by step**.\n\n\n\n  \n\n### Service description\n\nServices are described in a JSON file. A simple example is provided below:\n\n    {\n\t\"servers\":[\n\t \t{\n\t\t\t\"name\": \"Persons\",\n\t\t\t\"port\": \"22100\",\n\t\t\t\"javaPackage\":\"io.github.ppissias.xsrpcj.example.simple\",\n\t\t\t\"services\":[\n\t\t\t\t{\"serviceName\":\"search\", \"requestType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.SearchPersonRequest\", \"responseType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.SearchPersonResponse\" },\n\t\t\t\t{\"serviceName\":\"notify\", \"requestType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.PersonNotificationRequest\", \"responseType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.PersonNotificationResponse\" , \"callbackType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.SearchPersonResponse\" }\n\t\t\t]\n\t\t}\t\t\n\t]\n\t} \n\n\n\n\nServices are grouped into Servers. Each server implements a set of services and listens on a specific TCP port.\nIn the example above, we define 2 services realized by a server named \"Persons\". \n\nLets look closer at the definition file, each **server** has : \n\n- a **name**, **port** and **javaPackage**: the name is used to identify the server (this will be used for the generation of the name of the method in both the client and server APIs, in combination with the service name) and the port will be the default listen port. The javaPackage is used to define the base package for the generated code.\n\nand each **service** definition has :\n\n - a **serviceName**: Used to identify the service \n\n - a **request type**: This is the data type that is sent to the server when invoking the service (the request data)\n\n - an **optional response type**: This is the data type we get back as a reply when invoking the service\n\n - an **optional callback type**: This is the data type we get back asynchronously from time to time as a result of invoking the service\n\n  \n### Code generation\n\nafter invoking the xsrpcj code generator for a service description file, we will get a server-side API and a client-side API. \n\n\n**Client Side API**\n\nFor the client-side we will get an interface \u0026 its implementation for each Server, which is all we need to start invoking services.\n\nFor the example above we will get  a client side interface:\n\n    public interface PersonsClientService {\n\n\t\tpublic SearchPersonResponse search(SearchPersonRequest request) throws RemoteCommunicationsException;\t\t\n\t\t\n\t\tpublic PersonNotificationResponse notify(PersonNotificationRequest request) throws RemoteCommunicationsException;\n\t}\t\t\n\t\t\n\n\t\t\n\n\nand its implementation (which implements the low level RPC and encoding stuff).  \n\n\nThe way to start invoking services is :\n\n \n\t\t//get a service reference\n\t\tPersonsClientService serverRef = new PersonsClientServiceImpl(serverHost, cbHandler);\t\t\t\n\n\t\t\n\t\t//now we can use it to make calls on the server\n\t\t\n\t\t//request / response call\n\t\tSearchPersonResponse resp = serverRef.search(....);\n\t\t\n\t\t//request / response / callback call\n\t\tPersonNotificationResponse notResp = serverRef.notify(....);\n\n\t\t\t\t\t\nNotice that we need to pass a \"callback handler\" (`cbHandler`) when we instantiate `ExampleClientServiceImpl`. We need to do this for each service that implements a callback, as we need to provide a handler for the asynchronous callback messages. \n\nIn our particular case, we only have 1 service with a callback, so we need to provide just 1 callback handler. \n\nThe callback handler needs to implement an interface which defines a method able to process the callback  messages. In our particular example it looks like:\n\n    public interface PersonsNotifyClientCallback {\n\t\tpublic void notifyCallback(SearchPersonResponse cb);\n\t}\n\n\nThe naming convention comes from the Server and Service name descriptions, which can be as small and simple as you like, or long if you like detailed names.     \n\nBesides the callback, we pass an additional argument, `serverHost` which is the host where the service is implemented (we can also pass a port argument, if the server listens on a different port than the default)\n\n    ExampleClientService serverRefDefaultPort = new ExampleClientServiceImpl(\"localhost\", cbHandler);\n    \t\nEven though the service description already has a predefined port, on the client side we have the flexibility to override this setting.:\n\n    ExampleClientService serverRef = new ExampleClientServiceImpl(\"localhost\", 22100, cbHandler);\n    \n\n**Server side API**\n  \nOn the server side, we of course need to start the server. \n\n\t\tPersonsServerService serviceImplementation = new PersonsServerService() {\n\t\t\t//interface implementation\n\t\t\t//here you implement the actual service\n\t\t};\n\t\t\n\t\t//start on default port\n\t\tnew PersonsServer(serviceImplementation).start();\n\n\t\t//start on other port than the pre-defined\n\t\t//new PersonsServer(serviceImplementation, 22123).start();\n\nWe can use the default port, or use a custom port by invoking another constructor. Everything is automatically generated except the `serviceImplementation`, which is the actual implementation of your service. \n\nLets look at the generated interface that you need to implement. \n\n    public interface PersonsServerService {\n\n\t\tpublic SearchPersonResponse search(SearchPersonRequest request);\t\t\n\t\t\n\t\tpublic PersonNotificationResponse notify(PersonNotificationRequest request, PersonsNotifyServerCallback callback);\t\n\t}\n\t\t\n\n\t\t\nIt is the kind of interface that you would expect, according to the service description. Notice that you receive a callback object on method `notify` that you can use in order to send asynchronously responses to the caller. The underlying implementation is automatically generated and will route back the reply to the client callback handler on the client side. \n\nThat's it ! \n\nYou can see the full example source code here for the \n\n - .proto message definition file : [SearchMessages.proto](https://github.com/ppissias/xsrpcj-examples/blob/master/xsrpcj-simple/src/main/proto/SearchMessages.proto)\n  - service description file : [service-desc.json](https://github.com/ppissias/xsrpcj-examples/blob/master/xsrpcj-simple/src/main/proto/service-desc.json)\n - Client Implementation : [SearchExampleServer.java](https://github.com/ppissias/xsrpcj-examples/blob/master/xsrpcj-simple/src/main/java/SearchExampleServer.java) \n - Server Implementation : [SearchExampleClient.java](https://github.com/ppissias/xsrpcj-examples/blob/master/xsrpcj-simple/src/main/java/SearchExampleClient.java)\n\n  \n## Examples\n\nDownload the xsrpcj examples project (https://github.com/ppissias/xsrpcj-examples) which contains several examples on using xsrpcj.\n\n\n## Compiling\n\n \nafter downloading the repository, go to the home directory and type\n\n    mvn clean compile assembly:single\n\nThis command will compile everything and assemble it as a single executable jar (named xsrpcj-1.0.0-jar-with-dependencies.jar). You can then use the produced .jar file (see section below) in order to generate your RPC code.  You can also use it through ant and maven (see sections below).\nIf you plan to use the generator via Maven, then optionally you can compile it for your local repository\n\n    mvn clean install\n\n## Using the generator \nThe generator can be used in 2 ways: \n\n - by running the produced .jar and providing the required arguments\n\t - maven, ant \u0026 gradle integration is easy (see next chapters)\n - programatically by invoking a static method\n \n\nLets see all of them in detail: \n\n### running the produced .jar manually\nFirst of all you need to define an environment variable named `PROTOC_PATH` pointing to the protoc compiler executable full path  (i.e. `PROTOC_PATH = /path/to/protoc` )\n\nThen you can invoke the code generator\n\n\n    java -jar xsrpcj-1.0.0-jar-with-dependencies.jar\n    \n    expected arguments: [-client] [-server] [-infrastructure] \u003csource generation path\u003e \u003cservice-description-file\u003e\n\n**No matter how you invoke the generator (manually, programatically, maven, ant, ...) the following example usage applies. There are examples on how to invoke the generator programmatically and via ant / maven in the next sections.**\n    \n### Example Usage\nfor example assuming that you have the following service description file in `proto/service-description.json`\n\n    {\n\t\"servers\":[\n\t \t{\n\t\t\t\"name\": \"Persons\",\n\t\t\t\"port\": \"22100\",\n\t\t\t\"javaPackage\":\"io.github.ppissias.xsrpcj.example.simple\",\n\t\t\t\"services\":[\n\t\t\t\t{\"serviceName\":\"search\", \"requestType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.SearchPersonRequest\", \"responseType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.SearchPersonResponse\" },\n\t\t\t\t{\"serviceName\":\"notify\", \"requestType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.PersonNotificationRequest\", \"responseType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.PersonNotificationResponse\" , \"callbackType\":\"io.github.ppissias.xsrpcj.example.simple.SearchMessages.SearchPersonResponse\" }\n\t\t\t]\n\t\t}\t\t\n\t], \n\t\"infrastructure\" : {\n\t\t\"javaPackage\":\"io.github.ppissias.xsrpcj.example.simple.comms\",\n\t\t\"logging\":\"System\"\n\t}\n\t}\t \n\n\n\nwhen you invoke the code generator with the following arguments: \n\n        java -jar xsrpcj-1.0.0-jar-with-dependencies.jar -server -client -infrastructure src proto/service-desc.json \n\n\nIt will generate the required code for the server, client and the common infrastructure files (used for the low level communication). The infrastructure files (`infrastructure` section in the JSON file) are needed only once, so if you generate multiple services on the same application you do not need to generate them again and again. \n\nIt will generate all source code under the `src` directory according to the `proto/service-desc.json` service description.\n\n**Generated files in detail**\n\nBefore the generation we started with the following file structure\n\n    \n    src\n\t    main\n\t        java\n\t        |   |    SearchExampleClient.java \t- client logic (using the generated code)\n\t        |   |    SearchExampleServer.java \t- server implementation (using the generated code)\n            |   io\n            |   \tgithub\n            |   \t\tppissias                        \n            |       \t\txsrpcj\n            |           \t\texample\n            |               \t\tsimple\n            |                       \tSearchMessages.java -generated by protoc from SearchMessages.proto \t           \n\t        proto\n\t                SearchMessages.proto\t\t-our message definition file for the services\n\t                service-desc.json \t\t\t-service description\n\nafter invoking the generator as\n\n    java -jar xsrpcj-1.0.0-jar-with-dependencies.jar -server -client -infrastructure src proto/service-desc.json\n\n we will have\n\n    src\n        main\n            java\n            |   |   SearchExampleClient.java\n            |   |   SearchExampleServer.java\n            |   |\n            |   io\n            |   \tgithub\n            |   \t\tppissias                        \n            |       \t\txsrpcj\n            |           \t\texample\n            |               \t\tsimple\n            |                   \t\t|   SearchMessages.java\n            |                  \t\t\t|\n            |                   \tclient\t-Client generated code \n            |                   \t\t|       PersonsClientService.java\t\t-Client service interface\n            |                   \t\t|       PersonsClientServiceImpl.java\t-Client service implementation\n            |                   \t\t|       PersonsNotifyClientCallback.java\t-Client callback interface (to be implemented as a handler) \n            |                   \t\t|\n            |                   \tcomms\t\t-Infrastructure code (low level RPC implementation) \n            |                   \t\t|       ClientReplyHandler.java\n            |                   \t\t|       DataHandler.java\n            |                   \t\t|       ErrorHandler.java\n            |                   \t\t|       RemoteCommunicationsErrorType.java\n            |                   \t\t|       RemoteCommunicationsException.java\n            |                   \t\t|       ServiceProxy.java\n            |                   \t\t|       SocketDataTransceiver.java\n            |                   \t\t|       SocketDataTransceiverReaderThread.java\n            |                   \t\t|\n            |                   \tserver\t-Server Generated code\n            |                   \t\t|       PersonsClientHandler.java\t\t-Internal class handling client requests\n            |                   \t\t|       PersonsNotifyServerCallback.java\t-Server callback interface (implementations of this interface are provided in method calls)\n            |                   \t\t|       PersonsServer.java\t-The class we use to start the server \n            |                   \t\t|       PersonsServerService.java\t\t-The Server service interface, needs to be implemented in order to define the logic of our services \n            |                   \t\t|\n            |                   \ttypes\t\t-Internal data types\n            |                           \t\tPersons.java\t-Generated Data types from PersonsMessageContainer.proto\n            |\n            proto\n                    PersonsMessageContainer.proto\t-Generated (and compiled) internal .proto file. It contains an envelope (packet) that carries the messages from our services\n                    SearchMessages.proto\n                    service-desc.json\n\n\nYou can navigate the [example source code](https://github.com/ppissias/xsrpcj-examples/tree/master/xsrpcj-simple) to see the content of the files in detail.  \nYou don't need to know the contents of each file, you are guided in what you need to implement by trying to use the client and server side code. \n\n### Implementing the client side\n\nwhen you try to use the generated code in order to invoke services, for example: \n\n    PersonsClientService serverRef = new PersonsClientServiceImpl( ... ) \n    serverRef.search( ... ) \nyou will notice that the constructor of the service implementation (`PersonsClientServiceImpl`):\n\n    PersonsClientServiceImpl(String host, PersonsNotifyClientCallback clientnotifyCallback)\nrequires a callback handler (`PersonsNotifyClientCallback`) that you need to implement. \n \n### Implementing the server side\n\nwhen you try to start the server: \n\n    new PersonsServer( ...).start()\n\n  you will notice that the constructor of the `PersonsServer` :\n\n      public PersonsServer(PersonsServerService serviceHandler)\nrequires an implementation of the `PersonsServerService` , which defines the service logic. \n\nIn this example, these are the only things you need to do. \n\n### running the generator programatically\nyou can invoke the generator by calling the static method\n\n    XsRPCJGenerator.generate\nwhich takes the following arguments:\n\n    public synchronized static void generate(\n\t    boolean generateClientFiles,  //same as -client : indicating if we will generate the client code\n\t    boolean generateServerFiles, //same as -server : indicating if we will generate the server code\n    \tboolean generateInfrastructureFiles, //same as -infrastructure : indicating if we will generate the infrastructure code\n    \tString jsonFile,  //full or relative path to the service description JSON file\n    \tString sourcePath, //the source path top level directory, where all source code will be generated, i.e. /path/to/src \n    \tString protocPath //the full path to the protoc executable \n    \t)\n\n  \n## Maven and ant integration \n\n  \n### Ant integration\nBelow is a simple ant task that calls the generator\n\n\t\u003cproperty name=\"src.dir\" location=\"src\" /\u003e\n\t\u003cproperty name=\"proto.src.dir\" location=\"proto\" /\u003e\t\n\n\t\u003c!-- define classpath --\u003e\n\t\u003cpath id=\"compile.rpc.classpath\"\u003e \n\t\t\u003cfileset dir=\"/path/to/xsrpcj\"\u003e \u003c!-- xsrpc generator jar with dependencies --\u003e\n\t\t\t\t\u003cinclude name=\"*.jar\" /\u003e\n\t\t\u003c/fileset\u003e\t\t\t\n\t\u003c/path\u003e\n\t\n\t\u003c!-- define target--\u003e\n\t\u003ctarget name=\"generateRPC\"\u003e\t\t\n\t\t\u003cjava classname=\"io.github.ppissias.xsrpcj.XsRPCJGenerator\" fork=\"true\"\u003e\n\t\t\n\t\t  \t\u003carg value=\"-server\"/\u003e\n\t\t\t\u003carg value=\"-client\"/\u003e\n\t\t\t\u003carg value=\"-infrastructure\"/\u003e\n\t\t\t\u003carg value=\"${src.dir}\"/\u003e\n\t\t\t\u003carg value=\"${proto.src.dir}/service-desc.json\"/\u003e\n\t\t\t\n\t\t\t\u003cclasspath\u003e\n\t\t\t\t\u003cpath refid=\"compile.rpc.classpath\" /\u003e \n\t\t\t\u003c/classpath\u003e\n\t\t\u003c/java\u003e\n\t\u003c/target\u003e\n\n\n### Maven integration\n\nYou can check the examples (https://github.com/ppissias/xsrpcj-examples) in order to see a pom.xml that uses xsrpcj.\n\nIn short:  \n\n\t\n\t\u003cproperties\u003e\n\t    \u003cproject.build.sourceProtoDirectory\u003e${project.basedir}/src/main/proto\u003c/project.build.sourceProtoDirectory\u003e\t\n\t\u003c/properties\u003e\n\n\t\u003cdependencies\u003e\n\t\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eio.github.ppissias\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003exsrpcj\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e1.0.0\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n\n\t\t...\n\t\t\n\t\u003c/dependencies\u003e\n\t\n\t\u003cbuild\u003e\n\t\t\u003csourceDirectory\u003esrc/main/java\u003c/sourceDirectory\u003e\n\t\t.... \n\n\t\t\t\t\u003cplugin\u003e\n\t\t\t\t\t\u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n\t\t\t\t\t\u003cartifactId\u003eexec-maven-plugin\u003c/artifactId\u003e\n\t\t\t\t\t\u003cversion\u003e1.6.0\u003c/version\u003e\n\t\t\t\t\t\u003cexecutions\u003e\n\n\t\t\t\t\t\t\u003c!--  generate RPC code \u0026 compile the generated .proto file --\u003e\n\t\t\t\t\t\t\u003cexecution\u003e\n\t\t\t\t\t\t\t\u003cid\u003egenerate RPC stubs\u003c/id\u003e\n\t\t\t\t\t\t\t\u003cphase\u003egenerate-sources\u003c/phase\u003e\n\t\t\t\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\t\t\t\u003cmainClass\u003eio.github.ppissias.xsrpcj.XsRPCJGenerator\u003c/mainClass\u003e\n\t\t\t\t\t\t\t\t\u003carguments\u003e\n\t\t\t\t\t\t\t\t\t\u003cargument\u003e-server\u003c/argument\u003e\n\t\t\t\t\t\t\t\t\t\u003cargument\u003e-client\u003c/argument\u003e\n\t\t\t\t\t\t\t\t\t\u003cargument\u003e-infrastructure\u003c/argument\u003e\n\t\t\t\t\t\t\t\t\t\u003cargument\u003e${project.build.sourceDirectory}\u003c/argument\u003e\n\t\t\t\t\t\t\t\t\t\u003cargument\u003e${project.build.sourceProtoDirectory}/service-desc.json\u003c/argument\u003e\n\t\t\t\t\t\t\t\t\u003c/arguments\u003e\n\t\t\t\t\t\t\t\u003c/configuration\u003e\n\t\t\t\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\t\t\t\u003cgoal\u003ejava\u003c/goal\u003e\n\t\t\t\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\t\t\u003c/execution\u003e\n\n\t\t\t\t\t\u003c/executions\u003e\n\t\t\t\t\u003c/plugin\u003e\n  \n\n\n## Contributing\n\n  \n\nPlease feel free to extend the project!\n\n  \n\n## License\n\n  \n\nThis project is licensed under the MIT License (https://opensource.org/licenses/MIT)\n- see the [LICENSE](LICENSE) file for details\n\n\n  \n\n## Acknowledgments\n\n  \n\n* Thanks to the protocol buffers developers, the velocity engine developers and the gson developers ! \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppissias%2Fxsrpcj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppissias%2Fxsrpcj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppissias%2Fxsrpcj/lists"}