Issue Details (XML | Word | Printable)

Key: NUCCORE-707
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Daniel Baldes
Votes: 0
Watchers: 0
Operations

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

Globally support a priority attribute for extensions

Created: 03/May/11 11:36 AM   Updated: 18/Feb/14 09:22 AM   Resolved: 09/May/11 09:57 AM
Component/s: None
Affects Version/s: 2.2.3
Fix Version/s: 3.0.0.m4

File Attachments: 1. Text File priority.patch (9 kB)


Forum Thread URL: http://www.datanucleus.org/servlet/forum/viewthread_thread,6683


 Description  « Hide
As discussed in the DN forum (see forum thread URL).

The plugin manager should support to set the priority of an extension over "default" extensions.

For example, the RDBMS datastore just grabs the first ConnectionFactory extension it encounters, which happens to be the one provided by datanucleus-rdbms itself (ConnectionFactoryImpl), regardless of whether there is another connection factory extension present.

Sort Order: Ascending order - Click to sort in descending order
Daniel Baldes added a comment - 03/May/11 11:39 AM
The attached patch for the datanucleus-core 2.2 branch implements support for a "priority" attribute for any extension.

New behavior:

PluginManager.getConfigurationElement(s)ForExtension methods return extensions with a higher value of the "priority" attribute first. Extensions with no priority attribute are considered having priority = 0. If no priority is defined, extensions are returned in the order they are encountered (old behavior).

Andy Jefferson added a comment - 03/May/11 03:18 PM - edited
Thx. I'll be applying it on 3.0 (trunk) only. To swap to your "priority" usage I'll also need to change (remove) all current usage of attribute "override", and the DatastoreAdapter "priority" handling. Additionally, all src/schema files will need attribute "priority" adding otherwise Eclipse shows "Illegal attribute 'priority'"

Andy Jefferson added a comment - 09/May/11 09:57 AM
Patch applied in 3.0m4. Didn't have time to do the cleanup of existing override methods, so raised those as
http://www.datanucleus.org/servlet/jira/browse/NUCSPATIAL-22
http://www.datanucleus.org/servlet/jira/browse/NUCCORE-711