Ticket #210 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

Change managers (ie ThesaurusManager, SchemaManager...) to become singletons classes

Reported by: mcoudert Owned by: fxp
Priority: minor Milestone: v2.7.0
Component: General Version: v2.4.3
Keywords: Cc:

Description

Using GeoNetwork in a multiple instance context, I would like to suggest some changes on managers in order they become singletons classes. These changes allow multiple instances of Geonetwork to pool some resources such as loading schema, thesaurus management... Enclosed patch provides more information about minors changes that need to be applied to trunk to allow some manager classes to work as singleton class, with a synchronized method getInstance(). Moreover, these changes allow us to create a dedicated SchemaManager? responsible of schema loading removing some piece of code from the EditLib? class. Thanks to Jean-Pascal Boignard for this contribution.

Attachments

singleton.patch Download (11.7 KB) - added by mcoudert 3 years ago.
Patch for changes on managers
singleton-r7759.patch Download (5.9 KB) - added by fxp 2 years ago.
Add TransformerFactoryFactory? singleton. Update needed for DBCP pool unique name.

Change History

Changed 3 years ago by mcoudert

Patch for changes on managers

Changed 3 years ago by ticheler

  • milestone changed from v2.5.0 to v2.5.1

Changed 3 years ago by heikki

  • milestone changed from v2.5.1 to v2.6.2

Changed 2 years ago by fxp

  • milestone changed from v2.6.3 to Future release

Changed 2 years ago by fxp

Add TransformerFactoryFactory? singleton. Update needed for DBCP pool unique name.

Changed 2 years ago by fxp

  • owner changed from mcoudert to fxp
  • status changed from new to assigned
  • type changed from defect to enhancement
  • milestone changed from Future release to v2.7.0

Changed 2 years ago by fxp

For information, Singleton are not shared between webapps: "the scope of a static variable is actually the class loader and not the JVM. Webservers use isolated class loaders for each web application that it hosts. Therefore, the singletons are per web application even if all of them are running on the same JVM instance. This isolation is essential to avoid any conflicts in the static space especially considering the fact that the same libraries/frameworks could be used in two different applications." See: *  http://www.theserverside.com/discussions/thread.tss?thread_id=51263 *  http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

So there is no risk to have two geonetwork nodes on the same container sharing Singleton instances.

Changed 2 years ago by fxp

  • status changed from assigned to closed
  • resolution set to fixed

r7762

Note: See TracTickets for help on using tickets.