{"id":16158368,"url":"https://github.com/ajaymahadeven/Message-Passing-System-using-GWT","last_synced_at":"2025-03-31T19:32:17.970Z","repository":{"id":158161957,"uuid":"610943530","full_name":"ajaymahadeven/Message-Passing-System-using-GWT","owner":"ajaymahadeven","description":"The purpose of this project is to showcase how to implement a message-passing system using Lamport clock time and total ordering of events, with communication among browser windows acting as independent processes.","archived":false,"fork":false,"pushed_at":"2023-03-14T22:23:27.000Z","size":41495,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T16:47:34.082Z","etag":null,"topics":["googlewebtoolkit","gwt","lamport-algorithm","lamport-clock"],"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/ajaymahadeven.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-07T19:48:26.000Z","updated_at":"2023-04-22T13:10:29.000Z","dependencies_parsed_at":"2023-07-12T21:01:23.445Z","dependency_job_id":null,"html_url":"https://github.com/ajaymahadeven/Message-Passing-System-using-GWT","commit_stats":null,"previous_names":["thenameisajay/message-passing-system-using-gwt","ajaymahadeven/message-passing-system-using-gwt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FMessage-Passing-System-using-GWT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FMessage-Passing-System-using-GWT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FMessage-Passing-System-using-GWT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FMessage-Passing-System-using-GWT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajaymahadeven","download_url":"https://codeload.github.com/ajaymahadeven/Message-Passing-System-using-GWT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246527457,"owners_count":20792069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["googlewebtoolkit","gwt","lamport-algorithm","lamport-clock"],"created_at":"2024-10-10T01:54:00.276Z","updated_at":"2025-03-31T19:32:17.962Z","avatar_url":"https://github.com/ajaymahadeven.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message Passing System using GWT\n\n## DESCRIPTION\n\u003cp\u003e\nThis project is a distributed system built using the \u003cstrong\u003e Google Web Toolkit (GWT) \u003c/strong\u003e technology. \nThe purpose of this project is to showcase how to implement a message-passing system using \u003cstrong\u003e Lamport clock time \u003c/strong\u003e\nand total ordering of events, with communication among browser windows acting as independent processes. \u003c/p\u003e\n\n---\n\n## Running the Application \n\u003col\u003e\n \u003cli\u003e To integrate the files with suitable IDE's follow the \u003ccode\u003e GWT_README \u003c/code\u003e text file. \n  \u003cli\u003e \u003cp\u003e After doing so , you can either attach an ANT build script to the \u003ccode\u003e source \u003c/code\u003e folder (or) open \n    terminal in the folder location and \u003ccode\u003e ant clean \u003c/code\u003e to clean any residual build files adn \u003ccode\u003e ant devmode \u003c/code\u003e to run the program in developer mode. \u003c/p\u003e\n\n---\n    \n## Functionality : \n    \n#### Client Code\n    In the client code, each node maintains a local clock using the variable \u003ccode\u003e'lamportClock'\u003c/code\u003e. The initial value of the clock is 0, and every time an event occurs, the node increments its local clock value by 1.\n\nThe Lamport clock algorithm is implemented in two places in the client code: when sending a message and when receiving a message.\n\nWhen sending a message, the local clock value is used as the timestamp of the message. Before sending the message, the \u003ccode\u003e serverLamport() \u003c/code\u003e method is called, which updates the local clock value based on the global clock value received from the server.\n\nThis ensures that the timestamp of the message is greater than any previously sent message. The message is then sent using the GWT RPC mechanism.\n\nWhen receiving a message, the local clock value is updated based on the global clock value received from the server using the \u003ccode\u003e serverLamport() \u003c/code\u003e method. This ensures that the local clock value is synchronized with the global clock value. The local clock value is then incremented by 1, and the message is processed.\n\nIn addition to the local clock value, each node maintains a process ID, which is used to identify the sender and receiver of the message. The process IDs are used as the second component of the timestamp.\n\n#### Server Code\n\nIn the server code, the Lamport clock algorithm is implemented in two methods:\n\n##### globalClock(int clientLamportTime)\nThis method takes an integer clientLamportTime as input and returns the server's Lamport time. It updates the server's Lamport time to be the maximum of the client's Lamport time and the server's current Lamport time plus one.\n\n ##### sendMessage(Message message)\nThis method takes a Message object as input and returns a string. It updates the message's Lamport time with the server's Lamport time, adds the message to the server's message list, and returns a confirmation string.\n    \n ---\n\n## CONTRIBUTION GUIDELINES :\n\u003col\u003e\n\u003cli\u003e Clone the repository from GitHub.\n\u003cli\u003e Create a new branch for your feature or bug fix.\n\u003cli\u003e Implement your feature or bug fix.\n\u003cli\u003e Commit your changes and push to your branch on the GitHub server.\n\u003cli\u003e Submit a merge request to merge your changes into the main branch.\n\u003c/li\u003e\n\u003c/ol\u003e\n\n---\n## LICENSE :\nThis project is done part of coursework of \u003cstrong\u003e CS4103 - Distributed Systems \u003c/strong\u003e of the \u003cstrong\u003e Computer Science Dept of University of St.Andrews.\u003c/strong\u003e\n\u003cp\u003e This project is licensed under the MIT License - see the \u003ccode\u003e LICENSE \u003c/code\u003e file for details. \u003c/p\u003e\n\n    \n    \n\n   \n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaymahadeven%2FMessage-Passing-System-using-GWT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajaymahadeven%2FMessage-Passing-System-using-GWT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaymahadeven%2FMessage-Passing-System-using-GWT/lists"}