Package net.jini.core.discovery

Examples of net.jini.core.discovery.LookupLocator


    if (locator == null) {
      locators = null;
    } else {
      locators = new LookupLocator[1];
      try {
  locators[0] = new LookupLocator(locator);
      } catch (MalformedURLException mue) {
  mue.printStackTrace();
      }
    }
View Full Code Here


    if (locator == null) {
      locators = null;
    } else {
      locators = new LookupLocator[1];
      try {
  locators[0] = new LookupLocator(locator);
      } catch (MalformedURLException mue) {
  mue.printStackTrace();
      }
    }
View Full Code Here

            Map groupsMap = event.getGroups();
            ServiceRegistrar[] regs = event.getRegistrars();
            HashMap regMap = new HashMap(regs.length);
            for(int i=0;i<regs.length;i++) {
                try {
                    LookupLocator regLoc = regs[i].getLocator();
                    String[] regGroups = (String[])groupsMap.get(regs[i]);
                    LocatorGroupsStruct regLocGroups
                                  = new LocatorGroupsStruct(regLoc,regGroups);
                    regMap.put(regs[i],regLocGroups);
                } catch(Exception e) {
View Full Code Here

            Set eSet = groupsMap.entrySet();
            for(Iterator itr = eSet.iterator(); itr.hasNext(); ) {
                Map.Entry pair = (Map.Entry)itr.next();
                ServiceRegistrar reg = (ServiceRegistrar)pair.getKey();
                String[] regGroups = (String[])pair.getValue();
                LookupLocator regLoc = (LookupLocator)locatorMap.get(reg);
                /* Include the current reg in the discard map only if that
                 * reg is in the regInfo's discovered set, the regInfo
                 * is not interested in discovering the reg through locator
                 * discovery, and the reg's member groups have changed in
                 * such a way that it now belongs to groups that the regInfo
View Full Code Here

     *  started during setup processing.
     */
    protected void startAllLookups() throws Exception {
        int totalNLookups = nLookupServices+nAddLookupServices;
        for(int i=0;i<totalNLookups;i++) {
      LookupLocator l = (LookupLocator) lookupsToStart.get(i);
            int port = l.getPort();
            if(portInUse(port) || (lookupsToStart.size() != totalNLookups)){
                port = 0;
            }
            startLookup(i, port, l.getHost());
        }//end loop
        /* If explicit ports were NOT set in config, then use what was started,
         * no questions asked. If explicit ports were set in config, then
         * verify that what was started equals what was wanted.
         */
 
View Full Code Here

      logger.log(Level.FINER, "Starting lookup for host " + serviceHost);
            lookupProxy = manager.startLookupService(serviceHost); // already prepared
            genMap.put( lookupProxy, memberGroups );
        }//endif
        lookupList.add( lookupProxy );
        LookupLocator lookupLocator = QAConfig.getConstrainedLocator(lookupProxy.getLocator());
        locatorsStarted.add(lookupLocator);
        LocatorsUtil.displayLocator(lookupLocator,
                                    "  locator ",Level.FINE);
        String displayGroups = GroupsUtil.toCommaSeparatedStr(memberGroups);
        if(displayGroups.equals("")) displayGroups = new String("NO_GROUPS");
View Full Code Here

     *  to configure the lookup discovery service for locator discovery.
     */
    protected LookupLocator[] getLocatorsToDiscover(ArrayList useList) {
        ArrayList locsList = new ArrayList();
        for(int i=0;i<useList.size();i++) {
            LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
            if(loc == nullcontinue;
            locsList.add(loc);
        }
        return (LookupLocator[])(locsList).toArray
                                          (new LookupLocator[locsList.size()]);
View Full Code Here

    /** Return any elements having at least a groups entry */
    protected Map getPassiveCommDiscardMap(ArrayList useList) {
        HashMap discardMap = new HashMap();
        for(int i=0;i<useList.size();i++) {
            String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).groups;
            LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
            if((groupsArray!=null) && (groupsArray.length>0)) {
                RegGroupsPair pair =
                                ((DiscoveryStruct)(useList.get(i))).regGroups;
                discardMap.put(pair.reg,pair.groups);
            }
View Full Code Here

    /** Return any elements having either a groups entry or a locators entry */
    protected Map getActiveCommDiscardMap(ArrayList useList) {
        HashMap discardMap = new HashMap();
        for(int i=0;i<useList.size();i++) {
            String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).groups;
            LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
            if(    ( (groupsArray != null) && (groupsArray.length > 0) )
                || (loc != null) )
            {
                RegGroupsPair pair =
                                ((DiscoveryStruct)(useList.get(i))).regGroups;
View Full Code Here

    /** Return any elements having at least a locators entry */
    protected Map getModLocatorsDiscardMap(ArrayList useList) {
        HashMap discardMap = new HashMap();
        for(int i=0;i<useList.size();i++) {
            String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).groups;
            LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
            if( loc != null ) {
                RegGroupsPair pair =
                                ((DiscoveryStruct)(useList.get(i))).regGroups;
                discardMap.put(pair.reg,pair.groups);
            }
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.