All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwtrpcplus.client.impl.AbstractConnection Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package com.googlecode.gwtrpcplus.client.impl;

import com.googlecode.gwtrpcplus.client.Connection;
import com.googlecode.gwtrpcplus.client.Connection.RecieveHandler;

public abstract class AbstractConnection implements Connection, RecieveHandler {

  private RecieveHandler handler;

  @Override
  public void setHandler(RecieveHandler handler) {
    this.handler = handler;
  }

  private void assertInit() {
    assert (handler != null) : "No Handler set";
  }

  @Override
  public final void onRecieve(String answer) {
    assertInit();
    handler.onRecieve(answer);
  }

  @Override
  public final void onConnected() {
    assertInit();
    handler.onConnected();
  }

  @Override
  public final void onDisconnect() {
    assertInit();
    handler.onDisconnect();
  }

  @Override
  public final void onTimeout() {
    assertInit();
    handler.onTimeout();
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy