In this lab session you are required to produce a beep sound generation service using Java RMI. Client applications must first locate a factory finder object, via the RMI Registry that returns a reference to a factory object. The client application should then instruct the factory object to create and activate an instance of a BeepGenerator server object. The BeepGenerator object should support a sound generation service that can output a given number of beeps upon the receipt of requests from the client application. By relying on factories to create server object instances, we introduce an extra layer of transparency for the creation and location of a server object. All classes should be implemented in Java.
You will require the BeepGenerator and BeepGeneratorServer files produced during the previous RMI lab session, available here:
/cs/research/sse/home0/rigel/ucaccac/public_html/rmifactory
For the development of above described system follow the below instructions:
The BeepGeneratorFactory interface must declare the createBeepServer method, which returns a reference to a newly created instance of a BeepGenerator object.
The BeepGeneratorFactoryFinder interface must declare the findBeepGeneratorFactory (returns a BeepGeneratorFactory object) method that will locate a suitable factory capable of creating BeepGenerator objects.
The BeepGeneratorFactorys createBeepServer method should be capable of generating a new BeepGeneratorServer and returning a reference to it (through the BeepGenerator interface). The Factorys servant process should register an instance of the Factory with the local registry under the address //localhost/BeepGeneratorFactory using the java.rmi.Naming.rebind method.
Upon request an instance of BeepGeneratorFactoryFinderServer will find and return a reference to a BeepGeneratorFactory object via the Java RMI Registry. Instances of BeepGeneratorFactoryServer create and activate instances of BeepGeneratorServer upon request.
The BeepGeneratorFactoryFinder servant process should register an instance of the factory finder with the local registry under the address //localhost/BeepGeneratorFactoryFinder.
grant {permission java.security.AllPermission;};
Note that this grants total access to the application and should only be used for the purposes of this exercise.
You will be required to launch your applications as follows:
prompt> java -Djava.security.policy=policy.txt ClassName