Package net.jini.core.discovery

Examples of net.jini.core.discovery.LookupLocator


        * registration, then add to the expected discard map; because only
        * then will a discard event be sent upon removal of the locator.
        */
        regInfo.resetDiscardEventInfo();
        for(int i=0;i<lookupsDiscovered.length;i++) {
            LookupLocator discoveredLoc = lookupsDiscovered[i].getLocator();
            int nLocMatches = 0;
            for(int j=0;j<locsToDiscover.length;j++) {
                if( locsEqual(discoveredLoc, locsToDiscover[j]) ) {
                    nLocMatches = nLocMatches+1;
                }//endif
View Full Code Here


            if (locsStarted[i] instanceof ConstrainableLookupLocator) {
                locsToSet[i] = new ConstrainableLookupLocator(
                    host, locsStarted[i].getPort(),
                    ((ConstrainableLookupLocator)locsStarted[i]).getConstraints());
            } else {
                locsToSet[i] = new LookupLocator(host,locsStarted[i].getPort());
            }
            logger.log(Level.FINE, "locsToSet["+i+"] = "+locsToSet[i]);
        }//end loop
    }//end setup
View Full Code Here

            synchronized(lockObject) {
                Iterator iter = genMap.keySet().iterator();
                while(iter.hasNext()) {
                    Object curGen = iter.next();
                    ServiceRegistrar srvcReg = null;
                    LookupLocator srvcRegLoc = null;
                    /* retrieve the locator and member groups of cur lookup */
                    if( curGen instanceof DiscoveryProtocolSimulator ) {
                        DiscoveryProtocolSimulator generator
                                         = (DiscoveryProtocolSimulator)curGen;
                        srvcReg = generator.getLookupProxy();
View Full Code Here

                    }//endif
                }//end loop(j)
            }//end loop(i)
            if(!inSet) {//no groups, try loc
                try {
                    LookupLocator srvcRegLoc = QAConfig.getConstrainedLocator(srvcReg.getLocator());
                    for(int i=0;i<locatorsToDiscover.length;i++) {
                        if( locsEqual(srvcRegLoc,locatorsToDiscover[i]) ) {
                            inSet = true;
                            break;
                        }//endif
View Full Code Here

            synchronized(lockObject) {
                Iterator iter = genMap.keySet().iterator();
                for(int i=0;iter.hasNext();i++) {
                    Object curGen = iter.next();
                    ServiceRegistrar lookupProxy = null;
                    LookupLocator genLoc = null;
                    if( curGen instanceof DiscoveryProtocolSimulator ) {
                        DiscoveryProtocolSimulator generator
                                         = (DiscoveryProtocolSimulator)curGen;
                        lookupProxy = generator.getLookupProxy();
                        genLoc = generator.getLookupLocator();
View Full Code Here

            for(int i=nLookupServices;i<totalNLookups;i++) {
                long waitMS = ( i < n ? waitTimes[i-1] : waitTimes[n-1] );
                logger.log(Level.FINE, "waiting "+(waitMS/1000)+" seconds before "
                              +"attempting to start the next lookup service");
                try {Thread.sleep(waitMS);} catch(InterruptedException e) { }
    LookupLocator l = (LookupLocator) lookupsToStart.get(i);
                int port =
        ((lookupsToStart.size() == totalNLookups ) ? l.getPort()
                                                   : 0);
                try {
                    startLookup(i, port, l.getHost());
                } catch(Exception e) {
                    e.printStackTrace();
                }
            }//end loop
        }//end run
View Full Code Here

            logger.log(level, "comparison loop");
            logger.log(level, "");
        }//endif
        int i = 0;
        for(Iterator itr1=hashSet1.iterator();itr1.hasNext();i++) {
            LookupLocator locator1 = (LookupLocator)itr1.next();
                int j = 0;
                for(Iterator itr2=hashSet2.iterator();itr2.hasNext();j++) {
                    LookupLocator locator2 = (LookupLocator)itr2.next();
                    if( !((Level.OFF).equals(level)) ) {
                        logger.log(level, "locatorSet1["+i+"] = " +locator1);
                        logger.log(level, "locatorSet2["+j+"] = " +locator2);
                        logger.log(level, "");
                    }//endif
                    if( locator2.equals(locator1) ) {
                        hashSet2.remove(locator2);
                        break;
                    }
                }//end loop(locatorSet2)
        }//endloop(locatorSet1)
View Full Code Here

                    Object locGroupsPair = lookupsStarted.get(i);
                    initLookupsToStart.set(i,locGroupsPair);
                    allLookupsToStart.set(i,locGroupsPair);
                }
    LocatorGroupsPair p = (LocatorGroupsPair) initLookupsToStart.get(i);
    LookupLocator l = p.locator;
    logger.log(Level.FINEST, "init locator " + i + " = " + l);
            }//end loop
            if(testType != MANUAL_TEST_LOCAL_COMPONENT) {
                if(!listsEqual(initLookupsToStart,lookupsStarted)) {
                    logger.log(Level.FINE,
View Full Code Here

                    Object locGroupsPair = lookupsStarted.get(i);
                    addLookupsToStart.set(j,locGroupsPair);
                    allLookupsToStart.set(i,locGroupsPair);
                }
    LocatorGroupsPair p = (LocatorGroupsPair) addLookupsToStart.get(j);
    LookupLocator l = p.locator;
    logger.log(Level.FINEST, "add locator " + j + " = " + l);
            }//end loop
            if(testType != MANUAL_TEST_LOCAL_COMPONENT) {
                if(!listsEqual(allLookupsToStart,lookupsStarted)) {
                    logger.log(Level.FINE,
View Full Code Here

                     */
                    Thread.currentThread().interrupt();
                }
                LocatorGroupsPair pair
                                    = (LocatorGroupsPair)locGroupsList.get(i);
    LookupLocator l = pair.locator;
                int port = l.getPort();
                if(portInUse(port)) port = 0;
                if( isInterrupted() )  break;//exit this thread
                try {
                    startLookup(i, port, l.getHost());
                } catch(Exception e) {
                    e.printStackTrace();
                }
            }//end loop
        }//end run
View Full Code Here

TOP

Related Classes of net.jini.core.discovery.LookupLocator

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.