Monday, April 21, 2014

How to use sling thread pool in CQ/AEM

Use Case: You are designing an application where you might need to delegate Job to a separate thread and you want to control this using thread pool so that your application it self does not run out of threads.

Prerequisite: Knowledge of Java Threads and basic Knowledge of thread pool. Note that there are Java Level thread pool as well that you can use. Check http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/package-summary.html for that.

Reference: https://sling.apache.org/documentation/bundles/apache-sling-commons-thread-pool.html

Implementation Example:

Step 1: Create your Thread class

public YourThreadClass implements Runnable {


 public void run() {
    //Your custom logic
}
}

Step 2: Main class to use sling Thread pool


Use CQ dependency finder to find what dependency you need for above code in your pom.xml

48 comments:

  1. Nice use case. We will promote this from with Adobe.

    ReplyDelete
  2. Thanks for this great share. This site is a fantastic resource. Keep up the great work here at Sprint Connection! Many thanks.

    Southbay Pool Cleaning Services

    ReplyDelete
  3. Independent Call Girls in Delhi | Service available 24*7 hours | Call Us +91-9899900591 | Independent Housewives are availableat your nearest location | visit us at = http://www.sexydelhicityescorts.com/
    Delhi Call Girls��
    *-*
    Delhi Escort Service��
    *-*
    Female Escorts in Delhi��
    *-*
    Call Girls in Saket ��
    *-*
    Laxmi Nagar Call Girls��
    *-*

    ReplyDelete
  4. Hellow Everyone? Connaught palce Escorts Agency welcomes to you.come with us for fully sexual satisfaction.contact us on :-9711199171.for get more details about us visit my website:-
    south ex Escorts

    surajkund Escorts

    Mayur vihar Escorts

    lajpat nagar Escorts

    karol bagh Escorts

    vasant vihar

    ReplyDelete
  5. There has been a mighty influence from the Astrologer in Mumbai Ajay Shastri. The influence is because of the contribution that he had provided to the ones who have already asked them for their service. best mantra astrologer contact Us - 7837827129.

    Astrologer In Mumbai $$$$
    Astrologer Mumbai $$$$
    Vashikaran Specialist In Mumbai $$$$
    Black Magic Specialist In Mumbai $$$$
    Vashikaran Specialist Mumbai $$$$
    Black Magic Specialist Mumbai $$$$

    ReplyDelete

  6. Welcome to VIP Delhi Escorts, the escort agency with the excellent skills of love making. Our Call Girls service in Delhi can make anyone happy because we are available 24/7. You can feel free to call us: 9873940964 anytime.

    delhi escorts

    delhi escort

    call girls in delhi

    delhi call girls

    call girls in delhi

    russian delhi escorts

    delhi escorts

    delhi escort

    call girls in delhi

    delhi call girls

    ReplyDelete
  7. He has been serving for the developing the people for their good and therefore helping the society to modify. Astrologer In Delhi His contribution is praiseworthy and people do have his influence at the time of their need and he is performing up to their level of expectations. best mantra astrologer Ajay Shastri Contact Us - 7837827129.

    Astrologer In Delhi $$$$
    Astrologer Delhi $$$$
    Vashikaran Specialist In Delhi $$$$
    Black Magic Specialist In Delhi $$$$
    Vashikaran Specialist Delhi $$$$
    Black Magic Specialist Delhi $$$$

    ReplyDelete
  8. call girls in delhi contact for high profile call girls in your nearest location : housewife and vip russian call girls are available : click at http://shanvibhardwaj.in/contact.html for full fun.
    Nehru Place Call Girls ***

    Paharganj Call Girls ***

    Pitampura Call Girls ***

    Mehrauli Call Girls ***

    Hauzkhas Call Girls ***

    Vikaspuri Call Girls ***

    Indirapuram Call Girls ***

    Kaushambi Call Girls ***

    Raj Nagar Call Girls ***

    ReplyDelete
  9. Faridabad Escorts and College Call Girl in Faridabad is available 24 hours (call now 09873940964) for erotic escort services in Faridabad call girls.

    Greater kailash escorts @#@#@#@#@#@
    Hauz khas escorts @#@#@#@#@#@
    Janakpuri escorts @#@#@#@#@#@
    Kapashera escorts @#@#@#@#@#@
    Karolbagh escorts @#@#@#@#@#@
    Lajpat nagar escorts @#@#@#@#@#@
    Mahipalpur escorts @#@#@#@#@#@

    ReplyDelete
  10. If you are looking for Escorts Service in Noida and CALL GIRLS? independent call girls in Noida book @ 9873940964. Browse in our call girl category & get Hot girls in your hotel room.visit my website:
    indirapuram escorts
    crossings republik escorts
    greater noida escorts
    cr park escorts
    tilak nagar escorts
    janakpuri escorts
    uttam nagar escorts
    kalkaji escorts
    defence colony escorts
    chanakyapuri escorts

    ReplyDelete
  11. Welcome to VIP Delhi Call Girls with the finest skills of love making. Call:9711199012, Our Delhi escorts Service can make anyone happy because we are available 24/7

    call girls bhorgarh ####
    call girls budh vihar ####
    call girls chawri bazar ####
    call girls chittaranjan park ####
    call girls mukherjee nagar ####
    call girls gautam nagar ####

    ReplyDelete
  12. Contact to High profile Noida call girls via whatsapp Number for adorable fun, she shared own real photos for every visitor or clients who are liable and intrested to take my services then contact me @9873940964.visit my website :-

    vaishali call girls

    indirapuram call girls

    vasundhara call girls

    kaushambi call girls

    surajkund call girls

    mukherjee nagar call girls

    khan market call girls

    ashram call girls

    munirka call girls

    shalimar garden call girls





    ReplyDelete
  13. Thanks for sharing this article. this is very interesting and impressive post. all the details are awesome and good in this post.That is really fascinating, You are a very skilled blogger.
    connaught place escorts ###
    cr park escorts ###
    daryaganj escorts ###
    defence colony escorts ###
    dhaula kuan escorts ###
    dwarka escorts ###
    east of kailash escorts ###
    govindpuri escorts ###

    ReplyDelete

  14. Desire to hire a sensational Noida Escorts Service for your inner soul satisfaction. Our Female Escorts in Noida make your life complete with hot ladies and book 9873940964 for romance.visit my website:-

    chanakyapuri escorts

    connaught place escorts

    defence colony escorts

    dhaula kuan escorts

    dwarka escorts

    east of kailash escorts

    greater kailash escorts

    hauz khas escorts

    janakpuri escorts

    kapashera escorts


    ReplyDelete

  15. Are you looking for service high profile call girls noida.We are one of the best call girls and deliver escorts services throughout the noida .


    noida film city escorts

    atta market escorts

    new ashok nagar escorts

    noida sector 93 escorts

    noida sector 137 escorts

    ReplyDelete
  16. Nice Post Thanks for sharing This post Please keep Up the Post and get the full satisfaction our escorts girls or visit my website:All of our escorts at first experience through an individual gathering before they join our association, so we can guarantee our client for the best escorts of delhi and when appeared differently in relation to some other humble girls pro associations in the city.
    dwarka call girls
    south ex call girls
    hari nagar call girls
    kalkaji call girls

    ReplyDelete
  17. Hello I am Falak Khan. I am Very Sexy Call Girl In Hyderabad meet me And enjoy with me full night contact me 8700718438.

    Hyderabad Call Girls **&**
    Hyderabad Escorts **&**
    Escorts In Hyderabad **&**
    Hyderabad escorts services **&**
    Hyderabad independent escorts **&**
    Call Girls in Hyderabad **&**

    ReplyDelete
  18. Tilak nagar escort service congratulates you for reaching the right destination. Today, we have earned a reputation for working with the most impressive call girls.


    munirka escorts

    rajendra place escorts

    cr park escorts

    tilak nagar escorts

    janakpuri escorts

    uttam nagar escorts

    noida escorts

    ReplyDelete
  19. Our unique Escort Service in chandni chowk offers models, celebrities and high profile call girls for 101% sexual satisfaction. We provide chandni chowk Female Escort Service
    vikas nagar Escorts

    indirapuram Escorts

    ashok nagar Escorts

    ashok vihar Escorts

    connaught place Escorts

    chanakyapuri Escorts

    chandni chowk Escorts

    chattarpur Escorts

    civil lines Escorts

    ReplyDelete


  20. Hi Guys! This is Sujata, I am a leading Mumbai Escorts that runs a world class Mumbai Escorts in my own name. I am one of the most popular and High Profile Escorts in Mumbai that only serves the classy and selected personalities of Mumbai.
    Ranchi Escorts

    ReplyDelete
  21. Book now 9899900591 sexy and awesome Noida escorts girls for hotels service for ultimate romance and fun. Contact us for all your needs, rovide you best Noida Escorts Service.

    Noida escorts ####
    escorts in noida ####
    http://www.missdipika.com/charges.html ####
    http://www.missdipika.com/gallery.html ####
    http://www.missdipika.com/contact.html ####
    http://manishasharma.in/gallery.html ####
    http://manishasharma.in/links.html ####
    http://manishasharma.in/contact.html ####

    ReplyDelete

  22. Hello.......Guys. Are you in noida and feel boring. you want enjoy with cool girls whole night. Escorts service in noida welcomes to you. come with us and enjoy with cool and hot girls. contact us on :- 9873940964. visit my website :-
    Noida Escorts //
    Escorts in Noida //
    Noida Call Girls \\
    Premium Escorts Noida \\

    ReplyDelete
  23. As an External audit firm, Alkhadim LLC provides a full range of external audit services, including audits, reviews, compilations.

    ReplyDelete
  24. However, these housewife escorts are very much dedicated to provide extremely satisfactory performance to the clients to make each consumer as their permanent client. Nowadays many college girls and younger girls are performing as College call girls mumbai to enjoy an open life and earn huge amount of money from this profession. These college call girls are young, energetic, fashionable, cheerful, hot and beautiful. Hence you will definitely avail their companion with unlimited pleasure and fun.
    worli call girls
    ower parel call girls
    okhandwala call girls
    kurla call girls
    mira road call girls

    ReplyDelete
  25. I Am Ritu Sharma. I Run my Own Mumbai Call Girls Service. I Am Very Hot And Sexy. I Have Five Years’ Experience. That’s why I Understand the Each Personal Needs of My Every Client. My Service Charge Is Low And Service Is Super. You Can Avail My VIP Escorts Service At Your Home Or In Hotel. I Am Comfortable To Provide Escorts Service In Local And Outside Also.
    Visit http://www.escortservicemumbai.net/mumbai-call-girls/
    Call +91- 9OO4OO9481

    Visit The Links Below And Have A Look At My Various Escort Services-
    Mumbai Escorts
    Mumbai Escorts In Lokhandwala
    Escort Service In Gore Gaon
    Juhu Escorts
    Andheri Escorts
    Bandra Escorts
    Mumbai Call Girls


    ReplyDelete
  26. VAT Registration in Dubai is mandatory for companies and individuals doing businesses in the UAE, having an annual
    turnover of more than AED 375,000/-.

    ReplyDelete
  27. A business entity who is found guilty of the following tasks falls under the bracket of VAT penalties.

    ReplyDelete
  28. Escorts In Mumbai are the best of associates to be hired for the session of intimacy

    Visit now :-

    mumbai escorts ###
    mumbai call girls ###
    mumbai escorts service ###
    independent mumbai escorts ###
    escort service in mumbai ###

    ReplyDelete
  29. Nice Post thanks For sharing this Post Please keep up The Post and visit My website:
    greater noida call girls
    noida extension call girls
    crossings republik call girls

    ReplyDelete
  30. We are providing SMO Services in Noida that helps to boost your site's visibility in the search results.

    ReplyDelete
  31. Is your money & business going down through the weak digital marketing strategies, bringing no results? then Come & join hands with digital marketing company noida.

    ReplyDelete
  32. Buy sensor products at low prices in India. Shop for sensor products online on Amicikart®. Get free shipping & cod options across India.

    ReplyDelete
  33. Adult dating site for sexual desires and fantasies.Female escorts and the best escort services in Mumbai.Welcome to Vip Escorts In Mumbai the escorts in mumbai with the finest skills of love making. Call: 9004063011, Our mumbai escorts can make anyone happy because we are available 24/7.Pornstar escorts In Mumbai VIP girls fashion models and high-class companions Mumbai for you. Female
    escort agency Mumbai girls offers high class escort service and erotic massage in Mumbai. Our elite escort
    models in Mumbai available for incall, outcall and travel throughout Mumbai. beautiful female escort girls
    that our Mumbai Escort Babes website offers to you. There are different kind of ladies you can choose from
    Mumbai. Fresh Escorts directory with elite girls working in Mumbai,
    http://www.escortservicesmumbai.com/
    http://www.escortgirlinmumbai.com/
    http://www.mumbaibeautygirls.com/
    http://www.mumbaimassageservices.com/

    ReplyDelete
  34. The ones young ladies are perfectly solid for managing each thought about positively one of your solicitations. VIP Escorts in Delhi They could kiss you at the fitting spot. What's more, they could engage you the correct method to show you decisively what you need. You can have them in any capacity anyway you see sound. Also, they'll now not avoid that, you could have the guarantee of. In this way, strategy their assortment without worrying over a single segment considering the ones Delhi escorts understands the way to address your solicitations.

    ReplyDelete
  35. What's more, the whole thing remains unobtrusive in view of the reality that we're imagining about our customers ' security policies and keeping our customers ' information as confidential as possible is probable to be in the situation. The duration of these ranks, when you're in Hyderabad tonight and you need a VIP to get laid, Call Girls in Hyderabad our organization and we'll solve you with some of the biggest Escorts class representative unique predominance Escorts in Hyderabad.

    ReplyDelete
  36. Be your personality and state what you feel, in light of the fact that the people who brain don't have any kind of effect, and the people who matter wouldn't worry. Delhi Escorts

    ReplyDelete
  37. You would never get the opportunities of making complains against the services of Faridabad Escorts .They seem to be just overwhelming their clients as and whenever they are in needs trying to ease down the level of pains and boredom in lives.

    call girls hosur road !!!!
    call girls jp nagar !!!!
    call girls electronic city !!!!
    call girls jayanagar !!!!
    call girls ramamurthy nagar !!!!
    call girls bannerghatta road !!!!
    call girls banashankari 3rd stage !!!!
    call girls mg road bangalore !!!!
    call girls richmond town !!!!
    call girls ngef !!!!

    ReplyDelete