< prev index next >

test/java/rmi/reliability/juicer/AppleUserImpl.java

Print this page




  38  * an ApplicationServer, is started which looks up the recently
  39  * bound AppleUser object.  This server is either started up in
  40  * the same VM or can optionally be started in a separate VM on the
  41  * same host or on a different host. When this test is run on the
  42  * RMI profile, ApplicationServer must be started by AppleUserImpl
  43  * and the complete juicer runs in a single process.
  44  *
  45  * The second server process instructs the AppleUserImpl to "use" some apples.
  46  * AppleUserImpl creates a new thread for each apple.  These threads
  47  * initiate the two party recursion.
  48  *
  49  * Each recursive call nests to a depth determined by this
  50  * expression: (2 + Math.abs(random.nextInt() % (maxLevel + 1)),
  51  * where maxLevel is a command line parameter.  Thus each recursive
  52  * call nests a random number of levels between 2 and maxLevel.
  53  *
  54  * The test ends when an exception is encountered or the stop time
  55  * has been reached.
  56  *
  57  * @library ../../testlibrary




  58  * @build TestLibrary
  59  *     Apple AppleEvent AppleImpl
  60  *     Orange OrangeEcho OrangeEchoImpl OrangeImpl
  61  *     ApplicationServer
  62  *
  63  * @run main/othervm/policy=security.policy AppleUserImpl -seconds 30
  64  *
  65  * @author Peter Jones, Nigel Daley
  66  */
  67 
  68 import java.rmi.NoSuchObjectException;
  69 import java.rmi.RemoteException;
  70 import java.rmi.registry.LocateRegistry;
  71 import java.rmi.registry.Registry;
  72 import java.rmi.server.UnicastRemoteObject;
  73 import java.util.Random;
  74 import java.util.logging.Level;
  75 import java.util.logging.Logger;
  76 
  77 /**




  38  * an ApplicationServer, is started which looks up the recently
  39  * bound AppleUser object.  This server is either started up in
  40  * the same VM or can optionally be started in a separate VM on the
  41  * same host or on a different host. When this test is run on the
  42  * RMI profile, ApplicationServer must be started by AppleUserImpl
  43  * and the complete juicer runs in a single process.
  44  *
  45  * The second server process instructs the AppleUserImpl to "use" some apples.
  46  * AppleUserImpl creates a new thread for each apple.  These threads
  47  * initiate the two party recursion.
  48  *
  49  * Each recursive call nests to a depth determined by this
  50  * expression: (2 + Math.abs(random.nextInt() % (maxLevel + 1)),
  51  * where maxLevel is a command line parameter.  Thus each recursive
  52  * call nests a random number of levels between 2 and maxLevel.
  53  *
  54  * The test ends when an exception is encountered or the stop time
  55  * has been reached.
  56  *
  57  * @library ../../testlibrary
  58  * @modules java.rmi/sun.rmi.registry
  59  *          java.rmi/sun.rmi.server
  60  *          java.rmi/sun.rmi.transport
  61  *          java.rmi/sun.rmi.transport.tcp
  62  * @build TestLibrary
  63  *     Apple AppleEvent AppleImpl
  64  *     Orange OrangeEcho OrangeEchoImpl OrangeImpl
  65  *     ApplicationServer
  66  *
  67  * @run main/othervm/policy=security.policy AppleUserImpl -seconds 30
  68  *
  69  * @author Peter Jones, Nigel Daley
  70  */
  71 
  72 import java.rmi.NoSuchObjectException;
  73 import java.rmi.RemoteException;
  74 import java.rmi.registry.LocateRegistry;
  75 import java.rmi.registry.Registry;
  76 import java.rmi.server.UnicastRemoteObject;
  77 import java.util.Random;
  78 import java.util.logging.Level;
  79 import java.util.logging.Logger;
  80 
  81 /**


< prev index next >