Opened 14 years ago

Closed 13 years ago

#210 closed enhancement (fixed)

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 (2)

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

Download all attachments as: .zip

Change History (8)

by mcoudert, 14 years ago

Attachment: singleton.patch added

Patch for changes on managers

comment:1 by ticheler, 14 years ago

Milestone: v2.5.0v2.5.1

comment:2 by heikki, 13 years ago

Milestone: v2.5.1v2.6.2

comment:3 by fxp, 13 years ago

Milestone: v2.6.3Future release

by fxp, 13 years ago

Attachment: singleton-r7759.patch added

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

comment:4 by fxp, 13 years ago

Milestone: Future releasev2.7.0
Owner: changed from mcoudert to fxp
Status: newassigned
Type: defectenhancement

comment:5 by fxp, 13 years ago

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:

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

comment:6 by fxp, 13 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.