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; }
protected Entry[] getEntryArray() { try{ ServiceMatches matches = registrar.lookup(new ServiceTemplate(item.serviceID, new Class[] { item.service.getClass() }, new Entry[] {}), 10); if(matches.totalMatches != 1) Browser.logger.log(Level.INFO, "unexpected lookup matches: {0}", new Integer(matches.totalMatches)); else return matches.items[0].attributeSets; } catch (Throwable t) { Browser.logger.log(Level.INFO, "lookup failed", t); } return null; } }
@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); } }
@Override public void discovered(DiscoveryEvent e) { synchronized (_initialServiceRegistrarsLock) { for (ServiceRegistrar registrar : e.getRegistrars()) { if (_logger.isLoggable(Level.FINER)) _logger.finer("Discovery event for registrar with service id: " + registrar.getServiceID() + " (discovered via initial seed locators)"); _initialRegistrars.add(registrar); _initialRegistrarsDiscoveredLatch.countDown(); } } }
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){
protected void setupNotify() { if(registrar != null) { try { EventRegistration reg = registrar.notify(stmpl, ServiceRegistrar.TRANSITION_MATCH_NOMATCH | ServiceRegistrar.TRANSITION_NOMATCH_MATCH | ServiceRegistrar.TRANSITION_MATCH_MATCH, receiver.proxy, null, Lease.ANY); elease = (Lease) browser.leasePreparer.prepareProxy(reg.getLease()); browser.leaseMgr.renewUntil(elease, Lease.ANY, new Browser.LeaseNotify()); eventID = reg.getID(); seqNo = reg.getSequenceNumber(); } catch (Throwable t) { logger.log(Level.INFO, "event registration failed", t); } } }
{ public Object run() throws RemoteException { return reg.getGroups(); }//end run }),//end PrivilegedExceptionAction and wrap
ServiceRegistration tmpSrvcRegistration = proxy.register(tmpSrvcItem, renewalDuration); try { tmpSrvcRegistration =
types = lookup.getEntryClasses(tmpl); } catch (Throwable t) { failure(t);
@Override public void discarded(DiscoveryEvent e) { for (ServiceRegistrar registrar : e.getRegistrars()) { if (_logger.isLoggable(Level.FINER)) _logger.finer("Discarded event for registrar with service id: " + registrar.getServiceID() + " (discovered via initial seed locators)"); } }
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(); }
private void update() { setText(false); cancelLease(); if (lookup == null) return; try { EventRegistration reg = lookup.notify(tmpl, ServiceRegistrar.TRANSITION_MATCH_NOMATCH | ServiceRegistrar.TRANSITION_NOMATCH_MATCH | ServiceRegistrar.TRANSITION_MATCH_MATCH, listen.proxy, null, Lease.ANY); elease = (Lease) leasePreparer.prepareProxy(reg.getLease()); leaseMgr.renewUntil(elease, Lease.ANY, lnotify); eventSource = reg.getSource(); eventID = reg.getID(); seqNo = reg.getSequenceNumber(); } catch (Throwable t) { failure(t); } }
return reg.getGroups(); } catch (Throwable e) {
= proxy.register(tmpSrvcItem, renewalDuration); try { tmpSrvcRegistration =
/** * 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(); }
public void discarded(DiscoveryEvent dEvent) { long t = System.currentTimeMillis(); ServiceRegistrar[] reggies = dEvent.getRegistrars(); for (int i = 0; i < reggies.length; i++) { ReggieStat rStat = removeReggieStat(reggies[i].getServiceID()); if (rStat != null) { rStat.eventTime = t; rStat.type = ReggieStat.DISCARDED; synchronized (discoveryTimes) { discoveryTimes.add(rStat); } } } }
protected Entry[] getEntryArray() { if(admin instanceof JoinAdmin) { try { item.attributeSets = ((JoinAdmin) admin).getLookupAttributes(); } catch (Throwable t) { logger.log(Level.INFO, "obtaining attributes failed", t); } } else { try{ ServiceMatches matches = registrar.lookup(stmpl, 1); if(matches.totalMatches != 1) Browser.logger.log(Level.INFO, "unexpected lookup matches: {0}", new Integer(matches.totalMatches)); else item.attributeSets = matches.items[0].attributeSets; } catch (Throwable t) { Browser.logger.log(Level.INFO, "lookup failed", t); } } return item.attributeSets; }
for(int i=0;i<regs.length;i++) { try { LookupLocator regLoc = regs[i].getLocator(); String[] regGroups = (String[])groupsMap.get(regs[i]); LocatorGroupsStruct regLocGroups
initialLeaseDuration = notificationsLeaseRenewDuration; e = proxy.notify(tmpl, transition, listenerProxy, null, initialLeaseDuration, ServiceRegistrar.NOTIFY_WITH_MATCHES);
+ registrar.getServiceID() + ", Current locators: " + BootUtil.arrayToCommaDelimitedString(_dlm.getLocators())); if (_locatorsPendingRemovalServiceIDs.containsKey(registrar.getServiceID())) { Set<LookupLocator> locators = _locatorsPendingRemovalServiceIDs.remove(registrar.getServiceID()); } else if (_locators.containsKey(registrar.getServiceID())) { if (_logger.isLoggable(Level.FINE)) { _logger.fine("ServiceRegistrar with locators " + _locators.get(registrar.getServiceID()) + " already registered"); LookupLocator[] locators = new LookupLocator[]{registrar.getLocator()}; if (registrar.getServiceID().equals(_ourRegistrarServiceID) && _ourRegistrar == null) { if (_logger.isLoggable(Level.INFO)) { _logger.info("Found previously missing registrar with service id: " + registrar.getServiceID() + ", This lookup service will now update its state properly"); _locators.put(registrar.getServiceID(), locatorSet);