8.2.1 Procedure for executing the sample program for an RMI connection custom adaptor

This subsection explains the procedure for executing the sample program for an RMI connection custom adaptor. Four console windows are used in this procedure. The individual console windows that are used are indicated below in parentheses (( )). Open and run a new console window as needed.

  1. Move to the working directory (console window 1).

    cd working-directory

  2. Copy the entire directory installation-directory\samples\api\, including the sample program, and place it directly under the working-directory (console window 1).
    If you have already built a sample environment under the working-directory, this step and step 3 are not required. Proceed to step 4.

    xcopy /EY installation-directory\samples\api .\samples\api\

  3. Copy the sample program's conf directory and its entire contents to the conf directory directly under the working directory (console window 1).
    Any property files that are already in working-directory\conf will be overwritten. If you want to save them, copy them to another directory before you perform this step.

    xcopy /Y samples\api\conf .\conf\

  4. Compile the source files (console window 1).
    The source files must be compiled in an environment in which you can execute the javac command.

    javac# -classpath installation-directory\lib\sdp.jar samples\api\src\samples\RMI*.java

    #
    Define the required environment variables before you compile as described in 6.5 Compilation procedure. Alternatively, specify the path for the environment variables in the javac command.

  5. Start the SDP server (console window 1).
    By default, the SDP server port number is assumed to be 20400.
    To change the port number, change the value of the rmi.serverPort property in working-directory\conf\system_config.properties before starting the server.

    .\bin\sdpstart

  6. Register a query group (streams and queries) (console window 2).
    Open a new console window and move to the working directory.

    cd working-directory

    Then, execute the following command:

    .\bin\sdpcql RMI_QueryGroupTest

  7. Start the query group (console window 2).

    .\bin\sdpcqlstart RMI_QueryGroupTest

  8. Start the data reception application (console window 3).
    Open a new console window and move to the working directory.

    cd working-directory

    Then, execute the command shown below. For the -clientcfg option, specify the JavaVM options file for RMI connections provided with the sample program.

    .\bin\sdpstartap -clientcfg .\conf\jvm_client_options.cfg samples.RMI_ReceiveTupleTest

  9. Start the data transmission application (console window 4).
    Open a new console window and move to the working directory.

    cd working-directory

    Then, execute the command shown below. For the -clientcfg option, specify the JavaVM options file for RMI connections provided with the sample program.

    .\bin\sdpstartap -clientcfg .\conf\jvm_client_options.cfg samples.RMI_SendTupleTest

  10. Check the execution result (console window 3).
    Confirm that the values 0 to 9 are displayed as the values for ID1, VAL1, and VAL2 in the console window (console window 3) in which you started the data reception application.

    Get Data:ID1=0, VAL1=data1:0, VAL2=data2:0, TIME=...
    Get Data:ID1=1, VAL1=data1:1, VAL2=data2:1, TIME=...
    Get Data:ID1=2, VAL1=data1:2, VAL2=data2:2, TIME=...
    :
    Get Data:ID1=9, VAL1=data1:9, VAL2=data2:9, TIME=...

  11. Stop the query group (console window 2).

    .\bin\sdpcqlstop RMI_QueryGroupTest

  12. Stop the SDP server (console window 2).

    .\bin\sdpstop