Friday, August 31, 2012

Did some hacking away using the Guava Cache libraries.  Pretty cool way to handle multiple requests hitting a Web Service at one time.  Will cover more of this in an expanded blog post later on.

        cache = CacheBuilder
                       .newBuilder()
                       .concurrencyLevel(4)
                       .maximumSize(MAX_SIZE)
                       .expireAfterWrite(10, TimeUnit.MINUTES)
                       .build(new CacheLoader="jobacknowledgement">() {
                               @Override
                               public JobAcknowledgement load(Integer jobId)
                                   throws Exception {
                                   return scheduleNewJob(jobId);
                               }
                         });
Post a Comment