Results 1 to 2 of 2

Thread: Create bean object

  1. #1
    Join Date
    Apr 2009
    Posts
    18

    Default Create bean object

    Please help me

    1. Is Service endpoint thread safe? I know it is by default singleton we can use scope prototype. but it is not creating multiple instances for every request.

    <bean id="checkEndPoint" class="com.svcs.CheckServiceEndpoint" scope="prototype">
    <constructor-arg index="0"><ref bean="getDao"/></constructor-arg>
    <property name="marshaller" ref="marshaller"/>
    <property name="unmarshaller" ref="marshaller"/>
    </bean>

    <bean id="getDao" class="com.service.dao.MyDaoImpl" scope="prototype" destroy-method="releaseConnection">

    </bean>

    it always create only one instance. what do I have suppose to do to invoke and create instance every request


    public class CheckServiceEndpoint extends AbstractFaultCreatingValidatingMarshallingPayloadE ndpoint{


    private com.service.dao.MyDAO daoObject;
    /**
    *
    */
    public FormIdDeterminationServiceEndpoint(com.service.dao .MyDAO daoObject) {
    this.daoObject = daoObject;
    System.out.println("End Point Created");
    }

    /**
    *
    */
    protected Object invokeInternal(Object request) throws Exception {
    this.daoObject.getConnect();
    }



    Problem with this is daoObject is always have instance when it was created. I want to create everytime request is made.
    How do I create instance of dao inside the invokeInternal object. this should solve my issue and safe

  2. #2
    Join Date
    Apr 2009
    Posts
    14

    Default

    I am new to Spring but i think the following link may solve you problem.

    http://static.springframework.org/sp...ot-interaction

    Cheers,
    Muein Muzamil

Posting Permissions

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