Package com.sun.jini.test.share

Examples of com.sun.jini.test.share.DiscoveryProtocolSimulator$AnnounceThread


             * number of milliseconds. Thus, before stopping multicast
             * announcements, wait until at least N multicast
             * announcements have been sent.
             */
            if(curObj instanceof DiscoveryProtocolSimulator) {//simulated LUS
                DiscoveryProtocolSimulator curGen
                                         = (DiscoveryProtocolSimulator)curObj;
                regProxy = curGen.getLookupProxy();
                logger.log(Level.FINE, "lookup "+i
                                  +" - waiting ... announcements so far -- "
                                  +curGen.getNAnnouncementsSent());
                for(int j=0; ((j<nIntervalsToWait)
                    &&(curGen.getNAnnouncementsSent()< minNAnnouncements));j++)
                {
                    DiscoveryServiceUtil.delayMS(announceInterval);
                    logger.log(Level.FINE, "lookup "+i
                                  +" - waiting ... announcements so far -- "
                                  +curGen.getNAnnouncementsSent());
                }//end loop
                logger.log(Level.FINE,
                                  "lookup "+i
                                  +" - wait complete ... announcements  -- "
                                  +curGen.getNAnnouncementsSent());
                curGen.stopAnnouncements();
            } else {//non-simulated LUS
                logger.log(Level.FINE, "lookup "+i+" - waiting "
                                  +(nIntervalsToWait*announceInterval/1000)
                                  +" seconds for "+minNAnnouncements
                                  +" announcements ... ");
View Full Code Here


    void setLocatorsToRemove(Map locatorsMap) {
        ArrayList locatorsList = new ArrayList();
        int portBase = 5000;
        Iterator iter = genMap.keySet().iterator();
        for(int i=0;iter.hasNext();i++) {
            DiscoveryProtocolSimulator curGen =
                                       (DiscoveryProtocolSimulator)iter.next();
            String[]         curGroups   = curGen.getMemberGroups();
            ServiceRegistrar lookupProxy = curGen.getLookupProxy();
            if(  ((i%2) == 0) && (locatorsMap.containsKey(lookupProxy)) ) {
                locatorsList.add( curGen.getLookupLocator() );
                proxiesRemoved.add(lookupProxy);
      }//endif
        }//end loop
        locatorsToRemove = (LookupLocator[])(locatorsList).toArray
                                      (new LookupLocator[locatorsList.size()]);
View Full Code Here

        String[] memberGroups = (String[])memberGroupsList.get(indx);
        ServiceRegistrar lookupProxy = null;
  String simulatorName =
      "com.sun.jini.test.services.lookupsimulator.LookupSimulatorImpl";
        if(implClassname.equals(simulatorName)) {
            DiscoveryProtocolSimulator generator = null;
            if(debugsync) logger.log(Level.FINE,
                              "     BaseQATest.startLookup - "
                              +"sync on lookupList --> requested");
            synchronized(lookupList) {
                if(debugsync) logger.log(Level.FINE,
                                  "     BaseQATest.startLookup - "
                                  +"sync on lookupList --> granted");
                /* Use either a random or an explicit locator port */
                generator = new DiscoveryProtocolSimulator
                                               (config,memberGroups,manager, port);
                genMap.put( generator, memberGroups );
                lookupProxy = generator.getLookupProxy();
                lookupList.add( lookupProxy );
                if(debugsync) logger.log(Level.FINE,
                                  "     BaseQATest.startLookup - "
                                  +"  added new proxy to lookupList");
                if(debugsync) logger.log(Level.FINE,
                                  "     BaseQATest.startLookup - "
                                  +"sync on lookupList --> released");
            }//end sync(lookupList)
            /* Force non-unique groups for manual tests */
            if(    (testType == MANUAL_TEST_REMOTE_COMPONENT)
                || (testType == MANUAL_TEST_LOCAL_COMPONENT) )
            {
                generator.setMemberGroups(memberGroups);
            }//endif
        } else {//start a non-simulated lookup service implementation
            if(debugsync) logger.log(Level.FINE,
                              "     BaseQATest.startLookup - "
                              +"sync on lookupList --> requested");
View Full Code Here

        Iterator iter = genMap.keySet().iterator();
        for(int i=0;iter.hasNext();i++) {
            Object curObj = iter.next();
            ServiceRegistrar regProxy = null;
            if(curObj instanceof DiscoveryProtocolSimulator) {
                DiscoveryProtocolSimulator curGen
                                         = (DiscoveryProtocolSimulator)curObj;
                regProxy = curGen.getLookupProxy();
                curGen.stopAnnouncements();
            } else {
                regProxy = (ServiceRegistrar)curObj;
            }//endif
            /* destroy lookup service i */
            manager.destroyService(regProxy);
View Full Code Here

        for(int i=0;iter.hasNext();i++) {
            logger.log(Level.FINE, " stop multicast announcements "
                              +"from lookup service "+i+" ...");
            Object curObj = iter.next();
            if(curObj instanceof DiscoveryProtocolSimulator) {
                DiscoveryProtocolSimulator curGen
                                         = (DiscoveryProtocolSimulator)curObj;
                curGen.stopAnnouncements();
            } else {//cannot stop the announcements, must destroy the lookup
                /* It's not a simulated LUS, thus the only way to stop the
                 * announcements is to destroy each LUS individually.
                 */
                manager.destroyService((ServiceRegistrar)curObj);
View Full Code Here

        logger.log(Level.FINE,
                          " number of intervals to wait through    -- "
                          +nIntervalsToWait);
        Iterator iter = genMap.keySet().iterator();
        for(int i=0;iter.hasNext();i++) {
            DiscoveryProtocolSimulator curGen =
                                  (DiscoveryProtocolSimulator)iter.next();
            logger.log(Level.FINE,
                              " gen "+i
                              +" - waiting ... announcements so far -- "
                              +curGen.getNAnnouncementsSent());
            for(int j=0; ((j<nIntervalsToWait)
                &&(curGen.getNAnnouncementsSent()< minNAnnouncements));j++)
            {
                DiscoveryServiceUtil.delayMS(announceInterval);
                logger.log(Level.FINE,
                                  " gen "+i
                                  +" - waiting ... announcements so far -- "
                                  +curGen.getNAnnouncementsSent());
            }//end loop
            logger.log(Level.FINE,
                              " gen "+i
                              +" - wait complete ... announcements  -- "
                              +curGen.getNAnnouncementsSent());
        }//end loop
    }//end verifyAnnouncementsSent
View Full Code Here

        String[] memberGroups = (String[])memberGroupsList.get(indx);
        ServiceRegistrar lookupProxy = null;
        if(implClassname.equals("com.sun.jini.test.services.lookupsimulator.LookupSimulatorImpl"))
        {
            /* Use either a random or an explicit locator port */
            DiscoveryProtocolSimulator generator =
    new DiscoveryProtocolSimulator(config, memberGroups, manager, port);
            genMap.put( generator, memberGroups );
            lookupProxy = generator.getLookupProxy();
        } else {//start a non-simulated lookup service implementation
      logger.log(Level.FINER, "Starting lookup for host " + serviceHost);
            lookupProxy = manager.startLookupService(serviceHost); // already prepared
            genMap.put( lookupProxy, memberGroups );
        }//endif
View Full Code Here

                                 int discardType)
    {
        try {
            ServiceRegistrar lookupProxy = null;
            if( curGen instanceof DiscoveryProtocolSimulator ) {
                DiscoveryProtocolSimulator generator
                                         = (DiscoveryProtocolSimulator)curGen;
                lookupProxy = generator.getLookupProxy();
            } else {
                lookupProxy = (ServiceRegistrar)curGen;
            }//endif
            String[] curGroups = lookupProxy.getGroups();
            String[] newGroups =  new String[] {"Group_"
View Full Code Here

TOP

Related Classes of com.sun.jini.test.share.DiscoveryProtocolSimulator$AnnounceThread

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.