Results 1 to 2 of 2

Thread: varying life cycle of services

  1. #1
    Join Date
    Nov 2004
    Posts
    2

    Default varying life cycle of services

    As I understand,I can have varying lifecycle of services running with Spring. Like Service 1 needs to be running always, service 2 would be started on demand and shutdown after service.

    Correct me if I am wrong,
    cheers,
    -PandaSK

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    Service 1 should be a bean definition with singleton="true" (default anyway). The lifecycle of this object will be that of the BeanFactory that owns it.

    Service 2 should be a bean definition with singleton="false". Then every getBean() call will get a new instance, and the BeanFactory won't hold onto that instance.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Similar Threads

  1. ProcessingFilter life cycle
    By schrepfler in forum Security
    Replies: 2
    Last Post: Oct 10th, 2005, 05:38 PM
  2. Exposing Services in a JMS based application
    By rsheldon in forum Architecture
    Replies: 1
    Last Post: Sep 21st, 2005, 12:56 AM
  3. Replies: 1
    Last Post: Sep 21st, 2005, 12:56 AM
  4. Replies: 0
    Last Post: May 27th, 2005, 09:21 AM
  5. Controllers Life Cycle.
    By sherihan in forum Web
    Replies: 4
    Last Post: Mar 29th, 2005, 03:14 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
  •