Results 1 to 2 of 2

Thread: when can the isSingleton() and isPrototype() methods both return false?

  1. #1
    Join Date
    Dec 2011
    Posts
    5

    Post when can the isSingleton() and isPrototype() methods both return false?

    Hi I got this question in exam can any one please answer it ?

    For a given Spring-managed bean, when can the isSingleton() and isPrototype() methods both return false?

    options are
    a>When only one request has been made for the bean
    b>When a FactoryBean is being used to manage the bean
    c>When a bean is configured for singleton, but an external reference is being held to the bean
    d>When the bean is configured for lazy-loading and has not yet been initialized
    e>When the bean's scope is "request"

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    Well the answer is quite simple actually...when the bean in question is scoped neither as prototype nor as singleton, so it is a request, session or global session bean (or a bean with a user-defined custom scope). So the right answer is E.

Posting Permissions

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