/** * @param filteredItem the filteredItem to set */ public void setFilteredItem(ServiceItem filteredItem) { this.filteredItem = filteredItem == null ? null : filteredItem.clone(); }
/** Returns service ID hash code. */ @Override public int hashCode() { return registrarID.hashCode(); }
public void notify(RemoteEvent evt) { ServiceEvent theEvent = (ServiceEvent) evt; notifyServiceMap(theEvent.getSource(), theEvent.getID(), theEvent.getSequenceNumber(), theEvent.getServiceID(), theEvent.getServiceItem(), theEvent.getTransition()); }//end notify
@Override public int compare(ServiceItem o1, ServiceItem o2) { ServiceID srvID_1 = o1.serviceID; ServiceID srvID_2 = o2.serviceID; // The ordering is intentionally set up so that the UUIDs // can simply be numerically compared as two numbers return (srvID_1.getMostSignificantBits() < srvID_2.getMostSignificantBits() ? -1 : (srvID_1.getMostSignificantBits() > srvID_2.getMostSignificantBits() ? 1 : (srvID_1.getLeastSignificantBits() < srvID_2.getLeastSignificantBits() ? -1 : (srvID_1.getLeastSignificantBits() > srvID_2.getLeastSignificantBits() ? 1 : 0)))); } });
/** * Two leases can be batched if they are both RegistrarLeases and have the same server. */ public boolean canBatch(Lease lease) { return (lease instanceof RegistrarLease && registrarID.equals(((RegistrarLease) lease).registrarID)); }
@Override public void read(ObjectInput in) throws IOException, ClassNotFoundException { registrarID = new ServiceID(in); }
@Override public int compareTo(Object o) { if (!(o instanceof HandleServiceEventTask)) return 0; HandleServiceEventTask that = (HandleServiceEventTask) o; long dif = this.theEvent.getSequenceNumber() - that.theEvent.getSequenceNumber(); if (dif == 0) return 0; if (dif < 0) return -1; // Which means that.theEvent is larger than this.theEvent return 1; } }
/** With respect to the lookup service referenced in this class * and with which this join manager's service is registered, this * method associates with that service a new set of attributes -- in * addition to that service's current set of attributes. */ public void addAttributes(Entry[] attSet) throws Exception { ServiceRegistration sr = srvcRegistration; if (sr != null) sr.addAttributes(attSet); }//end ProxyReg.addAttributes
/** With respect to the lookup service referenced in this class * and with which this join manager's service is registered, this * method replaces that service's current attributes with a new * set of attributes. */ public void setAttributes(Entry[] attSet) throws Exception { ServiceRegistration sr = srvcRegistration; if (sr != null) sr.setAttributes(attSet); }//end ProxyReg.setAttributes
/** With respect to the lookup service referenced in this class * and with which this join manager's service is registered, this * method changes that service's current attributes by selecting * the attributes to change using the given first parameter; * and identifying the desired changes to make through the * contents of the second parameter. */ public void modifyAttributes(Entry[] templ, Entry[] attSet) throws Exception { ServiceRegistration sr = srvcRegistration; if (sr != null) sr.modifyAttributes(templ, attSet); }//end ProxyReg.modifyAttributes
{ public Object run() throws RemoteException { return reg.getGroups(); }//end run }),//end PrivilegedExceptionAction and wrap
@Override public int compare(ServiceItem o1, ServiceItem o2) { ServiceID srvID_1 = o1.serviceID; ServiceID srvID_2 = o2.serviceID; // The ordering is intentionally set up so that the UUIDs // can simply be numerically compared as two numbers return (srvID_1.getMostSignificantBits() < srvID_2.getMostSignificantBits() ? -1 : (srvID_1.getMostSignificantBits() > srvID_2.getMostSignificantBits() ? 1 : (srvID_1.getLeastSignificantBits() < srvID_2.getLeastSignificantBits() ? -1 : (srvID_1.getLeastSignificantBits() > srvID_2.getLeastSignificantBits() ? 1 : 0)))); } });
/** * Two announcements are equal if they have the same service ID. */ public boolean equals(Object o) { return o instanceof IncomingMulticastAnnouncement && ((IncomingMulticastAnnouncement) o).serviceID.equals(serviceID); } }
/** * Returns service ID hash code. */ public int hashCode() { return registrarID.hashCode(); }
/** * @return the filteredItem */ public ServiceItem getFilteredItem() { return filteredItem == null ? null : filteredItem.clone(); }
/** * With respect to the lookup service referenced in this class and with which this join * manager's service is registered, this method associates with that service a new set of * attributes -- in addition to that service's current set of attributes. */ public void addAttributes(Entry[] attSet) throws Exception { ServiceRegistration localReg = srvcRegistration; if (localReg != null) { localReg.addAttributes(attSet); } }//end ProxyReg.addAttributes
/** * With respect to the lookup service referenced in this class and with which this join * manager's service is registered, this method replaces that service's current attributes * with a new set of attributes. */ public void setAttributes(Entry[] attSet) throws Exception { ServiceRegistration localReg = srvcRegistration; if (localReg != null) { localReg.setAttributes(attSet); } }//end ProxyReg.setAttributes
/** * Returns the element in the given items array having the given ServiceID. */ private ServiceItem findItem(ServiceID sid, ServiceItem[] items) { if (items != null) { for (int i = 0; i < items.length; i++) { if (items[i].serviceID.equals(sid)) return items[i]; }//end loop }//endif return null; }//end LookupCacheImpl.findItem
/** * Two leases can be batched if they are both RegistrarLeases and * have the same server. */ @Override public boolean canBatch(Lease lease) { return (lease instanceof RegistrarLease && registrarID.equals(((RegistrarLease) lease).registrarID)); }
/** * Returns the element in the given items array having the given ServiceID. */ private ServiceItem findItem(ServiceID sid, ServiceItem[] items) { if (items != null) { for (int i = 0, length = items.length; i < length; i++) { if (sid.equals(items[i].serviceID)) { return items[i]; } } //end loop } //endif return null; } //end LookupCacheImpl.findItem