Announcement Announcement Module
Collapse
No announcement yet.
JobExecutionListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JobExecutionListener

    why cant the listener be usual bean in application context .
    something like

    <listener ref="someBean"...

  • #2
    It can. It's just called <job-listener/>. There's also a <step-listener/>.

    Comment


    • #3
      How do i configure it in context defination

      Comment


      • #4
        I configured it this way but not sure this is the only way

        Code:
        <beans:bean id="listener" class="com.abc.batch.listener.MyJobListener">
        	<beans:property name="mailClient"  ref="mailClient" />
        </beans:bean>
        
        <job-listener id="jobListener" ref="listener" />
        
        <listeners>
        	<listener ref="jobListener"/>
        </listeners>

        Comment


        • #5
          I don't understand what you're trying to do with it...

          Comment


          • #6
            Am trying to create a listner bean for the job
            instead of using <listener class=... I am trying to use same bean

            Comment


            • #7
              You can do this:
              Code:
              <job>
                  ...
                  <listeners>
                      <listener ref="myJobListener"/>
                      ...
                  </listeners>
              </job>
              
              <beans:bean id="myJobListener" class="com.abc.batch.listener.MyJobListener">
                  <beans:property name="mailClient"  ref="mailClient" />
              </beans:bean>
              Is that what you want?
              Last edited by DHGarrette; Jun 6th, 2009, 10:00 AM. Reason: fixed mistake

              Comment


              • #8
                yes, Thanks but how do i register several listeners for a job then

                Comment


                • #9
                  sorry, i updated it to fix the mistake i had. You can reference multiple listeners, all of which can be defined externally.

                  Comment

                  Working...
                  X