Here is a description of all the code in the GMSEC message sender. Now the user can send messages between two tools.
Main Classes:
PublisherMain? --> This is the Main class for the publisher. It is what will be linked to the executable to run when an icon is selected on the desktop. It calls the PublishGui? to ask the publisher their computer name, the location of the MBServer (IP address) and asks them to select the ephemeris file to be sent. The PublishGui? then calls the PublisherMain? class method FileAnnouncement? to run three threads (NotifyPublisher?, DecisionSubscriber? & EphemerisReply?).
SubscriberMain? --> This is the Main class for the subscriber. It is what will be linked to the executable to run when an icon is selected on the desktop. It calls the SubscribeGui? to ask the subscriber their computer name and the location of the MBServer (IP address). The SubscribeGui? then calls the NotifySubscriber? to subscribe to the notification subject on a new thread. (A threading error was discovered in this section of code. Originally the AWT-Event thread from the first GUI was being used to subscribe and wait forever for a message. This prevented the AWT-Event thread from being used to pop up the notifierGui. It was necessary to create a new thread which subscribed to the subject so that the AWT-Event thread would be free to be used for the other GUIs in the program.
Publisher Classes:
PublishGui? --> This class will create the GUI to get the location of the new ephemeris file that has been created and pass the information into the FileAnnouncement? method in the PublisherMain? class which creates threads to send out the notification.
NotifyPublisher? --> Publishes the notification message on the subject("GMSEC.GMAT.NOTIFY.MSG.LOG") which lets the subscribers know there is a new ephemeris file avaliable to be requested. Need to put in the Publisher name, ephemeris file name and location, and the fact that is an Ephemeris Notifier.
GuiNotifier? --> This file is called by NotifySubscriber?. It creates and pops up the GUI which askes if the user would like to request the file or not. Based on the user's selection the GuiNotifier? calls the method PublishDecisionMessage? contained in the NotifySubscriber? to publish a log message with the decision the user has made. If the user selects yes then EphemerisRequest? is called to publish the product request message.
DecisionSubscriber? --> This file subscribes to the decision subject("GMSEC.GMAT.DECISION.MSG.LOG"). The file creator is then notified of the subscribers' decision by a decision GUI which is created by the DecisionSubscriber? when it receives the decision log message.
EphemerisReply? --> This file subscribes to the general request subject ("GMSEC.GMAT.REQUEST.MSG.PROD.>")and replies with the ephemeris product message when a request is sent. Needs to contain the computer name of the replier, the file name, and the text file location.
Subscriber Classes
SubscribeGui? --> The SubscribeGui? pops up a GUI that will ask the user to enter a computer name and location of the MBServer and will then will call the SubscriberMain? method Subscribe to subscribe to the Notification subject.
NotifySubscriber? --> This file subscribes to the notification subject ("GMSEC.GMAT.NOTIFY.MSG.LOG") and when it receives the notification log message it calls the GuiNotifier? to create and pop up the notification GUI which alerts the user that a new ephemeris file has been created. It also contains the PublishDecisionMethod? which sends a log message to the file creator with the subscribers' decision to request the file or not. PublishDecisionMethod? needs to contain the computer name of the subscriber, the file and the subscriber's decision.
EphemerisRequest? --> Sends a request over the computer specific subject ("GMSEC.GMAT.REQUEST.MSG.PROD.COMPUTERNAME"). The last field of the subject is dependant on the subscriber. The replier listens to every computer that publishes under the main subject and returns a reply only on the request subject. Needs to contain the computer name which is requesting the file and the file name.
How to Run:
Run Publisher --> Install code, then open the ODTBX directory and click on the publisher.bat file.
Run Subscriber --> Install code, then open the ODTBX directory and click on the subscriber.bat file.
Return to: [GmsecDocuments]