[eclipselink-dev] Adding extension points to EclipseLink
Currently I'm working on two problems when running in WebSphere that I need to come up with a solution for.
1 - When an application uses javax.persistence.Persistence.createEntityManagerFactory(...), they need to specify a WebSphere target server to get transactions (among other things) to work. If they don't specify a target server, the EclipseLink runtime defaults to using the None target server and the app won't interact with our transaction manager. Yes I could require applications to configure eclipselink.target-server, but I would like to remove that requirement.
2 - Again when using javax.persistence.Persistence.createEntityManagerFactory(...) and direct JNDI names, WebSphere users will encounter bug 260383. Numerous places it is suggested to create a SessionCustomizer and then change the JNDIConnector lookup type. While that works, I would also like to remove that requirement.
Since the changes that I'm looking to make are specific to a single application server, I'd like to add an extension point to EclipseLink so I don't need to pollute the codebase with lots of ibm specific code.
I'd like like to solve this problem by adding something to EclipseLink that would use the service loader mechanism to load a service implementation that would be able to change some of the defaults of various EclipseLink internals. At this point this only changes the values of target-server and the JNDIConnector, but I could see it be useful in other areas. Attached below is a patch of some rough prototyping that I did a few days back.
Please take a quick browse through it to see if it seems like a reasonable approach.
Description: Binary data