Package com.sun.jini.outrigger

Examples of com.sun.jini.outrigger.JavaSpaceAdmin


    }
    private static final int BLOCKING_FACTOR = 10;

    protected void scrubSpace(JavaSpace space) throws TestException {
        try {
            JavaSpaceAdmin admin = (JavaSpaceAdmin) ((Administrable)
                space).getAdmin();
      admin = (JavaSpaceAdmin)
        getConfig().prepare("test.outriggerAdminPreparer",
          admin);
            final AdminIterator i = admin.contents(null, null, BLOCKING_FACTOR);

            while (i.next() != null) {
                i.delete();
            }
            i.close();
View Full Code Here


        spaceSet();
        int count = 0;
        final List allEntries = ((JavaSpaceAuditor)
                space).getLoggedEntries(0);
        final List copyOfAllEntries = new LinkedList(allEntries);
        JavaSpaceAdmin admin = (JavaSpaceAdmin) ((Administrable)
                services[0]).getAdmin();
  admin = (JavaSpaceAdmin) getConfig().prepare("test.outriggerAdminPreparer",
                 admin);
        final AdminIterator i = admin.contents(null, null, 10);
        Entry weGot = i.next();

        while (weGot != null) {
            boolean accounted = false;
            final Template weGotTemplate = new Template(weGot);
View Full Code Here

            dumpUnusableEntryException(e);
      throw e;
        }

        // Use the Admin to make sure the space is really empty
        JavaSpaceAdmin admin = (JavaSpaceAdmin) ((Administrable)
                services[0]).getAdmin();
        admin =
      (JavaSpaceAdmin) getConfig().prepare("test.outriggerAdminPreparer",
             admin);
  final AdminIterator i = admin.contents(nullTemplate, null, 10);
 
  Entry entry = i.next();
 
  if (entry != null) {
      logger.log(Level.INFO, "Space is not empty after removing"
View Full Code Here

        spaceSet();
        int count = 0;
        final List allEntries = ((JavaSpaceAuditor)
                space).getLoggedEntries(0);
        final List copyOfAllEntries = new LinkedList(allEntries);
        JavaSpaceAdmin admin = (JavaSpaceAdmin) ((Administrable)
                services[0]).getAdmin();
  admin = (JavaSpaceAdmin) getConfig().prepare("test.outriggerAdminPreparer",
                 admin);
        final AdminIterator i = admin.contents(null, null, 10);
        Entry weGot = i.next();

        while (weGot != null) {
            boolean accounted = false;
            final Template weGotTemplate = new Template(weGot);
View Full Code Here

            dumpUnusableEntryException(e);
      throw e;
        }

        // Use the Admin to make sure the space is really empty
        JavaSpaceAdmin admin = (JavaSpaceAdmin) ((Administrable)
                services[0]).getAdmin();
        admin =
      (JavaSpaceAdmin) getConfig().prepare("test.outriggerAdminPreparer",
             admin);
  final AdminIterator i = admin.contents(nullTemplate, null, 10);
 
  Entry entry = i.next();
 
  if (entry != null) {
      logger.log(Level.INFO, "Space is not empty after removing"
View Full Code Here

        /*
         * Verify that the space is "clean". All written entries
         * should have been taken by this point.
         */
        JavaSpaceAdmin admin = (JavaSpaceAdmin) ((Administrable)
                space).getAdmin();
        admin = (JavaSpaceAdmin) getConfig().prepare("test.outriggerAdminPreparer",
                                                     admin);

        final AdminIterator it = admin.contents(null, null, 1);

        if (it.next() != null) {
            throw new TestException(
                    "Space was not empty upon termination.");
        }
View Full Code Here

    }
    private static final int BLOCKING_FACTOR = 10;

    protected void scrubSpace(JavaSpace space) throws TestException {
        try {
            JavaSpaceAdmin admin = (JavaSpaceAdmin) ((Administrable)
                space).getAdmin();
      admin = (JavaSpaceAdmin)
        getConfig().prepare("test.outriggerAdminPreparer",
          admin);
            final AdminIterator i = admin.contents(null, null, BLOCKING_FACTOR);

            while (i.next() != null) {
                i.delete();
            }
            i.close();
View Full Code Here

      shutdown(0);
            logger.log(Level.INFO, "success, restarting");
        }
        logger.log(Level.INFO, "Starting to delete entries using iterator");
        AdminIterator i;
        JavaSpaceAdmin admin;

  admin = (JavaSpaceAdmin) ((Administrable) space).getAdmin();
  admin =
      (JavaSpaceAdmin) getConfig().prepare("test.outriggerAdminPreparer",
             admin);
  i = admin.contents(aEntry, null, blockingFactor);
        int j = 0;

  while (next(i) != null) {
      delete(i);
      j++;
     
      if (j % dotInterval == dotInterval - 1) {
    logger.log(Level.INFO, ".");
      }
  }
 
  if (j < numberToWrite) {
      String msg = "\nCould not delete the number of entries we "
    + "wrote, only deleted " + j + " entries";
      throw new TestException(msg);
  } else if (j > numberToWrite) {
      String msg = "\nDeleted more entries than we wrote, deleted "
    + j + " entries";
      throw new TestException(msg);
  }
        logger.log(Level.INFO, "\nFinished deleting, closing iterator");
  i.close();
        logger.log(Level.INFO,
       "Opening new iterator to make sure space is empty");
  i = admin.contents(aEntry, null, blockingFactor);
        j = 0;

  while (next(i) != null) {
      j++;
     
View Full Code Here

TOP

Related Classes of com.sun.jini.outrigger.JavaSpaceAdmin

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.