Question
Problem: Write the necessary code to implement the functionality as described below. The GUI may be implemented either in swing or in JavaFX. You need
Problem: Write the necessary code to implement the functionality as described below. The GUI may be implemented either in swing or in JavaFX.
You need to write two classes: Publisher and Subscriber.
A Subscriber object allows you to subscribe on a single topic: the user enters a topic name and clicks Subscribe. Any events that match this subscription will be displayed in the pane below the Subscribe button.
A specific Publisher object permits the user to publish events related to any topic. The user can specify a topic in the Topic field and describe the event in the Event field and then click Process. The event will be displayed in the pane of all Subject objects that have subscribed to this topic.
Remember: A specific Subject object can subscribe to only one topic. After the topic is selected, the Subscribe button is disabled. A Publisher object may publish any number of events, and each event can be assigned to exactly one topic.
Any number of Publisher and Subscriber objects may be instantiated. They should all be served via the JGroups package. Use JGroups version 4.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started