About issue298

4 views
Skip to first unread message

jokoul webster

unread,
Mar 27, 2010, 4:36:07 AM3/27/10
to impala...@googlegroups.com
Hi Phil:
     I have noted that you had marked issue298 as "invalid" status,that means you do not wanna fix that problem at present,in that case if I use CXF I will have to change the value of "graph.bean.visibility.type" from "graphOrdered" to "parentOnly",I can not use "depends-on" funcation.
 
JK.Webster

Phil Zoio

unread,
Mar 27, 2010, 5:41:25 AM3/27/10
to impala...@googlegroups.com
Yokoul

No you can still use the 'depends-on' property.

The limitation is that you simply refer to beans in dependent
application contexts (ie in modules referred to using the 'depends-on'
property) as if they were in the parent application context, by using
the <service:parent> element, or by referring to the bean directly in
the application context. (This is a facility which is available if
'graph.bean.visibility.type' is 'graphOrdered').

In practical terms, this means that if there are beans in the dependent
application context that you want to use, then you will need to export
them from the dependent module to the service registry, and then import
them into the module you wish to use them in.

I hope this is not too much of a limitation. Of course, you can still
use a graph-based module structure, though.

The reason I did not want to change GraphDelegatingApplicationContext to
implement ConfigurableApplicationContext is that most of the methods
would end up with implementations that would not make a huge amount of
sense.

Phil

jokoul webster

unread,
Mar 27, 2010, 8:36:54 AM3/27/10
to impala...@googlegroups.com
I have used <service:import> element,but it doesn't work and the exception is :

org.impalaframework.exception.NoServiceException: No service available for bean sqlMapClient

==============================================================
for example,ModuleA depends on ModuleB,
ModuelA's spring file:
=========================
<service:auto-export/>      
<service:import id="sqlMapClient" exportName = "sqlMapClient" proxyTypes = "com.ibatis.sqlmap.client.SqlMapClient"/> 
<bean   id="mixedDAO"     class="com.longtop.cow.dao.mixed.impl.MixedDAOImpl"   init-method="initialize" > 
      ........
     <property name="sqlMapClient">
         <ref bean="sqlMapClient"/>
     </property>
      .........
  </bean>
=========================
ModuleB's spring file
 <service:auto-export/>
<bean id="sqlMapClient"  class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
     .......
 </bean>
 
 
JK.Webster
 

Phil Zoio

unread,
Mar 27, 2010, 2:20:24 PM3/27/10
to impala...@googlegroups.com
Jokoul,

The auto-export only works if the parent bean context has a corresponding import definition for a bean of the same name.

Your example should work if you add

<service:export beanName="sqlMapClient"/>

to ModuleB

Cheers,
Phil
Reply all
Reply to author
Forward
0 new messages