Gabriel Roldan ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A54db8b09-1e64-436a-adac-248049585cee
 ) *created* an issue

GeoServer ( 
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiOThjMmE5MmNmYmRkNDUxZjkxZDYyODI0YjVmMWVhZDgiLCJwIjoiaiJ9
 ) / Task ( 
https://osgeo-org.atlassian.net/browse/GEOS-10364?atlOrigin=eyJpIjoiOThjMmE5MmNmYmRkNDUxZjkxZDYyODI0YjVmMWVhZDgiLCJwIjoiaiJ9
 ) GEOS-10364 ( 
https://osgeo-org.atlassian.net/browse/GEOS-10364?atlOrigin=eyJpIjoiOThjMmE5MmNmYmRkNDUxZjkxZDYyODI0YjVmMWVhZDgiLCJwIjoiaiJ9
 ) Duplicate bean definitions in gwc spring context config files ( 
https://osgeo-org.atlassian.net/browse/GEOS-10364?atlOrigin=eyJpIjoiOThjMmE5MmNmYmRkNDUxZjkxZDYyODI0YjVmMWVhZDgiLCJwIjoiaiJ9
 )

Issue Type: Task Assignee: Gabriel Roldan ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A54db8b09-1e64-436a-adac-248049585cee
 ) Created: 24/Jan/22 2:10 AM Priority: Medium Reporter: Gabriel Roldan ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A54db8b09-1e64-436a-adac-248049585cee
 )

There are 5 duplicate bean definitions in gs-gwc:

grep "<bean " -Rh|grep id|sed 's/ //g'|sed 's/\t//g'|cut -d'"' -f2|sort|uniq 
-c|grep -v "1 "
     2 gwcFacade
     2 gwcGeoServervConfigPersister
     2 gwcInitializer
     2 gwcTransactionListener
     2 gwcWMSExtendedCapabilitiesProvider

Also, the following beans are duplicates, they do exactly the same, 
unnecessarily multiplying the number of AOP method interceptors:

 <bean id="gwcServiceWMSInterceptorEnabledCheck" 
class="org.geoserver.gwc.config.GWCServiceEnablementInterceptor">
 <bean id="gwcServiceTMSInterceptorEnabledCheck" 
class="org.geoserver.gwc.config.GWCServiceEnablementInterceptor">
 <bean id="gwcWMTSServiceInterceptorEnabledCheck" 
class="org.geoserver.gwc.config.GWCServiceEnablementInterceptor">
 <bean id="gwcServiceVEInterceptorEnabledCheck" 
class="org.geoserver.gwc.config.GWCServiceEnablementInterceptor">
 <bean id="gwcServiceKMLInterceptorEnabledCheck" 
class="org.geoserver.gwc.config.GWCServiceEnablementInterceptor">
 <bean id="gwcServiceGMapsterceptorEnabledCheck" 
class="org.geoserver.gwc.config.GWCServiceEnablementInterceptor">
 <bean id="gwcServiceMGMapsterceptorEnabledCheck" 
class="org.geoserver.gwc.config.GWCServiceEnablementInterceptor">

Ratioale being GWCServiceEnablementInterceptor checks delegates to 
gwcFacade.isServiceEnabled(service) , as shown bellow, and it’s not 
parameterized, so all those beans are the same:

       final org.geowebcache.service.Service service = (Service) 
invocation.getThis();
       boolean serviceEnabled;
       if (service.getPathName().equals("wmts")) {
           serviceEnabled = geoServer.getService(WMTSInfo.class).isEnabled();
       } else {
           serviceEnabled = gwcFacade.isServiceEnabled(service);
       }

Proposal is:

* Remove duplicate bean definitions

* Replace all GWCServiceEnablementInterceptor beans by a single one
* Refactor bean locations, several beans are defined in applicationContext.xml 
, which in turn imports geowebcache-servlet.xml and 
geowebcache-geoserver-context.xml , while geowebcache-servlet.xml imports all 
the regular GWC context files. Since there are 106 unique bean definitions in 
total, it’s hard to reason what goes where, so I’d like to have 
applicationContext.xml be just like:
 <import resource="geowebcache-servlet.xml" />
 <import resource="geowebcache-geoserver-context.xml" />
 <import resource="geowebcache-geoserver-wms-integration.xml" />
 <import resource="geowebcache-geoserver-wmts-integration.xml" />

instead of mixing up geoserver specific beans across applicationContext.xml and 
geowebcache-geoserver-context.xml

( 
https://osgeo-org.atlassian.net/browse/GEOS-10364#add-comment?atlOrigin=eyJpIjoiOThjMmE5MmNmYmRkNDUxZjkxZDYyODI0YjVmMWVhZDgiLCJwIjoiaiJ9
 ) Add Comment ( 
https://osgeo-org.atlassian.net/browse/GEOS-10364#add-comment?atlOrigin=eyJpIjoiOThjMmE5MmNmYmRkNDUxZjkxZDYyODI0YjVmMWVhZDgiLCJwIjoiaiJ9
 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( 
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
 ) or iOS ( 
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100189- 
sha1:399499b )
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to