Issue Details (XML | Word | Printable)

Key: NUCCORE-634
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Minor Minor
Assignee: Unassigned
Reporter: Fernando Padilla
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

plugin extensions points are unordered, so we can't properly override core extensions with application specific ones

Created: 28/Jan/11 11:50 PM   Updated: 18/Feb/14 09:22 AM   Resolved: 19/May/11 07:28 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
I believe datanucleus needs to have a way for it to load extensions in a reproducible manner.

The ordering of the extensions list was not-deterministic. So sometimes our extensions would override properly, other times they would be ignored (since the core definition our override ours).

We had to create our own OrderedNonManagedPluginRegistry, that would process the ExtensionPoint.getExtensions, to properly reorder them into a deterministic order.

We order all extensions that come from "datanucleus" jars to the top of the list. Then alphabetically after that. I believe datanucleus needs to have a way for it to load extensions in a deterministic manner.

Fernando Padilla added a comment - 28/Jan/11 11:54 PM
public class OrderedNonManagedPluginRegistry extends NonManagedPluginRegistry {

private boolean registeredExtensions;

public OrderedNonManagedPluginRegistry( ClassLoaderResolver clr ) {
super( clr, null );
}

public OrderedNonManagedPluginRegistry( ClassLoaderResolver clr, String bundleCheckType ) {
super( clr, bundleCheckType );
}

public void registerExtensions() {
if ( registeredExtensions ) {
return;
}
super.registerExtensions();
orderExtensions();
registeredExtensions = true;
}

public void orderExtensions() {
....
}
}

Andy Jefferson added a comment - 29/Jan/11 12:47 PM
Irrespective of the proposal above, it would be nice to know *what* you want to "override", because maybe there's a reason why we don't provide a hook for it ;-)

Andy Jefferson added a comment - 28/Mar/11 04:10 PM
Without knowing the use-case can never be Major priority

Andy Jefferson made changes - 28/Mar/11 04:10 PM
Field Original Value New Value
Priority Major [ 3 ] Minor [ 4 ]
Andy Jefferson added a comment - 19/May/11 07:28 AM

Andy Jefferson made changes - 19/May/11 07:28 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Duplicate [ 3 ]
Andy Jefferson made changes - 14/Jun/11 12:16 PM
Status Resolved [ 5 ] Closed [ 6 ]
Andy Jefferson made changes - 18/Feb/14 09:22 AM
Component/s Plugins [ 10153 ]