Announcement Announcement Module
Collapse
No announcement yet.
Legacy Singleton with argument to getInstance Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Legacy Singleton with argument to getInstance

    Hi All,

    I have a legacy Singleton class that takes an argument in the getInstance method.

    Code:
    xxxxDAO.getInstance(Logger logger);
    is there a way using factory-method to get the Logger parameter into the getInstance method, does anyone know?

    Thanks in advance

  • #2
    you can pass Logger parameter as constructor arg as shown below:

    Code:
    <bean id="xDAO" class="MyDAO" factory-method="getInstance"> 
     <constructor-arg type="Logger" ref="logger"/>  
    </bean>

    Comment

    Working...
    X