FileDocCategorySizeDatePackage
Voyager4B.javaAPI DocExample1213Sat Sep 12 03:01:00 BST 1998None

Voyager4B

public class Voyager4B extends Object
Retrieve a persisted container.
version
3.0.0
author
ObjectSpace, Inc.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
This example only works with ObjectSpace Voyager(tm). Visit the Voyager homepage for more information.

    try
      {
      // connect to persistent map in server 8000
      VHashMap map = (VHashMap)VObject.forObjectAt("localhost:8000/JGL4");
      query( map, "Spider-Man" );
      query( map, "Mr. Fantastic" );
      map.dieNow(); // kill map, remove from database
      }
    catch ( VoyagerException ex )
      {
      System.err.println( "caught: " + ex );
      }

    Voyager.shutdown();
    
public static voidquery(VHashMap map, java.lang.String hero)

    Object name = map.get( hero );
    if ( name == null )
      System.out.println( hero + " is not in the database" );
    else
      System.out.println( hero + " is really " + name );