Package ch.softappeal.yass.core.remote

Examples of ch.softappeal.yass.core.remote.Tunnel


  @Override protected final Object invoke(final ClientInvocation invocation) throws Throwable {
    if (!opened) {
      throw new IllegalStateException("session is not yet opened");
    }
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here


  }

  private final AtomicInteger nextRequestNumber = new AtomicInteger(Packet.END_REQUEST_NUMBER);

  @Override protected Object invoke(final ClientInvocation invocation) throws Throwable {
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

  @Override protected final Object invoke(final ClientInvocation invocation) throws Throwable {
    if (!opened) {
      throw new IllegalStateException("session is not yet opened");
    }
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

  }

  private final AtomicInteger nextRequestNumber = new AtomicInteger(Packet.END_REQUEST_NUMBER);

  @Override protected Object invoke(final ClientInvocation invocation) throws Throwable {
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

  }

  private final AtomicInteger nextRequestNumber = new AtomicInteger(Packet.END_REQUEST_NUMBER);

  @Override protected Object invoke(final ClientInvocation invocation) throws Throwable {
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

  @Override protected final Object invoke(final ClientInvocation invocation) throws Throwable {
    if (!opened) {
      throw new IllegalStateException("session is not yet opened");
    }
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

  @Override protected final Object invoke(final ClientInvocation invocation) throws Throwable {
    if (!opened) {
      throw new IllegalStateException("session is not yet opened");
    }
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

  @Override protected final Object invoke(final ClientInvocation invocation) throws Throwable {
    if (!opened) {
      throw new IllegalStateException("session is not yet opened");
    }
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do {
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER); // we can't use END_REQUEST_NUMBER as regular requestNumber
View Full Code Here

    Check.notNull(socketFactory);
    Check.notNull(socketAddress);
    return new Client(methodMapperFactory) {
      @Override protected Object invoke(final ClientInvocation invocation) throws Throwable {
        try (Socket socket = connectSocket(socketFactory, socketAddress)) {
          return invocation.invoke(Interceptors.threadLocal(SOCKET, socket), new Tunnel() {
            @Override public Reply invoke(final Request request) throws Exception {
              setTcpNoDelay(socket);
              write(request, socket, messageSerializer);
              return invocation.oneWay ? null : (Reply)read(socket, messageSerializer);
            }
View Full Code Here

  @Override protected final Object invoke(final ClientInvocation invocation) throws Throwable {
    if (!opened) {
      throw new IllegalStateException("session is not yet opened");
    }
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do {
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER); // we can't use END_REQUEST_NUMBER as regular requestNumber
View Full Code Here

TOP

Related Classes of ch.softappeal.yass.core.remote.Tunnel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.