Data connector defined in native Spring
Tom Zeller
tzeller at dragonacea.biz
Tue Mar 8 11:54:06 EST 2016
>> Do I need to use different file than
>> global.xml or this native spring definition works in some other way?
>
> As I think about it, yes you probably do. Put the definition inside a file
> which in turn is pointed to by the service declaration in services.xml.
Ah, good catch Rod. That works. I was curious, so I :
(1) copied conf/global.xml to conf/my-file.xml
(2) added the data connector bean and identifiable bean post processor to conf/my-file.xml :
<!-- This BeanPostProcessor auto-sets identifiable beans with the bean name (if not already set). -->
<bean id="shibboleth.IdentifiableBeanPostProcessor"
class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
<bean id="myDataConnector" class="my.MyDataConnector" />
(3) added conf/my-file.xml to conf/services.xml :
<util:list id ="shibboleth.AttributeResolverResources">
<value>%{idp.home}/conf/attribute-resolver.xml</value>
<value>%{idp.home}/conf/my-file.xml</value>
</util:list>
And, a note that “global.xml” is not really global, it’s peer to the other application contexts which are all children of the root web app context. We’d need to add something in AttributeResolverServiceStrategy.apply(appContext) to look at the parent context of the given app context. At least that’s what I see at the moment in system/conf/global-system.xml.
More information about the dev
mailing list