protected void setFencingToken(@Nullable F newFencingToken) { // this method should only be called from within the main thread validateRunsInMainThread(); this.fencingToken = newFencingToken; // setting a new fencing token entails that we need a new MainThreadExecutor // which is bound to the new fencing token MainThreadExecutable mainThreadExecutable = getRpcService().fenceRpcServer( rpcServer, newFencingToken); this.fencedMainThreadExecutor = new MainThreadExecutor(mainThreadExecutable); }
protected void setFencingToken(@Nullable F newFencingToken) { // this method should only be called from within the main thread validateRunsInMainThread(); this.fencingToken = newFencingToken; // setting a new fencing token entails that we need a new MainThreadExecutor // which is bound to the new fencing token MainThreadExecutable mainThreadExecutable = getRpcService().fenceRpcServer( rpcServer, newFencingToken); this.fencedMainThreadExecutor = new MainThreadExecutor(mainThreadExecutable); }
protected void setFencingToken(@Nullable F newFencingToken) { // this method should only be called from within the main thread validateRunsInMainThread(); this.fencingToken = newFencingToken; // setting a new fencing token entails that we need a new MainThreadExecutor // which is bound to the new fencing token MainThreadExecutable mainThreadExecutable = getRpcService().fenceRpcServer( rpcServer, newFencingToken); this.fencedMainThreadExecutor = new MainThreadExecutor(mainThreadExecutable); }
protected FencedRpcEndpoint(RpcService rpcService, String endpointId) { super(rpcService, endpointId); Preconditions.checkArgument( rpcServer instanceof FencedMainThreadExecutable, "The rpcServer must be of type %s.", FencedMainThreadExecutable.class.getSimpleName()); // no fencing token == no leadership this.fencingToken = null; this.unfencedMainThreadExecutor = new UnfencedMainThreadExecutor((FencedMainThreadExecutable) rpcServer); this.fencedMainThreadExecutor = new MainThreadExecutor( getRpcService().fenceRpcServer( rpcServer, null)); }
protected FencedRpcEndpoint(RpcService rpcService, String endpointId) { super(rpcService, endpointId); Preconditions.checkArgument( rpcServer instanceof FencedMainThreadExecutable, "The rpcServer must be of type %s.", FencedMainThreadExecutable.class.getSimpleName()); // no fencing token == no leadership this.fencingToken = null; this.unfencedMainThreadExecutor = new UnfencedMainThreadExecutor((FencedMainThreadExecutable) rpcServer); this.fencedMainThreadExecutor = new MainThreadExecutor( getRpcService().fenceRpcServer( rpcServer, null)); }
protected FencedRpcEndpoint(RpcService rpcService, String endpointId) { super(rpcService, endpointId); Preconditions.checkArgument( rpcServer instanceof FencedMainThreadExecutable, "The rpcServer must be of type %s.", FencedMainThreadExecutable.class.getSimpleName()); // no fencing token == no leadership this.fencingToken = null; this.unfencedMainThreadExecutor = new UnfencedMainThreadExecutor((FencedMainThreadExecutable) rpcServer); this.fencedMainThreadExecutor = new MainThreadExecutor( getRpcService().fenceRpcServer( rpcServer, null)); }