Package net.jini.space

Examples of net.jini.space.JavaSpace


                                        + "identical IDs");
            }
            eventIDs.add(id);
        }

        JavaSpace testSpace = (JavaSpace) er0.getSource();
        space.write(sampleEntry1, null, leaseForeverTime);
        SimpleEntry entry = (SimpleEntry) testSpace.readIfExists(sampleEntry1,
                                                                 null,
                                                                 instantTime);
        if (!sampleEntry1.equals(entry)) {
            throw new TestException("EventRegistration.getSource method "
                                    + "does not return a proper "
View Full Code Here


                                        + " identical IDs");
            }
            eventIDs.add(id);
        }

        JavaSpace testSpace = (JavaSpace) er0.getSource();
        space.write(sampleEntry1, txn, leaseForeverTime);
        SimpleEntry entry = (SimpleEntry) testSpace.readIfExists(sampleEntry1,
                                                                 txn,
                                                                 instantTime);
        if (!sampleEntry1.equals(entry)) {
            throw new TestException("EventRegistration.getSource method "
                                    + "does not return a proper "
View Full Code Here

        super.parse();
    }

    public void run() throws Exception {
        specifyServices(new Class[] {JavaSpace.class});
        final JavaSpace space = (JavaSpace) services[0];

        // Kick of read in a seperate thread
        ReadThread readThread = new ReadThread(space);
        readThread.start();
View Full Code Here

    public void run() throws Exception {
        specifyServices(new Class[] {JavaSpace.class});

        // Try to get space
        final JavaSpace space = (JavaSpace) services[0];
        logger.log(Level.INFO, "Got Space");

        for (int i = 0; i < numRestarts; i++) {
      addOutriggerLease(space.write(new UninterestingEntry(), null,
            Lease.FOREVER), true);
            logger.log(Level.INFO, "Wrote UninterestingEntry");

            // Shutdown the space
            logger.log(Level.INFO, "Trying shutDown()...");

      shutdown(0);

            // Trying to re-activate and read UninterestingEntry
            logger.log(Level.INFO,
           "trying to re-activate and read UninterestingEntry");

            if (activatable) {

                // try to read the entry we wrote
                String msg = "Expected space to re-activate after shutdown.\n"
                        + "Got : ";
                Entry en = null;

    en = space.takeIfExists(new UninterestingEntry(), null, 0);

                // Check for read the entry we wrote
                if (en == null) {
                    throw new TestException(
                            "Could not get entry we wrote before shutdown");
                }
            } else {
                try {
                    space.takeIfExists(new UninterestingEntry(), null, 0);
                    throw new TestException("Space did not go away");
                } catch (RemoteException e) {
                    // This is what we are looking for
                }
            }
View Full Code Here

        int dotInterval = numberToWrite / 80;

        if (dotInterval < 1) {
            dotInterval = 1;
        }
        final JavaSpace space = (JavaSpace) services[0];
        final Entry aEntry = new UninterestingEntry();
        logger.log(Level.INFO, "Beginning to write test entries");
        int l = 0;

  for (; l < numberToWrite; l++) {
      addOutriggerLease(space.write(aEntry, null, Lease.ANY), true);
     
      if (l % dotInterval == dotInterval - 1) {
    logger.log(Level.INFO, ".");
      }
  }
View Full Code Here

     * @exception TestException
     *          If an exception has been thrown during JavaSpace creation or
     *          created JavaSpace is null.
     */
    public JavaSpace getSpace() throws TestException {
        JavaSpace js = null;

        try {
            if (System.getSecurityManager() == null) {
                System.setSecurityManager(new RMISecurityManager());
            }
View Full Code Here

TOP

Related Classes of net.jini.space.JavaSpace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.