Results 1 to 3 of 3

Thread: how to set property to cmt slsb

  1. #1
    Join Date
    Nov 2004
    Posts
    3

    Default 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. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    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
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Nov 2004
    Posts
    3

    Default

    Hi Rod

    thanks for your answer.

    regards

    Zuo


    Quote 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

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  5. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •