Listening for events

Posted on 2011-05-04
Last Modified: 2012-05-11
I was reading folowing lines and I did not understand clearly.
 Listening for events
This interface forces your bean to implement the onApplicationEvent() method,
which is responsible for reacting to the application event.

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
Question by:gudii9
    LVL 92

    Expert Comment

    When a bean implement ApplicationListener it will be notified (onApplicationEvent()) gets called when an application event occurs
    this is useful if you're bean needs to know for example when the application has started up, or is shutting down
    LVL 47

    Accepted Solution

    If you register bean as application event listener then the container will call onApplicationEvent() metod
    of the bean when event is published. Therefore if you want bean to respondto application events you need
    to implement the onApplicationEvent() method
    LVL 92

    Assisted Solution

    > If you register bean as application event listener then the container will call onApplicationEvent() metod

    you don't register your bean

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Title # Comments Views Activity
    Understanding @ResponseBody annotation 5 36
    Automated mobile software testing 8 106
    VB Script 3 60
    post4 challenge 28 70
    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now