This example only works with ObjectSpace Voyager(tm).
Visit the Voyager homepage for more information.
try
{
// create a remote list
VSList list = new VSList( "localhost:8000" );
new VSListIterator(); // force class loading
// fill remote list
list.add( "yakko" );
list.add( "wakko" );
list.add( "dot" );
System.out.println( "lowercase = " + list );
// obtain a local iterator to the remote list
list.setVirtual( true );
ForwardIterator iterator = list.start();
list.setVirtual( false );
// change all elements in remote list to uppercase
while ( !iterator.atEnd() )
{
String current = (String)iterator.get();
iterator.put( current.toUpperCase() );
iterator.advance();
}
System.out.println( "uppercase = " + list );
}
catch ( VoyagerException ex )
{
System.err.println( "caught: " + ex );
}
Voyager.shutdown();