Computer Engine Demo

The Compute Engine demo is included in the provided code for the Compute Engine assignment. 


Documentation for the Compute Engine assignment provided code


Click for full-size image
Compute Engine

The provided code includes fully operational demos for both the client and the engine server as executable JAR files in the provided.demo package.   See the Javadocs for that package for complete directions on how to run the demos and their capabilities.

It is an Honor Code violation to attempt to decompile the provided JAR files.

The demos are fully compliant with the required inter-computer API as defined by the provided.compute package.   Likewise, the provided sample tasks are API compliant.   The demo client, the demo engine and/or the provided sample tasks can thus all be used to test student solutions.    This will enable each piece of the project to be tested separately.   This is NOT, however, a substitute for the required testing with other students!  

Note: The demo client is only capable of loading ITask implementations that have a public static FACTORY field of type ITaskFactory.    The sample ITasks are pre-loaded into the demo client for convenience only (loaded by its controller -- not hardwired into the view or model!).

Use the demos as part of your development process:

One great advantage of having these fully operational demos at your disposal is that you can now completely separate the development of your client from your engine server from your custom tasks.  One of the goals of the project is to demonstrate how all these parts are completely decoupled, so that is exactly how you should structure your development process! 

 

MAKE SURE ALL THE REQUIRED PORTS ON YOUR COMPUTER ARE OPEN FIRST!!

Note that the JAR files do NOT contain any code for any tasks. All tasks are dynamically loaded, where the demos assume that the desired ITask implementation classes all have a public static field called FACTORY that is am ITaskFactory instance that will instantiate that ITask implementation.

Some tasks in the provided code are pre-loaded for your convenience. The demos are capable of loading and executing student-written tasks as well if the task class contains a public static FACTORY field as described above.

The demos should be capable of inter-operating with any student-written client or engine solutions and this can used for testing student solutions.

Student ITask implementations can be written separately from the student client or engine solutions and tested with the demo client and engine (Note that the demo client requires that an ITask be instantiatable by an ITaskFactory and that the ITaskFactory's make() method needs no more than a single String parameter.)

How to Run the Demos:

Note: The module-info.java file should look something like this:

module projectName {
   requires java.desktop;
   requires java.rmi;
   exports provided.compute;   
}

 

Starting the demos:

Start a client and an engine on the same or different computers. Note that either client or engine could be a student solution.

Connecting the client to an engine:

  1. On the client, enter the IP address of the engine computer (displayed on the engine GUI).
  2. Click the "Connect" button.
  3. Both the client and the engine will display messages from the other as well as connection status messages.

Testing connectivity:

Executing Tasks

Adding new tasks:

  1. On the client, type in the fully-qualified classname of a desired ITask implementation. The demo client assumes that the desired ITask class has a public static field called "FACTORY" that is the singleton instance of the ITaskFactory for that ITask implementation.
  2. Click the "Add to lists" button and the ITaskFactory will appear on the two drop-lists.

Running a task:

  1. Select the desired task to run from the top drop list.
  2. Type in an appropriate parameter for constructing the task.
  3. Click the "Run Task" button.
  4. Task results will appear on both the client and engine GUI's. The engine will display the raw task results. The client will display the task results as formatted by the task's ITaskResultFormatter object.

Combine tasks:

  1. Select the desired tasks from the top and bottom drop lists.
  2. Click the "Combine Tasks" button.
  3. The combined task will appear on the drop lists. Combined tasks are true binary composite tasks where the composite ("MultiTask") and the composees are all transmitted to the engine for execution as a single task. When the MultiTask runs, it indicates when the individual composees are run.

Quitting the Demos

Both the client and the engine have "Quit" buttons that will gracefully shut down their systems.