Examples of MailboxPullRegistration


Examples of net.jini.event.MailboxPullRegistration

  Object admin1 = getMailboxAdmin(mb1);
  Object admin2 = getMailboxAdmin(mb2);
  Object admin1_dup = null;

        // Get Mailbox registration references
  MailboxPullRegistration mr1 = getPullRegistration(mb1, DURATION);
  MailboxPullRegistration mr2 = getPullRegistration(mb2, DURATION);
  MailboxPullRegistration mr1_dup = null;

        // Get Mailbox lease references
  Lease mrl1 = getPullMailboxLease(mr1);
  Lease mrl2 = getPullMailboxLease(mr2);
  Lease mrl1_dup = null;
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

  PullEventMailbox mb = getPullMailbox();
  int i = 0;

  // Register and check lease
        Date gotLease = new Date();
  MailboxPullRegistration mr = getPullRegistration(mb, REG_LEASE);
  Lease mrl = getPullMailboxLease(mr);
  checkLease(mrl, REG_LEASE);

        // Get events and verify
  logger.log(Level.INFO, "Getting events from empty mailbox.");
        RemoteEventIterator rei = mr.getRemoteEvents();
        RemoteEvent rei_event;
        Date before = new Date();
  logger.log(Level.INFO, "Calling next() on empty set @ {0}", before);       
        try {
            rei_event = rei.next(REG_LEASE_WAIT);
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

  logger.log(Level.INFO, "Starting up " + this.getClass().toString());

  PullEventMailbox mb = getPullMailbox();
        logger.log(Level.INFO, "Got mailbox reference: {0}", mb);

  MailboxPullRegistration mr1 = getPullRegistration(mb, DURATION1);
        logger.log(Level.INFO, "Got mailbox registration reference: {0}", mr1);
       
        // Exercises MailboxPullRegistration.getLease()
  checkLease(getPullMailboxLease(mr1), DURATION1);
        logger.log(Level.INFO, "Checked mailbox lease");
       
  // Exercises MailboxPullRegistration.getListener()
  RemoteEventListener rel = getPullMailboxListener(mr1);
        logger.log(Level.INFO, "Got mailbox listener reference: {0}", rel);
       
        // Exercises mailbox listener re-submission which is not allowed
  try {
            mr1.enableDelivery(rel);
            throw new TestException("Successfully submitted service's "
                                  + "listener back to itself");
  } catch (IllegalArgumentException iae) {
            // ignore -- expected
  }
        logger.log(Level.INFO, "Unable to resubmit listener reference -- OK");
       
        // create new listener object
        rel =  TestUtils.createListener(manager);
        logger.log(Level.INFO, "Got test listener reference: {0}", rel);
       
        // submit listener
  mr1.enableDelivery(rel);
        logger.log(Level.INFO, "Enabled listener reference");
       
        // Exercise disableDelivery
  mr1.disableDelivery();
        logger.log(Level.INFO, "Disabled listener reference");
       
        // Exercises getRemoteEvents and next
  net.jini.event.RemoteEventIterator i = mr1.getRemoteEvents();
        logger.log(Level.INFO, "Got event iterator: {0}", i);    
       
  if (i.next(5000L) != null) {
      throw new TestException("Got event from empty registration");
  }
        logger.log(Level.INFO, "No received events -- OK");
       
        // Exercises addUnknownEvents with empty set
        Collection unkEvts = new ArrayList(3);
        mr1.addUnknownEvents(unkEvts);
        logger.log(Level.INFO, "Called addUnknownEvents with empty set.");
       
        //Exercise iterator close
        i.close();
        logger.log(Level.INFO, "Closed iterator");     
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

      EventMailbox mb = getMailbox();
      MailboxRegistration mr = getRegistration(mb, DURATION);
      mrl = getMailboxLease(mr);
  } else if (mbType.equals(PULL_MAILBOX_IF_NAME)) {
            PullEventMailbox mb = getPullMailbox();
      MailboxPullRegistration mr = getPullRegistration(mb, DURATION);
      mrl = getPullMailboxLease(mr);
  } else {
            throw new TestException(
    "Unsupported mailbox type requested" + mbType);
  }
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

  PullEventMailbox mb = getPullMailbox();
  int i = 0;

  // Register and check lease
        Date gotLease = new Date();
  MailboxPullRegistration mr = getPullRegistration(mb, REG_LEASE);
  Lease mrl = getPullMailboxLease(mr);
  checkLease(mrl, REG_LEASE);

        // Start canceler thread with a delay of REG_LEASE_CANCEL_WAIT
        Thread t =
            new Thread(
                new Registrar(mr, NEW_REG_WAIT, logger));
        t.start();
       
        // Get events and verify
  logger.log(Level.INFO, "Getting events from empty mailbox.");
        RemoteEventIterator rei = mr.getRemoteEvents();
        RemoteEvent rei_event;
        Date before = new Date();
  logger.log(Level.INFO, "Calling next() on empty set @ {0}", before);       
        try {
            rei_event = rei.next(REG_LEASE_WAIT);
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

    protected MailboxPullRegistration getPullRegistration(
        PullEventMailbox mb, long duration)
  throws RemoteException, TestException, ConfigurationException
    {
  MailboxPullRegistration mr = null;
  try {
       mr = mb.pullRegister(duration);
  } catch (LeaseDeniedException lde) {
       throw new TestException ("MailboxPullRegistration request was denied.");
  }
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

        PullEventMailbox mb2 = mbs[1];
  int i = 0;

  // Register and check lease
        Date gotLease = new Date();
  MailboxPullRegistration mr = getPullRegistration(mb, REG_LEASE);
  Lease mrl = getPullMailboxLease(mr);
  checkLease(mrl, REG_LEASE);

  MailboxPullRegistration mr2 = getPullRegistration(mb2, REG_LEASE);
//  Lease mrl2 = getPullMailboxLease(mr2);
//  checkLease(mrl2, REG_LEASE);
        RemoteEventListener mbRel2 = getMailboxListener(mr2);
       
       
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

  logger.log(Level.INFO, "Getting JavaSpace reference");
  JavaSpace space = (JavaSpace)services[1];

  // Register and check lease
  logger.log(Level.INFO, "Creating MailboxPullRegistration");
  MailboxPullRegistration mr =  getPullRegistration(mb, DURATION);
  checkLease(getPullMailboxLease(mr), DURATION);
  addLease(getPullMailboxLease(mr), false);
 
  // Create "listener" to collect events for this test
  TestPullListener tpl = TestUtils.createPullListener(manager);
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

      EventMailbox mb = getMailbox();
      MailboxRegistration mr = getRegistration(mb, DURATION);
      mrl = getMailboxLease(mr);
  } else if (mbType.equals(PULL_MAILBOX_IF_NAME)) {
            PullEventMailbox mb = getPullMailbox();
      MailboxPullRegistration mr = getPullRegistration(mb, DURATION);
      mrl = getPullMailboxLease(mr);
  } else {
            throw new TestException(
    "Unsupported mailbox type requested" + mbType);
  }
View Full Code Here

Examples of net.jini.event.MailboxPullRegistration

  Object admin = getMailboxAdmin(mb);
        DestroyAdmin dAdmin = (DestroyAdmin)admin;
        int i = 0;

  // Register and check lease
  MailboxPullRegistration mr = getPullRegistration(mb, DURATION1);
  Lease mrl = getPullMailboxLease(mr);
  checkLease(mrl, DURATION1);

        // Start event generator thread with a delay of MAX_WAIT_SEND_DESTROY
        Thread t =
            new Thread(
                new MyDestroyerRunnable(
                    dAdmin, logger, MAX_WAIT_SEND_DESTROY ));
        t.start();
       
        // Get events and verify
  logger.log(Level.INFO, "Getting events from empty mailbox.");
        RemoteEventIterator rei = mr.getRemoteEvents();
        RemoteEvent rei_event = null;
        Date before = new Date();
  logger.log(Level.INFO, "Calling next() on empty set @ {0}", before);
        try {
            rei_event = rei.next(MAX_WAIT_GET_EVENT);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.