This interface provides both
Serializable and
Runnable. It is often used in conjunction with
VM.invoke(Runnable).
public void testRegionPutGet() {
final Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
final String name = this.getUniqueName();
final Object value = new Integer(42);
vm0.invoke(new SerializableRunnable("Put value") {
public void run() {
...// get the region //...
region.put(name, value);
}
});
vm1.invoke(new SerializableRunnable("Get value") {
public void run() {
...// get the region //...
assertEquals(value, region.get(name));
}
});
}