Opened 15 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)
Change History (8)
by , 15 years ago
Attachment: | singleton.patch added |
---|
comment:1 by , 15 years ago
Milestone: | v2.5.0 → v2.5.1 |
---|
comment:2 by , 14 years ago
Milestone: | v2.5.1 → v2.6.2 |
---|
comment:3 by , 14 years ago
Milestone: | v2.6.3 → Future release |
---|
by , 13 years ago
Attachment: | singleton-r7759.patch added |
---|
Add TransformerFactoryFactory singleton. Update needed for DBCP pool unique name.
comment:4 by , 13 years ago
Milestone: | Future release → v2.7.0 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Type: | defect → enhancement |
comment:5 by , 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:
- 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.
Patch for changes on managers