kandi background
Explore Kits

jdeferred | Java Deferred/Promise library similar to JQuery | Reactive Programming library

 by   jdeferred Java Version: Current License: Apache-2.0

 by   jdeferred Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | jdeferred Summary

jdeferred is a Java library typically used in Programming Style, Reactive Programming applications. jdeferred has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub, Maven.
JDeferred is a Java Deferred/Promise library similar to JQuery’s Deferred Object. Inspired by [JQuery](https://github.com/jquery/jquery) and [Android Deferred Object](https://github.com/CodeAndMagic/android-deferred-object). If you are using JDeferred 1.x, see [JDeferred 1.x Documentation](http://jdeferred.org/v1/).
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • jdeferred has a medium active ecosystem.
  • It has 1472 star(s) with 185 fork(s). There are 66 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 28 open issues and 65 have been closed. On average issues are closed in 258 days. There are 5 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of jdeferred is current.
jdeferred Support
Best in #Reactive Programming
Average in #Reactive Programming
jdeferred Support
Best in #Reactive Programming
Average in #Reactive Programming

quality kandi Quality

  • jdeferred has 0 bugs and 0 code smells.
jdeferred Quality
Best in #Reactive Programming
Average in #Reactive Programming
jdeferred Quality
Best in #Reactive Programming
Average in #Reactive Programming

securitySecurity

  • jdeferred has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • jdeferred code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
jdeferred Security
Best in #Reactive Programming
Average in #Reactive Programming
jdeferred Security
Best in #Reactive Programming
Average in #Reactive Programming

license License

  • jdeferred is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
jdeferred License
Best in #Reactive Programming
Average in #Reactive Programming
jdeferred License
Best in #Reactive Programming
Average in #Reactive Programming

buildReuse

  • jdeferred releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 5885 lines of code, 590 functions and 106 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
jdeferred Reuse
Best in #Reactive Programming
Average in #Reactive Programming
jdeferred Reuse
Best in #Reactive Programming
Average in #Reactive Programming
Top functions reviewed by kandi - BETA

kandi has reviewed jdeferred and discovered the below as its top functions. This is intended to give you an instant insight into jdeferred implemented functionality, and help decide if they suit your requirements.

  • Configures a promise .
    • Configures a task .
      • Creates a deferred callable for the given future .
        • Sets the result at a given index .
          • Determine the execution scope .
            • Resolves this deferred promise .
              • Executes the given task
                • Called when the task is cancelled .
                  • Synchronously return the result .
                    • Not thread safe .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      jdeferred Key Features

                      ~DeferredManager.StartPolicy.MANAUL~ is deprecated and will be removed in the next minor version. Use DeferredManager.StartPolicy.MANUAL instead.

                      jdeferred Examples and Code Snippets

                      See all related Code Snippets

                      default

                      copy iconCopydownload iconDownload
                      Licensed under the Apache License, Version 2.0 (the "License");
                      you may not use this file except in compliance with the License.
                      You may obtain a copy of the License at

                      JDeferred 2.x

                      copy iconCopydownload iconDownload
                      * Deferred object and Promise
                      * Promise callbacks
                        * ```.then(…)```
                        * ```.filter(…)```
                        * ```.pipe(…)```
                        * ```.done(…)```
                        * ```.fail(…)```
                        * ```.progress(…)```
                        * ```.always(…)```
                        * ```.pipeAlways(…)```
                      * Multiple promises
                        * ```.when(p1, p2, p3, …).then(…)```
                        * ```.race(p1, p2, p3, …).then(…)```
                        * ```.settle(p1, p2, p3, …).then(…)```
                      * Callable and Runnable wrappers
                        * ```.when(new Runnable() {…})```
                        * ```.race(new Runnable() {…})```
                        * ```.settle(new Runnable() {…})```
                      * Uses Executor Service
                      * Java Generics support
                        * ```Deferred<Integer, Exception, Double> deferred;```
                        * ```deferred.resolve(10);```
                        * ```deferred.reject(new Exception());```
                        * ```deferred.notify(0.80);```
                      * Android Support
                      * Java 8 Lambda friendly
                      * Yes it's on Maven Central Repository!
                      
                      Maven
                      -----
                      ```xml
                      <dependency>
                          <groupId>org.jdeferred.v2</groupId>
                          <artifactId>jdeferred-core</artifactId>
                          <version>${version}</version>
                      </dependency>
                      ```
                      
                      Gradle
                      -----
                      ```
                      compile 'org.jdeferred.v2:jdeferred-core:${version}'
                      ```
                      
                      Find available versions on [Maven Central Repository](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.jdeferred.v2%22%20AND%20a%3A%22jdeferred-core%22).
                      
                      <a name="compatibility"></a>Compatibility
                      ==============
                      Compatibility reports between versions:
                      - [1.2.6 to 2.0.0](http://jdeferred.org/compatibility-report-2.0.0.html)
                      
                      <a name="examples"></a>Quick Examples
                      ==============
                      
                      <a name="examples-deferred-promise"></a>Deferred object and Promise
                      ---------------------------
                      
                      ```java
                      Deferred deferred = new DeferredObject();
                      Promise promise = deferred.promise();
                      promise.done(new DoneCallback() {
                        public void onDone(Object result) {
                          ...
                        }
                      }).fail(new FailCallback() {
                        public void onFail(Object rejection) {
                          ...
                        }
                      }).progress(new ProgressCallback() {
                        public void onProgress(Object progress) {
                          ...
                        }
                      }).always(new AlwaysCallback() {
                        public void onAlways(State state, Object result, Object rejection) {
                          ...
                        }
                      });
                      ```
                      With the reference to deferred object, you can then trigger actions/updates:
                      
                      ```java
                      deferred.resolve("done");
                      deferred.reject("oops");
                      deferred.notify("100%");
                      ```
                      
                      <a name="example-filter"></a>Filter
                      -----------
                      > Use `.filter(...)` instead of `.then(...)` since 2.0.0-Beta2
                      
                      ```java
                      Deferred d = …;
                      Promise p = d.promise();
                      Promise filtered = p.filter(new DoneFilter<Integer, Integer>() {
                        public Integer filterDone(Integer result)
                          return result * 10;
                        }
                      });
                      
                      filtered.done(new DoneCallback<Integer>() {
                        public void onDone(Integer result) {
                          // result would be original * 10
                          System.out.println(result);
                        }
                      });
                      
                      d.resolve(3) -> 30.
                      ```
                      
                      <a name="example-pipe"></a>Pipe
                      ----
                      > Use `.pipe(...)` instead of `.then(...)` since 2.0.0-Beta2
                      
                      ```java
                      Deferred d = ...;
                      Promise p = d.promise();
                      
                      p.pipe(new DonePipe<Integer, Integer, Exception, Void>() {
                        public Deferred<Integer, Exception, Void> pipeDone(Integer result) {
                          if (result < 100) {
                            return new DeferredObject<Integer, Void, Void>().resolve(result);
                          } else {
                            return new DeferredObject<Integer, Void, Void>().reject(new Exception(...));
                          }
                        }
                      }).done(...).fail(...);
                      
                      d.resolve(80) -> done!
                      d.resolve(100) -> fail!
                      
                      ```
                      
                      <a name="example-dm"></a>Deferred Manager
                      ----------------
                      ```java
                      DeferredManager dm = new DefaultDeferredManager();
                      Promise p1, p2, p3;
                      // initialize p1, p2, p3
                      dm.when(p1, p2, p3)
                        .done(…)
                        .fail(…)
                      ```
                      You can also specify a Executor Service for your need.
                      
                      ```
                      DeferredManager dm = new DefaultDeferredManager(myExecutorService);
                      ```
                      
                      <a name="example-runnable-callable"></a>Runnable and Callable
                      ---------------------
                      You can use Callable and Runnable almost like a Promise without any additional work.
                      
                      ```java
                      DeferredManager dm = new DefaultDeferredManager();
                      dm.when(new Callable<Integer>(){
                        public Integer call() {
                          // return something
                          // or throw a new exception
                        }
                      }).done(new DoneCallback<Integer>() {
                        public void onDone(Integer result) {
                          ...
                        }
                      }).fail(new FailCallback<Throwable>() {
                        public void onFail(Throwable e) {
                          ...
                        }
                      });
                      ```
                      
                      If you need to notify progress within your Callable or Runnable, you either need to create your own Deferred object and Promise, or you can use DeferredCallable and DeferredRunnable.
                      
                      Use your own Deferred object
                      
                      ```java
                      final Deferred deferred = ...
                      Promise promise = deferred.promise();
                      promise.then(…);
                      Runnable r = new Runnable() {
                        public void run() {
                          while (…) {
                            deferred.notify(myProgress);
                          }
                          deferred.resolve("done");
                        }
                      }
                      ```
                      
                      Or, extending DeferredRunnable
                      
                      ```java
                      DeferredManager dm = …;
                      dm.when(new DeferredRunnable<Double>(){
                        public void run() {
                          while (…) {
                            notify(myProgress);
                          }
                        }
                      }).then(…);
                      ```
                      
                      <a name="example-wait"></a>Wait and WaitSafely
                      -------------------
                      > Since 1.0.1
                      
                      Normally, when using this framework, you would want to do things asynchronously.  However, if there is a need to wait for all deferred tasks to finish, you can use Object.wait or Promise.waitSafely methods.
                      
                      ```java
                      Promise p = dm.when(...)
                        .done(...)
                        .fail(...)
                      
                      synchronized (p)
                        while (p.isPending()) {
                          try {
                            p.wait();
                          } catch (InterruptedException e) { ... }
                        }
                      }
                      ```
                      
                      Alternatively, you can use a more simplified shortcut
                      ```java
                      Promise p = dm.when(...)
                        .done(...)
                        .fail(...)
                      
                      try {
                        p.waitSafely();
                      } catch (InterruptedException e) {
                        ...
                      }
                      ```
                      
                      <a name="example-lambda"></a>Java 8 Lambda
                      -------------
                      Now this is pretty cool when used with Java 8 Lambda!
                      
                      ```Java
                      dm.when(() -> {
                        return "Hey!";
                      }).done(r -> System.out.println(r));
                      
                      dm.when(
                        () -> { return "Hello"; },
                        () -> { return "World"; }
                      ).done(rs ->
                        rs.forEach(r -> System.out.println(r.getResult()))
                      );
                      ```
                      
                      <a name="example-race"></a>When
                      -------------
                      Calls to `when` with multiple arguments results in a `Promise` that signals `fail` on the first rejection or signals
                      `done` with all computed values.
                      
                      #### Success scenario
                      ```Java
                      Callable<Integer> c1 = () -> 1;
                      Callable<Integer> c2 = () -> 2;
                      Callable<Integer> c3 = () -> 3;
                      Promise<MultipleResults3<Integer, Integer, Integer>, OneReject<Throwable>, MasterProgress> p = dm.when(c1, c2, c3);
                      p.done(MultipleResults3<Integer, Integer, Integer> r -> {
                        Assert.assertEquals(r.getFirst(), 1);
                        Assert.assertEquals(r.getSecond(), 2);
                        Assert.assertEquals(r.getThird(), 3);
                      });
                      ```
                      
                      #### Failure scenario
                      ```Java
                      Callable<Integer> c1 = () -> 1;
                      Callable<Integer> c2 = () -> 2;
                      Callable<Integer> c3 = () -> throw new RuntimeException("boom!");
                      Promise<MultipleResults3<Integer, Integer, Integer>, OneReject<Throwable>, MasterProgress> p = dm.when(c1, c2, c3);
                      p.done(MultipleResults3<Integer, Integer, Integer> r -> Assert.fail("should not be called"))
                       .fail(OneReject<Throwable> r -> Assert.assertEquals(r.getReject().getMessage(), "boom!"));
                      ```
                      > Since 2.0.0
                      
                      Calls to `when` with multiple arguments (up to five) will produce results with typesafe getters.
                      
                      <a name="example-when"></a>Race
                      -------------
                      > Since 2.0.0
                      
                      Calls to `race` with multiple arguments results in a `Promise` that signals `fail` on the first rejection or signals
                      `done` on the first resolution.
                      
                      #### Success scenario
                      ```Java
                      Callable<Integer> c1 = () -> { Thread.sleep(200); return 1; };
                      Callable<Integer> c2 = () -> { Thread.sleep(100); return 2; };
                      Callable<Integer> c3 = () -> { Thread.sleep(200); return 3; };
                      Promise<OneResult<?>, OneReject<Throwable>, Void> p = dm.race(c1, c2, c3);
                      p.done(OneResult<?> r -> Assert.assertEquals(r.getResult(), 2));
                      ```
                      #### Failure scenario
                      ```Java
                      Callable<Integer> c1 = () -> { Thread.sleep(200); return 1; };
                      Callable<Integer> c2 = () -> { Thread.sleep(100); throw new RuntimeException("boom!"); };
                      Callable<Integer> c3 = () -> { Thread.sleep(200); return 3; };
                      Promise<OneResult<?>, OneReject<Throwable>, Void> p = dm.race(c1, c2, c3);
                      p.done(OneResult<?> r -> Assert.fail("should not be called")
                        .fail(OneReject<Throwable> r -> Assert.assertEquals(r.getReject().getMessage(), "boom!"));
                      ```
                      
                      <a name="example-settle"></a>Settle
                      -------------
                      > Since 2.0.0
                      
                      Calls to `settle` with multiple arguments results in a `Promise` that collects all resolutions and rejections.
                      
                      ```Java
                      Callable<Integer> c1 = () -> { Thread.sleep(200); return 1; };
                      Callable<Integer> c2 = () -> { Thread.sleep(100); throw new RuntimeException("boom!"); };
                      Callable<Integer> c3 = () -> { Thread.sleep(200); return 3; };
                      Promise<AllValues, Throwable, MasterProgress>, Void> p = dm.race(c1, c2, c3);
                      p.done(AllValues r -> {
                        Assert.assertEquals(r.get(0).getValue(), 1);
                        Assert.assertTrue(r.get(1).getValue() instanceof RuntimeException);
                        Assert.assertEquals(r.get(2).getValue(), 3);
                      });
                      ```
                      
                      <a name="example-cancellation"></a>Cancellation Handler
                      -------------
                      > Since 2.0.0
                      
                      Sometimes a task may be cancelled while its running and would require ti cleanup any resources it may have allocated. You
                      may define a task that implements the `org.jdeferred2.CancellationHandler` interface or pass and extra argument to
                      `DeferredFutureTask` with such implementation, for example
                      
                      ```Java
                      final DataSource datasource = ...;
                      class DatabaseTask extends Runnable, CancellationHandler {
                        @Override
                        public void run() {
                          // perform computation with datasource
                        }
                      
                        @Override
                        public void onCancel() {
                          try {
                            datasource.close();
                          } catch(Exception e) {
                            throw new IllegalStateException(e);
                          }
                        }
                      }
                      
                      DeferredFutureTask<X> task = new DeferredFutureTask(new DatabaseTask());
                      dm.when(task).done(...)
                      ```
                      
                      You may also pass the `CancellationHandler` as an additional argument, for example
                      
                      ```Java
                      final DataSource datasource = ...;
                      class DatabaseTask extends Runnable {
                        @Override
                        public void run() {
                          // perform computation with datasource
                        }
                      }
                      
                      class DatabaseCancellationHandler implements CancellationHandler {
                        @Override
                        public void onCancel() {
                          try {
                            datasource.close();
                          } catch(Exception e) {
                            throw new IllegalStateException(e);
                          }
                        }
                      }
                      
                      DeferredFutureTask<X> task = new DeferredFutureTask(new DatabaseTask(), new DatabaseCancellationHandler());
                      dm.when(task).done(...)
                      ```
                      
                      <a name="example-groovy"></a>Groovy
                      -----
                      You can also easily use with Groovy!
                      
                      ```Groovy
                      @Grab('org.jdeferred.v2:jdeferred-core:2.0.0')
                      import org.jdeferred2.*
                      import org.jdeferred2.impl.*
                      
                      def deferred = new DeferredObject()
                      def promise = deferred.promise()
                      
                      promise.done { result ->
                        println "done: $result"
                      }.fail { rejection ->
                        println "fail: $rejection"
                      }.always { state, result, rejection ->
                        println "always"
                      }
                      
                      deferred.resolve("done")
                      ```
                      
                      <a name="example-android"></a>Android Support
                      ---------------
                      > Since 1.1.0-Beta1
                      
                      ```jdeferred-android``` is now available, and it can be included just like any other Android libraries!
                      It also uses Android Maven plugin and builds apklib file.  If you use Android Maven plugin, you can include
                      dependency:
                      
                      APKLIB with Maven:
                      ```xml
                      <dependency>
                        <groupId>org.jdeferred.v2</groupId>
                        <artifactId>jdeferred-android</artifactId>
                        <version>${version}</version>
                        <type>apklib</type>
                      </dependency>
                      ```
                      
                      
                      AAR with Maven:
                      > Since 1.2.0-Beta1
                      
                      ```xml
                      <dependency>
                        <groupId>org.jdeferred.v2</groupId>
                        <artifactId>jdeferred-android-aar</artifactId>
                        <version>${version}</version>
                        <type>aar</type>
                      </dependency>
                      ```
                      
                      AAR with Gradle:
                      ```
                      compile 'org.jdeferred.v2:jdeferred-android-aar:${version}'
                      // or
                      compile 'org.jdeferred.v2:jdeferred-android-aar:${version}@aar'
                      ```
                      
                      Find available versions on [Maven Central Repository](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.jdeferred.v2%22%20AND%20a%3A%22jdeferred-core%22).
                      
                      ```jdeferred-android``` introduces a new ```DeferredManager``` implementation called ```AndroidDeferredManager```.
                      ```AndroidDeferredManager``` makes sure that callbacks are executed in UI Thread rather than background Thread
                      in order for callbacks to make UI updates.  Alternatively, callbacks can also implement ```AndroidExecutionScopeable```
                      interface to fine-grain control whether the callback should execute in UI Thread or background Thread.
                      
                      ```AndroidDeferredManager``` also supports new ```DeferredAsyncTask``` object.  This object is based on
                      Android's ```AsyncTask```.
                      
                      If you need to always execute callbacks in background thread, then you can continue to use ```DefaultDeferredManager```.
                      
                      Lastly, because JDeferred use SLF4J - you can further route log messages using ```slf4j-android```.
                      
                      
                      <a name="example-async-servlet"></a>Asynchronous Servlet
                      --------------------
                      Here is a sample code on how to use JDeferred with Asynchronous Servlet!
                      
                      ```java
                      @WebServlet(value = "/AsyncServlet", asyncSupported = true)
                      public class AsyncServlet extends HttpServlet {
                        private static final long serialVersionUID = 1L;
                        private ExecutorService executorService = Executors.newCachedThreadPool();
                        private DeferredManager dm = new DefaultDeferredManager(executorService);
                      
                        protected void doGet(HttpServletRequest request,
                                             HttpServletResponse response) throws ServletException, IOException {
                          final AsyncContext actx = request.startAsync(request, response);
                      
                          dm.when(new Callable<String>() {
                            @Override
                            public String call() throws Exception {
                              if (actx.getRequest().getParameter("fail") != null) {
                                throw new Exception("oops!");
                              }
                              Thread.sleep(2000);
                              return "Hello World!";
                            }
                          }).then(new DoneCallback<String>() {
                            @Override
                            public void onDone(String result) {
                              actx.getRequest().setAttribute("message", result);
                              actx.dispatch("/hello.jsp");
                            }
                          }).fail(new FailCallback<Throwable>() {
                            @Override
                            public void onFail(Throwable exception) {
                              actx.getRequest().setAttribute("exception", exception);
                              actx.dispatch("/error.jsp");
                            }
                          });
                        }
                      }
                      ```
                      <!-- Google Code for GitHub Visit Conversion Page -->
                      <script type="text/javascript">
                      /* <![CDATA[ */
                      var google_conversion_id = 974052972;
                      var google_conversion_language = "en";
                      var google_conversion_format = "3";
                      var google_conversion_color = "ffffff";
                      var google_conversion_label = "wsVZCOycvgkQ7Ly70AM";
                      var google_conversion_value = 0;
                      var google_remarketing_only = false;
                      /* ]]> */
                      </script>
                      <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
                      </script>
                      <noscript>
                      <div style="display:inline;">
                      <img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/974052972/?value=0&label=wsVZCOycvgkQ7Ly70AM&guid=ON&script=0"/>
                      </div>
                      </noscript>
                      
                      <a name="deprecations"></a>Deprecations
                      ==============
                      
                      <a name="deprecations-v1.2.5"></a>v1.2.5

                      API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()

                      copy iconCopydownload iconDownload
                       dependencies {
                              classpath 'com.android.tools.build:gradle:3.2.1'
                              classpath 'com.google.gms:google-services:4.2.0'
                              classpath 'io.fabric.tools:gradle:1.27.0'
                      
                              // NOTE: Do not place your application dependencies here; they belong
                              // in the individual module build.gradle files
                          }
                      
                      apply plugin: 'io.fabric'
                      
                      classpath 'io.fabric.tools:gradle:1.27.1'
                      
                      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20"
                      
                      classpath 'io.fabric.tools:gradle:1.27.1'
                      
                      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20"
                      
                      classpath 'io.fabric.tools:gradle:1.28.1'
                      
                      apply plugin: 'com.android.application'
                      // apply plugin: 'io.fabric' <== this plugin causes the error
                      
                      classpath 'io.fabric.tools:gradle:1.28.1'
                      
                      apply plugin: 'com.android.application'
                      // apply plugin: 'io.fabric' <== this plugin causes the error
                      
                      classpath 'com.android.tools.build:gradle:3.2.1'
                      
                      compileOptions {
                          sourceCompatibility 1.8
                          targetCompatibility 1.8
                      }
                      
                      buildscript {
                      // ... repositories, etc. ...
                      
                      dependencies {
                          // ...other dependencies ...
                          **classpath 'io.fabric.tools:gradle:1.28.0'**
                      }
                      
                      classpath 'com.android.tools.build:gradle:3.3.0'
                      classpath 'io.fabric.tools:gradle:1.27.0'
                      
                      //apply plugin: 'io.fabric'
                      
                      classpath 'io.fabric.tools:gradle:1.27.0'
                      
                      //apply plugin: 'io.fabric'
                      
                      classpath 'io.fabric.tools:gradle:1.27.0'
                      
                      buildscript {
                         // ... repositories, etc. ...
                      
                          dependencies {
                              // ...other dependencies ...
                              classpath 'io.fabric.tools:gradle:1.28.0'
                          }
                      }
                      
                      buildscript {
                        // ... repositories, etc. ...
                      
                         dependencies {
                             // ...other dependencies ...
                             classpath 'io.fabric.tools:gradle:1.30.0'
                         }
                      }
                      
                              classpath 'io.fabric.tools:gradle:1.28.0'
                      
                          apply plugin: 'io.fabric'
                      
                              classpath 'io.fabric.tools:gradle:1.28.0'
                      
                          apply plugin: 'io.fabric'
                      
                      repositories {
                          maven { url "https://jitpack.io" }
                          maven {
                              url 'https://maven.fabric.io/public'
                          }
                          google()
                          jcenter()
                      
                      }
                      dependencies {
                      
                          classpath 'com.android.tools.build:gradle:3.5.0'
                          classpath 'com.google.gms:google-services:4.3.0'
                          classpath 'io.fabric.tools:gradle:1.30.0'
                      }
                      

                      What casuses Spring Boot Fail-safe cleanup (collections) to occur

                      copy iconCopydownload iconDownload
                      FBT findByMainProductAndCollection(SProduct mainProduct,Date collection);
                      
                      Long countByMainProductAndCollection(SProduct mainProduct, Date collection);
                      
                      Boolean existsByMainProductAndCollection(SProduct mainProduct, Date collection)
                      
                      FBT findByMainProductAndCollection(SProduct mainProduct,Date collection);
                      
                      Long countByMainProductAndCollection(SProduct mainProduct, Date collection);
                      
                      Boolean existsByMainProductAndCollection(SProduct mainProduct, Date collection)
                      
                      FBT findByMainProductAndCollection(SProduct mainProduct,Date collection);
                      
                      Long countByMainProductAndCollection(SProduct mainProduct, Date collection);
                      
                      Boolean existsByMainProductAndCollection(SProduct mainProduct, Date collection)
                      
                      @OneToMany(fetch = FetchType.EAGER, mappedBy = "mainProduct", cascade = CascadeType.ALL)
                      @Fetch(value=FetchMode.SELECT)
                      private Set<FBT> fbts;
                      

                      Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1)

                      copy iconCopydownload iconDownload
                      // Top-level build file where you can add configuration options common to all sub-projects/modules.
                      
                      buildscript {
                      
                          repositories {
                              google() // first one
                              jcenter()
                          }
                          dependencies {
                              classpath 'com.android.tools.build:gradle:3.2.1'
                      
                      
                              // NOTE: Do not place your application dependencies here; they belong
                              // in the individual module build.gradle files
                          }
                      }
                      
                      allprojects {
                          repositories {
                              google() // first one
                              jcenter()
                          }
                      }
                      

                      See all related Code Snippets

                      Community Discussions

                      Trending Discussions on jdeferred
                      • API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()
                      • What casuses Spring Boot Fail-safe cleanup (collections) to occur
                      • Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1)
                      Trending Discussions on jdeferred

                      QUESTION

                      API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()

                      Asked 2019-Aug-22 at 18:32

                      Using Android Studio 3.3 Canary 11 with the gradle plugin version 3.3.0-alpha11. It throws the following error when trying to sync gradle

                      WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been 
                      replaced with 'variant.getExternalNativeBuildProviders()'.
                      It will be removed at the end of 2019.
                      For more information, see https://d.android.com/r/tools/task-configuration- 
                      avoidance
                      Affected Modules: app
                      

                      Clicking on the error leads me to this line in the gradle file

                      applicationVariants.all { variant ->
                                  variant.outputs.all {
                                      outputFileName = "${variant.name}-${variant.versionName}.apk"
                                  }
                              }
                      

                      What exactly do I need to change here?

                      project build.gradle

                      // Top-level build file where you can add configuration options common to all sub-projects/modules.
                      
                      buildscript {
                          repositories {
                              jcenter()
                              mavenCentral() // jcenter() works as well because it pulls from Maven Central
                              maven { url "https://maven.google.com" }
                              google()
                          }
                      
                          dependencies {
                              classpath 'com.android.tools.build:gradle:3.3.0-alpha11'
                      
                              // NOTE: Do not place your application dependencies here; they belong
                              // in the individual module build.gradle files
                              classpath "io.realm:realm-gradle-plugin:4.1.1"
                              classpath 'com.google.gms:google-services:3.2.1'
                              classpath 'com.google.firebase:firebase-plugins:1.1.5'
                          }
                      }
                      
                      allprojects {
                          repositories {
                              jcenter()
                              maven { url "https://maven.google.com" }
                          }
                      }
                      
                      task clean(type: Delete) {
                          delete rootProject.buildDir
                      }
                      
                      // Define versions in a single place
                      ext {
                          // Sdk and tools
                          minSdkVersion = 21
                          targetSdkVersion = 27
                          compileSdkVersion = 27
                          buildToolsVersion = '27.0.3'
                      
                          // App dependencies
                          supportLibraryVersion = '27.1.1'
                          appCompactLibraryVersion = '27.1.1'
                          playServicesVersion = '15.0.1'
                          firebaseVersionCore = '16.0.1'
                          firebaseVersionPerf = '16.0.0'
                          firebaseVersionMessaging = '17.1.0'
                      
                          //lottie
                          lottieVersion = '2.5.0'
                      }
                      

                      app build.gradle

                      buildscript {
                          repositories {
                              maven { url 'https://maven.fabric.io/public' }
                          }
                      
                          dependencies {
                              classpath 'io.fabric.tools:gradle:1.25.4'
                          }
                          buildscript {
                              repositories {
                                  maven { url "https://maven.google.com" }
                                  maven { url 'https://maven.fabric.io/public' }
                                  mavenCentral()
                      
                              }
                      
                              dependencies {
                                  // These docs use an open ended version so that our plugin
                                  // can be updated quickly in response to Android tooling updates
                      
                                  // We recommend changing it to the latest version from our changelog:
                                  // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
                                  classpath 'io.fabric.tools:gradle:'
                              }
                          }
                      }
                      apply plugin: 'com.android.application'
                      apply plugin: 'com.google.firebase.firebase-perf'
                      repositories {
                          maven { url 'https://maven.fabric.io/public' }
                      }
                      
                      apply plugin: 'io.fabric'
                      apply plugin: 'realm-android'
                      
                      android {
                      
                          realm {
                              syncEnabled = false
                          }
                      
                          dexOptions {
                              javaMaxHeapSize "4g"
                          }
                      
                          compileSdkVersion rootProject.ext.compileSdkVersion
                      
                          defaultConfig {
                              applicationId "example.com"
                              minSdkVersion rootProject.ext.minSdkVersion
                              multiDexEnabled true
                              versionCode mVersionCode
                              versionName mVersionName
                              vectorDrawables.useSupportLibrary = true
                      
                          }
                      
                          compileOptions {
                              sourceCompatibility JavaVersion.VERSION_1_8
                              targetCompatibility JavaVersion.VERSION_1_8
                          }
                      
                          buildTypes {
                      
                              applicationVariants.all { variant ->
                                  variant.outputs.all {
                                      outputFileName = "${variant.name}-${variant.versionName}.apk"
                                  }
                              }
                      
                              release {
                                  shrinkResources true
                                  minifyEnabled true
                                  useProguard true
                                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                      
                                  lintOptions {
                                      disable 'MissingTranslation'
                                  }
                      
                                  applicationVariants.all { variant ->
                                      variant.outputs.all {
                                          outputFileName = "${variant.name}-${variant.versionName}.apk"
                                      }
                                  }
                      
                              }
                              debug {
                                  shrinkResources true
                                  minifyEnabled true
                                  useProguard true
                                  debuggable true
                                  versionNameSuffix '-DEBUG'
                                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'debug-proguard-rules.pro'
                      
                                  ext.enableCrashlytics = false
                                  crunchPngs false
                      
                              }
                          }
                      
                          flavorDimensions "default"
                      
                          lintOptions {
                      
                              checkReleaseBuilds false
                      
                          }
                      
                          packagingOptions {
                              exclude 'META-INF/DEPENDENCIES.txt'
                              exclude 'META-INF/LICENSE.txt'
                              exclude 'META-INF/NOTICE.txt'
                              exclude 'META-INF/NOTICE'
                              exclude 'META-INF/LICENSE'
                              exclude 'META-INF/DEPENDENCIES'
                              exclude 'META-INF/notice.txt'
                              exclude 'META-INF/license.txt'
                              exclude 'META-INF/dependencies.txt'
                              exclude 'META-INF/LGPL2.1'
                          }
                          buildToolsVersion '28.0.2'
                      }
                      
                      configurations {
                          implementation.exclude group: "org.apache.httpcomponents", module: "httpclient"
                      }
                      
                      dependencies {
                          implementation fileTree(include: ['*.jar'], dir: 'libs')
                      
                          implementation "com.android.support:appcompat-v7:$rootProject.appCompactLibraryVersion"
                          implementation "com.android.support:support-compat:$rootProject.supportLibraryVersion"
                          implementation "com.android.support:mediarouter-v7:$rootProject.supportLibraryVersion"
                          implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
                          implementation "com.android.support:design:$rootProject.supportLibraryVersion"
                      
                      
                          api 'com.squareup.retrofit2:retrofit:2.4.0'
                          api 'com.squareup.okhttp3:okhttp:3.11.0'
                          api 'com.squareup.okhttp3:logging-interceptor:3.10.0'
                          implementation 'com.google.code.gson:gson:2.8.2'
                          implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
                          implementation 'com.squareup.picasso:picasso:2.5.2'
                          implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
                          implementation 'com.android.support:multidex:1.0.3'
                          implementation 'com.daimajia.easing:library:2.0@aar'
                          implementation 'com.daimajia.androidanimations:library:2.3@aar'
                      
                          implementation 'com.akexorcist:googledirectionlibrary:1.0.5'
                          implementation 'io.reactivex:rxandroid:1.2.1'
                          implementation 'io.reactivex:rxjava:1.3.0'
                          // Wifi hotspot library
                          implementation 'cc.mvdan.accesspoint:library:0.2.0'
                          implementation 'com.android.support.constraint:constraint-layout:1.1.3'
                          implementation 'org.jsoup:jsoup:1.10.3'
                          api "com.airbnb.android:lottie:$rootProject.lottieVersion"
                          implementation 'com.android.support:support-v4:27.1.1'
                          implementation 'com.android.support:recyclerview-v7:27.1.1'
                          testImplementation 'junit:junit:4.12'
                          implementation 'com.jakewharton:butterknife:8.8.1'
                      
                          debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
                          releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
                      
                          implementation 'com.googlecode.libphonenumber:libphonenumber:8.2.0'
                      
                          implementation "com.google.android.gms:play-services-base:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-cast-framework:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-auth:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-identity:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-awareness:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-cast:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-drive:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-location:$rootProject.playServicesVersion"
                          implementation "com.google.android.gms:play-services-maps:$rootProject.playServicesVersion"
                      
                          implementation "com.google.firebase:firebase-core:$rootProject.firebaseVersionCore"
                          implementation "com.google.firebase:firebase-perf:$rootProject.firebaseVersionPerf"
                          implementation "com.google.firebase:firebase-messaging:$rootProject.firebaseVersionMessaging"
                          implementation "com.google.firebase:firebase-analytics:$rootProject.firebaseVersionCore"
                      
                      
                          api('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
                              transitive = true
                          }
                          api('com.crashlytics.sdk.android:answers:1.4.1@aar') {
                              transitive = true
                          }
                          annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
                          api project(path: ':libraryBTHelper')
                          api project(':bkk_rush')
                      
                          debugApi 'com.amitshekhar.android:debug-db:1.0.3'
                          api "org.jdeferred:jdeferred-android-aar:1.2.6"
                          implementation 'com.android.support:gridlayout-v7:27.1.1'
                      }
                      
                      apply plugin: 'com.google.gms.google-services'
                      

                      I have skipped out a few constants and other sensitive information in the app/build.gradle file.

                      ANSWER

                      Answered 2019-Jan-17 at 23:53

                      the issue-tracker might refer to "lazy task configuration" -

                      that's at least what task configuration avoidance suggests.

                      but one possibly can prevent the access to this obsolete method of BaseVariantImpl, when variant.outputs.all won't access that method (internally) - or when checks can prevent the access; or when accessing the variant by it's name; or somehow disable the external native build tasks for the variant. also see the single-variant project sync option, which rather seems related.

                      or wait for build-tools 3.3.0-alpha12 or 3.3.0-beta1 ...this is not even a release candidate, therefore investing to much time might be pointless - except using it to file another bug-report.

                      the new quick feedback quick feedback button still looks the most promising.

                      Source https://stackoverflow.com/questions/52412023

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install jdeferred

                      You can download it from GitHub, Maven.
                      You can use jdeferred like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the jdeferred component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Share this Page

                      share link
                      Consider Popular Reactive Programming Libraries
                      Try Top Libraries by jdeferred
                      Compare Reactive Programming Libraries with Highest Support
                      Compare Reactive Programming Libraries with Highest Quality
                      Compare Reactive Programming Libraries with Highest Security
                      Compare Reactive Programming Libraries with Permissive License
                      Compare Reactive Programming Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.