Hi Justin,
working on the hibernate catalog, I need some help.
I need to replace the standard catalog beans in the Geoserver
applicationContext, with the ones that provide data access via Hibernate
(namely "rawCatalog" and "geoServer2").
I used as a guideline the hibernate module you developed some time ago as a
proof of concept. There I can see, in the module's appcontext, that such bean
names are redefined via the <alias> element; e.g.:
<bean id="configTarget"
class="org.geoserver.config.hibernate.HibGeoServerImpl">
...
</bean>
<alias name="configTarget" alias="geoServer2" />
Is this the Right Way to replace beans in GeoServer? 
Ciao,
Emanuele
Ciao Emanuele,
Trying to think back to when I did that :). But as far as I remember aliasing is just a convenience to give a bean multiple names. Basically the only way to "override" an existing bean definition is to have another bean with the same name defined in an app context which gets processed after the one with the bean being overrided.
So... whether the override is a bean itself, or an alias i am not sure it matters. So i think you could replace with:
<bean id="geoServer2"
class="org.geoserver.config.hibernate.HibGeoServerImpl">
...
</bean>
And I *think* it should have the same effect, not 100% sure.
The tricky part is ensuring the the app context with the overriding bean gets processed after the one with the bean being overridden. The "depends" keyword can be used to achieve this. Basically have a bean in the overriding context depend on one in the context being overridden. Does that make sense?
Hope that helps.
-Justin
Emanuele Tajariol wrote:
Hi Justin,
working on the hibernate catalog, I need some help.
I need to replace the standard catalog beans in the Geoserver applicationContext, with the ones that provide data access via Hibernate (namely "rawCatalog" and "geoServer2").
I used as a guideline the hibernate module you developed some time ago as a proof of concept. There I can see, in the module's appcontext, that such bean names are redefined via the <alias> element; e.g.:
<bean id="configTarget"
class="org.geoserver.config.hibernate.HibGeoServerImpl">
...
</bean>
<alias name="configTarget" alias="geoServer2" />
Is this the Right Way to replace beans in GeoServer? 
Ciao,
Emanuele
------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.