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); }
/** * Initializes the RPC endpoint. * * @param rpcService The RPC server that dispatches calls to this RPC endpoint. * @param endpointId Unique identifier for this endpoint */ protected RpcEndpoint(final RpcService rpcService, final String endpointId) { this.rpcService = checkNotNull(rpcService, "rpcService"); this.endpointId = checkNotNull(endpointId, "endpointId"); // IMPORTANT: Don't change order of selfGatewayType and self because rpcService.startServer // requires that selfGatewayType has been initialized this.selfGatewayType = determineSelfGatewayType(); this.self = rpcService.startServer(this); this.mainThreadExecutor = new MainThreadExecutor((MainThreadExecutable) self); }
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)); }
/** * Initializes the RPC endpoint. * * @param rpcService The RPC server that dispatches calls to this RPC endpoint. * @param endpointId Unique identifier for this endpoint */ protected RpcEndpoint(final RpcService rpcService, final String endpointId) { this.rpcService = checkNotNull(rpcService, "rpcService"); this.endpointId = checkNotNull(endpointId, "endpointId"); this.rpcServer = rpcService.startServer(this); this.mainThreadExecutor = new MainThreadExecutor(rpcServer); }
/** * Initializes the RPC endpoint. * * @param rpcService The RPC server that dispatches calls to this RPC endpoint. * @param endpointId Unique identifier for this endpoint */ protected RpcEndpoint(final RpcService rpcService, final String endpointId) { this.rpcService = checkNotNull(rpcService, "rpcService"); this.endpointId = checkNotNull(endpointId, "endpointId"); this.rpcServer = rpcService.startServer(this); this.mainThreadExecutor = new MainThreadExecutor(rpcServer); }
/** * Initializes the RPC endpoint. * * @param rpcService The RPC server that dispatches calls to this RPC endpoint. * @param endpointId Unique identifier for this endpoint */ protected RpcEndpoint(final RpcService rpcService, final String endpointId) { this.rpcService = checkNotNull(rpcService, "rpcService"); this.endpointId = checkNotNull(endpointId, "endpointId"); this.rpcServer = rpcService.startServer(this); this.mainThreadExecutor = new MainThreadExecutor(rpcServer); }