use of org.gradle.internal.remote.internal.inet.InetEndpoint in project gradle by gradle.
the class PersistentDaemonRegistry method store.
@Override
public void store(final DaemonInfo info) {
final Address address = info.getAddress();
final DaemonContext daemonContext = info.getContext();
final byte[] token = info.getToken();
final State state = info.getState();
lock.lock();
LOGGER.debug("Storing daemon address: {}, context: {}", address, daemonContext);
try {
cache.update(new PersistentStateCache.UpdateAction<DaemonRegistryContent>() {
@Override
public DaemonRegistryContent update(DaemonRegistryContent oldValue) {
if (oldValue == null) {
// it means the registry didn't exist yet
oldValue = new DaemonRegistryContent();
}
DaemonInfo daemonInfo = new DaemonInfo(address, daemonContext, token, state);
oldValue.removeInfo(((InetEndpoint) address).getPort());
oldValue.setStatus(address, daemonInfo);
return oldValue;
}
});
} finally {
lock.unlock();
}
}
Aggregations