LookupLocator loc = regs[0].getLocator(); logger.log(level, "["+loc+"]"); }catch(SecurityException e){ LookupLocator loc = regs[0].getLocator(); logger.log(level, "["+loc+","); }catch(SecurityException e){ LookupLocator loc = regs[i].getLocator(); logger.log(level, loc+","); }catch(SecurityException e){ LookupLocator loc = regs[regs.length-1].getLocator(); logger.log(level, loc+"]"); }catch(SecurityException e){
LookupAliveTask(ServiceRegistrar proxy) throws RemoteException { this.proxy = proxy; String s = System.getProperty("com.gigaspaces.unicast.ping"); if (s != null) { try { invocationDelay = Long.parseLong(s); } catch (NumberFormatException e) { logger.log(Level.INFO, "Value [" + s + "] " + "is illegal for property " + "com.gigaspaces.unicast.ping, " + "ignoring"); } if (logger.isLoggable(Level.CONFIG)) logger.log(Level.CONFIG, "Set unicast ping to [" + invocationDelay + "]"); } LookupLocator locator = proxy.getLocator(); locatorString = "jini://" + locator.getHost() + ":" + locator.getPort(); }
@Override public void discovered(DiscoveryEvent event) { try { ServiceRegistrar[] registrars = event.getRegistrars(); for (int i = 0; i < registrars.length; i++) if (_logger.isLoggable(Level.FINE)) { _logger.fine("Directory Service (Jini Lookup Service registrar): \n" + "[ Registrar <" + registrars[i].getLocator().getHost() + ':' + registrars[i].getLocator().getPort() + "> ]" + "[ Member of " + Arrays.asList(registrars[i].getGroups()) + " has been discovered by the <" + getServiceName() + "> space. ]"); } } catch (Exception ex) { if (_logger.isLoggable(Level.SEVERE)) _logger.log(Level.SEVERE, ex.toString(), ex); } }
private Map<ServiceID, LookupLocator> getInitialLookupLocatorsMap() { List<ServiceRegistrar> registrars = getRegistrars(); Map<ServiceID, LookupLocator> initialLocatorsMap = new HashMap<ServiceID, LookupLocator>(); for (ServiceRegistrar registrar : registrars) { if (_logger.isLoggable(Level.FINER)) { _logger.finer("Trying to get locator from registrar with service id: " + registrar.getServiceID()); } try { initialLocatorsMap.put(registrar.getServiceID(), registrar.getLocator()); } catch (RemoteException e) { if (_logger.isLoggable(Level.WARNING)) { _logger.log(Level.WARNING, "Failed getting initial locator for registrar with service id: " + registrar.getServiceID(), e); } } } return initialLocatorsMap; }
/** * Create a RegieStat object * * @param type Either <code>ReggieStat.DISCOVERED</code> or <code>ReggieStat.DISCARDED</code> * @param t The time the event occurred * @param reggie The ServiceRegistrar instance being recorded * @throws RemoteException If there are comunication exceptions obtaining information from the * ServiceRegistrar instance */ ReggieStat(int type, long t, ServiceRegistrar reggie, String[] groups) throws RemoteException { if (type < DISCOVERED || type > DISCARDED) throw new IllegalArgumentException("bad type"); if (reggie == null) throw new NullPointerException("reggie is null"); this.type = type; eventTime = t; this.groups = groups; LookupLocator locator = reggie.getLocator(); machine = locator.getHost(); port = locator.getPort(); serviceID = reggie.getServiceID(); }
for(int i=0;i<regs.length;i++) { try { LookupLocator regLoc = regs[i].getLocator(); String[] regGroups = (String[])groupsMap.get(regs[i]); LocatorGroupsStruct regLocGroups
logger.fine( "invoke getLocator() on : " + locatorString); proxy.getLocator(); } catch (ConnectException e) { hardStop();
LookupLocator loc = null; try { loc = regs[i].getLocator(); } catch (Throwable ex) { /* ignore */ } String[] groups = (String[]) groupsMap.get(regs[i]);
_ourRegistrarServiceID = registrarServiceID; if (_ourRegistrar != null) _ourRegistrarLocator = _ourRegistrar.getLocator(); else _ourRegistrarLocator = null;
LookupLocator loc = null; try { loc = regs[i].getLocator(); } catch (Throwable ex) { /* ignore */ } String[] groups = (String[])groupsMap.get(regs[i]);
LookupLocator loc = null; try { loc = regs[i].getLocator(); } catch (Throwable ex) { /* ignore */ } String[] groups =
LookupLocator loc = null; try { loc = regs[i].getLocator(); } catch (Throwable ex) { /* ignore */ } String[] groups =
LookupLocator[] locators = new LookupLocator[]{registrar.getLocator()};
private void addOne(ServiceRegistrar registrar) { LookupLocator loc; try { loc = registrar.getLocator(); } catch (Throwable t) { logger.log(Level.INFO, "obtaining locator failed", t); return; } String host = loc.getHost(); if (loc.getPort() != Constants.discoveryPort) host += ":" + loc.getPort(); JRadioButtonMenuItem reg = new RegistrarMenuItem(host, registrar.getServiceID()); reg.addActionListener(wrap(new Lookup(registrar))); if (!(registrars.getMenuComponent(0) instanceof JRadioButtonMenuItem)) registrars.removeAll(); registrars.add(reg); }