Announcement Announcement Module
Collapse
No announcement yet.
how to set property to cmt slsb Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to set property to cmt slsb

    Hi,

    I'm trying to set dao to my cmt slsb, using dependency injection,

    Does anyone have an idea to help me ?

    Thanks,

    Zuo

  • #2
    There's no out of the box support for this yet, although we're considering it for 1.2. (It's arguably a bit of an antipattern, as you are normally better to refactor your business logic wholly out of EJBs into POJOs behind them.)

    It shouldn't be hard to do. You can customize your onEjbCreate() method to get the BF, cast it to AutowireCapableBeanFactory, and "autowire" your EJB instance (this) by type.

    Look at DependencyInjectionAspectSupport in the sandbox if you need an example of this approach.

    Rgds
    Rod

    Comment


    • #3
      Hi Rod

      thanks for your answer.

      regards

      Zuo


      Originally posted by Rod Johnson
      There's no out of the box support for this yet, although we're considering it for 1.2. (It's arguably a bit of an antipattern, as you are normally better to refactor your business logic wholly out of EJBs into POJOs behind them.)

      It shouldn't be hard to do. You can customize your onEjbCreate() method to get the BF, cast it to AutowireCapableBeanFactory, and "autowire" your EJB instance (this) by type.

      Look at DependencyInjectionAspectSupport in the sandbox if you need an example of this approach.

      Rgds
      Rod

      Comment

      Working...
      X