Bug 285370 - content types should not activate their bundle
Summary: content types should not activate their bundle
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 2.3 M3   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-02 01:42 EDT by David Williams CLA
Modified: 2010-02-02 17:36 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.