public long fetch(NaRPCMessage message) throws IOException { long ticket = fetchBuffer(channel, buffer); if (ticket > 0){ message.update(buffer); } return ticket; }
public void transmit(long ticket, NaRPCMessage message) throws IOException { makeMessage(ticket, message, buffer); transmitMessage(channel, buffer); }
@Override public StorageResult get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { future.get(timeout, unit); return this; }
@Override public boolean isDone() { return future.isDone(); }
@Override public void close() throws IOException, InterruptedException { endpoint.close(); }
public void connect(InetSocketAddress address) throws IOException { endpoint.connect(address); }
public String toString() { String address = ""; try { address = endpoint.address(); } catch (IOException e) { } return address; }
@Override public int getTicket() { return (int) future.getTicket(); }
public NaRPCServerChannel accept() throws Exception { SocketChannel channel = serverSocket.accept(); NaRPCServerChannel serverChannel = new NaRPCServerChannel(serverGroup, channel); this.serverGroup.registerEndpoint(serverChannel); return serverChannel; }
public void registerEndpoint(NaRPCServerChannel endpoint) throws IOException { int index = getAndIncrement() % dispatcherArray.size(); NaRPCDispatcher<R,T> dispatcher = dispatcherArray.get(index); dispatcher.addChannel(endpoint); }
public NaRPCServerEndpoint<R,T> createServerEndpoint() throws IOException{ return new NaRPCServerEndpoint<R,T>(this); }
@Override public StorageResult get() throws InterruptedException, ExecutionException { future.get(); return this; }
public String toString() { String address = ""; try { address = endpoint.address(); } catch (IOException e) { } return address; }
@Override public int getTicket() { return (int) future.getTicket(); }
@Override public StorageResult get() throws InterruptedException, ExecutionException { future.get(); return this; }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { future.get(timeout, unit); return response; }
@Override public T get() throws InterruptedException, ExecutionException { future.get(); return response; }
@Override public T get() throws InterruptedException, ExecutionException { future.get(); return response; }
@Override public StorageResult get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { future.get(timeout, unit); return this; }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { future.get(timeout, unit); return response; }