Bug 285370

Summary: content types should not activate their bundle
Product: [WebTools] Dali JPA Tools Reporter: David Williams <david_williams>
Component: GeneralAssignee: Paul Fullbright <paul.fullbright>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: karenfbutzke, neil.hauge, paul.fullbright
Version: 2.1   
Target Milestone: 2.3 M3   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description David Williams CLA 2009-08-02 01:42:45 EDT
Now that I've looked at your content types :) 
I don't see anything that would prevent the bundle from being activated when the content describer was used. Thereby increasing startup time, and, presumably, using at least a little memory and process time. In particular, that start method in JPACore looks hefty with the JPAModelManager start() (thought I really have no idea). 

But, point is, content type describers _have_ to be instantiated to be put to work, yet for some contexts and users they may never be interested in JPA at all, so to activate the bundle, based on content type, is a "violation" of how to do content type describers. This is somewhat documented in 
http://dev.eclipse.org/viewcvs/index.cgi/platform-core-home/documents/content_types.html?view=co

Lucky for you, there's an easy way, as long as your describer is "self contained" (in one package) because you can exclude packages from causing bundle activation by listing them as 'exclude' on the bundle-activationPolicy directive. Here's the one for one in XML Core (would in your manifest as one long line, or properly formatted for manifest files): 

Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.xml.core.internal.contenttype"
Comment 1 Paul Fullbright CLA 2009-08-03 10:16:25 EDT
That is a good catch.

Another thing we could do is contribute our content describers to core (or XML core).  They're generic and only add a) version testing in one case and b) an "abstract" indeterminate content describer in the second.
Comment 2 Paul Fullbright CLA 2009-10-02 16:07:42 EDT
We've collapsed our resource models to use only one content type which includes all versions, so we've removed our content describer.