Announcement Announcement Module
Collapse
No announcement yet.
Target Class Name in ProxiedBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Target Class Name in ProxiedBean

    Hi,

    I am configuring a bean with name InserimentoAnagraficaTarget and a Tx bean based on the previous, latter name is InserimentoAnagraficaTx.

    configuration works great and I can get istances of both.

    Command dbAw = (Command)factory.getBean(commandName);

    btw I'd need to know, when using the TxBean, which is the target class name (class name of InserimentoAnagraficaTarget)

    when I use getBean() in this way

    Command dbAw = (Command)factory.getBean(commandName);

    I have a Proxy (JdkDynamicProxy) from which I can retrieve target class name,
    any help?

    thks in advance
    Leonardo



    Code:
    	<bean id="InserimentoAnagraficaTarget" 
    		class="com.cedac.webcontoc.command.spring.InserimentoAnagraficaCommand" 
    		singleton="true" >
    	
    		<property name="businessObject" ref="anagraficaBO"/>							<!-- definisco il legame con il bean databaseManager -->	
    		<property name="dbManager">
    			<ref bean="springDatabaseManager"/>
    		</property>			
    	</bean>	
    		
    	<bean id="InserimentoAnagraficaTx" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager" ref="springTransactionTemplate"/>
    		<property name="target" ref="InserimentoAnagraficaTarget"/>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="executeCommand*">PROPAGATION_REQUIRED,+ConfigurationException,+DatabaseManagerException</prop>
    			</props>
    		</property>		
    	</bean>

  • #2
    Something like ((TransactionProxyFactoryBean)getBean("&Inseriment oAnagraficaTx")).getTarget().getClass()?

    Comment


    • #3
      sure! that is what I'd like to be working.

      but if I use

      TransactionProxyFactoryBean beanItself = ((TransactionProxyFactoryBean)factory.getBean("&In serimentoAnagraficaTx"));

      I can see (using debug) that beanItself contains an attribute name target .

      but I can't see
      beanItself.getTarget()

      i am surely missing something

      thks
      Leonardo

      Comment


      • #4
        Sorry, I didn't notice there is no getTarget(). You could make a case in JIRA to add the method.

        Comment

        Working...
        X