RPCServer

public class RPCServer

An RPC server for remote control of the simulation over a network socket.

Author:Kyle M. Douglass

Fields

handler

public static RemoteSimulationServiceHandler handler

processor

public static RemoteSimulationService.Processor processor

Constructors

RPCServer

public RPCServer(IJPluginModel model, int port)

Creates a new RPCServer and initializes–but does not start–it.

Parameters:
  • model – A model of a microscope to simulate.
  • port – The port number for server communications.

RPCServer

public RPCServer(Microscope microscope, int port)

Creates a new RPCServer and initializes–but does not start–it.

Parameters:
  • microscope – An instance of a microscope to simulate.
  • port – The port number for server communications.

RPCServer

public RPCServer(SimulationManager manager, int port)

Creates a new RPCServer and initializes–but does not start–it.

Parameters:
  • manager – An instance of a simulation manager.
  • port – The port number for server communications.

Methods

isServing

public boolean isServing()

Checks the status of the server.

Returns:Is the server running? (true or false)

main

public static void main(String[] args)

Main function used for testing the RPC server.

Parameters:
  • args

serve

public void serve()

Starts the server.

simple

public static void simple(RemoteSimulationService.Processor processor)

stop

public void stop()

Stops the server.