Using InvokeClient

After InvokeClient initializes, the following options are displayed that allow you to perform actions on the space:

  • key invokes the user defined method on the space member that holds the tuple with a key of 1.
  • self invokes the user-defined method on the invoking member in the space (e.g. InvokeClient).
  • seeders invokes the user-defined method on all seeders in the space.
  • members invokes the user defined method on all members in the space.

Procedure

  • The Invocable interface is used when the key option is selected. The MemberInvocable interface is used when the self, seeders, or members option is selected.

    The purpose of the key option is to see that the user-defined method is invoked on the seeder that contains the entry with the key of 1. To see anything with the key option, you should start up two instances of ASOperations, using the -role seeder command line option, and put some entries into the space, making sure that you have an entry with a key of 1.

    When the example is run and the key option is selected, you will see the-user defined method of the Invocable interface run by the seeder that contains the entry with a key of 1.

    The purpose of the other options is to let you see how the user-defined implementation of MemberInvocable is called on different members of the space. The InvokeClient example joins the space as a leech. To see what happens when the user-defined method is invoked with these different options, start up two instances of ASOperations, using the -role seeder command line option, along with InvokeClient. In this case:

    • The self option should cause the user-defined method to be invoked on InvokeClient.
    • The seeders option should cause the user-defined method to be invoked on the other ASOperations instances.
    • The members option should cause the user-defined method to be invoked on InvokeClient and the other ASOperations instances.