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

  • injection with ServiceActivator

    Hi,
    I'm new to Spring Integration.
    I'm just wondering if I could inject something to the pojo which has @ServiceActivator.

    If I understand correctoly, It looks like @ServiceActivator method is called by reflection, which means the pojo is not spring-managed.

    Let me know If I'm wrong.

    By the way, I just want to do like this

    Code:
    @MessageEndPoint
    public class SomeBean {
      
      @Autowired
      private SomeDao someDao;
    
      @ServiceActivator
      private void someMethod(SomeBean bean) {
       // do something
       someDao.insert(bean);
      }
    }
    Thanks in advance

    Shige

  • #2
    Yes, your example will work. I have a service activator that looks very similar to that.

    You just need to make sure that you have added both the generic spring annotation post processor as well as the SI annotation post processors to your spring config and the component scanner:

    Code:
      <context:component-scan base-package="com.yourpackage."/>
      <context:annotation-config/>
      <integration:annotation-config/>

    Comment


    • #3
      Hi, chudak

      Thanks, I'll try it

      Shige

      Comment

      Working...
      X