Codota Logo
HttpCallback
Code IndexAdd Codota to your IDE (free)

How to use
HttpCallback
in
com.mpush.netty.http

Best Java code snippets using com.mpush.netty.http.HttpCallback (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: mpusher/mpush

@Override
public void onException(Throwable throwable) {
  callback.onException(throwable);
  endTime = System.currentTimeMillis();
  destroy();
}
origin: mpusher/mpush

@Override
public boolean onRedirect(HttpResponse response) {
  endTime = System.currentTimeMillis();
  return callback.onRedirect(response);
}
origin: mpusher/mpush

@Override
public void run(Timeout timeout) throws Exception {
  if (tryDone()) {
    if (callback != null) {
      callback.onTimeout();
    }
  }
}
origin: stackoverflow.com

private void call(String method, String url, final HttpCallback cb) {
 ...
 client.newCall(request).enqueue(new Callback() {
     Handler mainHandler = new Handler(context.getMainLooper());
     @Override
     public void onFailure(Request request,final Throwable throwable) {
       mainHandler.post(new Runnable() {
         @Override
         public void run() {
           cb.onFailure(null, throwable);
         }
       });
     }
     @Override
     public void onResponse(final Response response) throws IOException {
       mainHandler.post(new Runnable() {
         @Override
         public void run() {
           if (!response.isSuccessful()) {
             cb.onFailure(response, null);
             return;
           }
           cb.onSuccess(response);
         }
       });
     }
   });
}
origin: mpusher/mpush

@Override
public void onFailure(int statusCode, String reasonPhrase) {
  callback.onFailure(statusCode, reasonPhrase);
  endTime = System.currentTimeMillis();
  destroy();
}
origin: mpusher/mpush

@Override
public void onResponse(HttpResponse response) {
  callback.onResponse(response);
  endTime = System.currentTimeMillis();
  destroy();
}
origin: mpusher/mpush

@Override
public void onTimeout() {
  callback.onTimeout();
  endTime = System.currentTimeMillis();
  destroy();
}
com.mpush.netty.httpHttpCallback

Javadoc

Created by ohun on 2016/2/15.

Most used methods

  • onFailure
  • onException
  • onRedirect
  • onResponse
  • onSuccess
  • onTimeout

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • JButton (javax.swing)
  • JTable (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now