Package com.sun.jini.test.share

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


        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

                    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();
                        srvcRegLoc = generator.getLookupLocator();
                    } else {
                        srvcReg = (ServiceRegistrar)curGen;
                        try {
                            srvcRegLoc = QAConfig.getConstrainedLocator(srvcReg.getLocator());
                        } catch(RemoteException e) {
View Full Code Here

                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();
                    } else {
                        lookupProxy = (ServiceRegistrar)curGen;
                        try {
                            genLoc = QAConfig.getConstrainedLocator(lookupProxy.getLocator());
                        } catch(RemoteException e) {
View Full Code Here

                    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();
                        srvcRegLoc = generator.getLookupLocator();
                    } else {
                        srvcReg = (ServiceRegistrar)curGen;
                        try {
                            srvcRegLoc = QAConfig.getConstrainedLocator(srvcReg.getLocator());
                        } catch(RemoteException e) {
View Full Code Here

                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();
                    } else {
                        lookupProxy = (ServiceRegistrar)curGen;
                        try {
                            genLoc = QAConfig.getConstrainedLocator(lookupProxy.getLocator());
                        } catch(RemoteException e) {
View Full Code Here

     */
    void setGroupsToRemove(Map groupsMap) {
        ArrayList groupsList = new ArrayList();
        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) && (groupsMap.containsKey(lookupProxy)) ) {
                for(int j=0;j<curGroups.length;j++) {
                    groupsList.add(curGroups[j]);
                }//end loop
                proxiesRemoved.add(lookupProxy);
View Full Code Here

     */
    void setNewGroups(Map groupsMap) {
        ArrayList groupsList = new ArrayList();
        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( groupsMap.containsKey(lookupProxy) ) {
                for(int j=0;j<curGroups.length;j++) {
                    groupsList.add(curGroups[j]+"_new");
                }//end loop
                proxiesReplaced.add(lookupProxy);
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

    void setNewLocators(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( locatorsMap.containsKey(lookupProxy) ) {
                locatorsList.add(QAConfig.getConstrainedLocator("newHost",(portBase+i)));
                proxiesReplaced.add(lookupProxy);
            } else {
                locatorsList.add( curGen.getLookupLocator() );// no change here
      }//endif
        }//end loop
        newLocatorsToDiscover = (LookupLocator[])(locatorsList).toArray
                                      (new LookupLocator[locatorsList.size()]);
    }//end setNewLocators
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.