/** * Sets the value from any Boolean instance. * * @param value the value to set, not null * @throws NullPointerException if the object is null */ public void setValue(Object value) { setValue(((Boolean) value).booleanValue()); }
@Override protected void updateTimeBoundary(String tableName, ExternalView externalView) { if (tableName.equals("myTable_OFFLINE")) { timeBoundaryUpdated.setValue(true); } } };
/** * Remove all non replica clock entries from the list of versioned values * provided * * @param vals list of versioned values to prune replicas from * @param keyReplicas list of current replicas for the given key * @param didPrune flag to mark if we did actually prune something * @return pruned list */ public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals, List<Integer> keyReplicas, MutableBoolean didPrune) { List<Versioned<byte[]>> prunedVals = new ArrayList<Versioned<byte[]>>(vals.size()); for(Versioned<byte[]> val: vals) { VectorClock clock = (VectorClock) val.getVersion(); List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(); for(ClockEntry clockEntry: clock.getEntries()) { if(keyReplicas.contains((int) clockEntry.getNodeId())) { clockEntries.add(clockEntry); } else { didPrune.setValue(true); } } prunedVals.add(new Versioned<byte[]>(val.getValue(), new VectorClock(clockEntries, clock.getTimestamp()))); } return prunedVals; }
() -> { if (firstAttempt.isTrue()) { firstAttempt.setValue(false); } else if (lookupConfig.getCoordinatorRetryDelay() > 0) {
@Override public void inform(FileDistributionListener listener) { safeDist.setValue(listener.start(file, safe)); } });
@Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { wasRemoved.setValue(true); return null; } }).when(listener).onHostDown(host);
@Override public void readyToStop(StopReason stopReason) { // Notice: it couldn't distinguish between a script error or // timed out of the keepalive connection. System.out.println("The stop signal is recieved " + stopReason); if (stopReason.getDisplay().equals("Script error")) { timeouted.setValue(true); } } });
/** * Stops the watcher */ public void stop() { running.setValue(false); }
/** * Sets the value from any Boolean instance. * * @param value the value to set, not null * @throws NullPointerException if the object is null */ public void setValue(Object value) { setValue(((Boolean) value).booleanValue()); }
/** * Sets the value from any Boolean instance. * * @param value the value to set, not null * @throws NullPointerException if the object is null */ public void setValue(Object value) { setValue(((Boolean) value).booleanValue()); }
/** * Sets the value from any Boolean instance. * * @param value the value to set, not null * @throws NullPointerException if the object is null */ public void setValue(Object value) { setValue(((Boolean) value).booleanValue()); }
@Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { if (method.getAnnotation(EventListener.class) != null) { Class<?>[] types = method.getParameterTypes(); if (types.length == 1 && types[0] == eventClass) { handlesNotification.setValue(true); } } } });
@PreDestroy @Override public void close() { stop(); executorService.shutdownNow(); running.setValue(false); } }
@Override public ShortCircuitReplicaInfo createShortCircuitReplicaInfo() { calledCreate.setValue(true); return null; } });
public void handle(Response response) throws ResponseException { if (log.isTraceEnabled()) { log.trace("Server response is: {}", response.getResponseBodyAsString()); } requestReturned404.setValue(response.getStatusCode() == 404); } });
@Override public void process(long candidateLedgerId, long startPos, ByteBuf entry) { long entrysLedgerId = entry.getLong(entry.readerIndex()); long entrysEntryId = entry.getLong(entry.readerIndex() + 8); if ((candidateLedgerId == entrysLedgerId) && (candidateLedgerId == ledgerId) && ((entrysEntryId == entryId) || (entryId == -1))) { entryFound.setValue(true); formatEntry(startPos, entry, printMsg); } } });
public void handle(Response response) throws ResponseException { if (log.isTraceEnabled()) { log.trace("Server response is: {}", response.getResponseBodyAsString()); } requestReturned404.setValue(response.getStatusCode() == 404); } });
public boolean visit(String tag, Element element) throws SpecParserException { if (!"OAuth".equals(tag)) return false; if (oauthSpec != null) { throw new SpecParserException("ModulePrefs/OAuth may only occur once."); } oauthSpec = new OAuthSpec(element, base); oauthMarker.setValue(true); return true; }
public boolean visit(String tag, Element element) throws SpecParserException { if (!"OAuth".equals(tag)) return false; if (oauthSpec != null) { throw new SpecParserException("ModulePrefs/OAuth may only occur once."); } oauthSpec = new OAuthSpec(element, base); oauthMarker.setValue(true); return true; }