class FutureSchema implements AutoCloseable {
- @GuardedBy(value="postponedOperations")
+ @GuardedBy(value = "postponedOperations")
private final Set<FutureSchemaPredicate> postponedOperations = new LinkedHashSet<>();
private final long duration;
private final TimeUnit unit;
BindingRuntimeContext runtimeContext() {
final BindingRuntimeContext localRuntimeContext = this.runtimeContext;
- if(localRuntimeContext != null) {
+ if (localRuntimeContext != null) {
return localRuntimeContext;
}
- if(waitForSchema(Collections.emptyList())) {
+ if (waitForSchema(Collections.emptyList())) {
return this.runtimeContext;
}
}
void onRuntimeContextUpdated(final BindingRuntimeContext context) {
- synchronized(this.postponedOperations) {
+ synchronized (this.postponedOperations) {
this.runtimeContext = context;
for (final FutureSchemaPredicate op : this.postponedOperations) {
op.unlockIfPossible(context);
@Override
public void close() {
- synchronized(this.postponedOperations) {
+ synchronized (this.postponedOperations) {
for (final FutureSchemaPredicate op : this.postponedOperations) {
op.cancel();
}
}
private boolean addPostponedOpAndWait(final FutureSchemaPredicate postponedOp) {
- if(!this.waitEnabled) {
+ if (!this.waitEnabled) {
return false;
}
final BindingRuntimeContext localRuntimeContext = this.runtimeContext;
- synchronized(this.postponedOperations) {
+ synchronized (this.postponedOperations) {
this.postponedOperations.add(postponedOp);
// If the runtimeContext changed, this op may now be satisfied so check it.
- if(localRuntimeContext != this.runtimeContext) {
+ if (localRuntimeContext != this.runtimeContext) {
postponedOp.unlockIfPossible(this.runtimeContext);
}
}
} catch (final TimeoutException e) {
return false;
} finally {
- synchronized(FutureSchema.this.postponedOperations) {
+ synchronized (FutureSchema.this.postponedOperations) {
FutureSchema.this.postponedOperations.remove(this);
}
}
private final SettableFuture<?> schemaPromise = SettableFuture.create();
}
-
}