Skip to content

Instantly share code, notes, and snippets.

@sebersole
Created July 7, 2011 16:42
Show Gist options
  • Save sebersole/1069934 to your computer and use it in GitHub Desktop.
Save sebersole/1069934 to your computer and use it in GitHub Desktop.
Why?
----
Historically, Hibernate relied on standard class-loading paradigms that targeted JSE and JEE deployment environments. However, with the growth of OSGi and other modular systems those same approaches no longer always work. So Hibernate needed a new approach that would allow it operate in all possible deployment environments.
How?
----
In Hibernate 4 we leverage the ServiceRegsitry to define a pluggable service for providing interaction with the class-loading of the semantics of the environment in which Hibernate will be run. Specifically, the idea is to allow external entities (the user, the environment developers, etc) to define and "plug in" a custom scheme for class path interactions. For example, an OSGi container could choose to provide Hibernate (either directly or as its JPA provider) and install a custom service for class loader interactions to override the default one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment