[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Re: Equinox Application Model

"Steven E. Harris" <seh@xxxxxxxxx> writes:

> If my application class can't take any constructor arguments, how is
> it going to get ahold of a BundleContext?

I see that the demo application "app.selector" uses an BundleActivator
with a public static field to make the BundleContext available to
other classes in its package.¹

That seems like a hack. Why not expose the BundleContext through the
IApplicationContext, or, better yet, use reflection to sniff for a
single-argument constructor taking a BundleContext, and call that if
it's available?


Footnotes: 
¹ http://dev.eclipse.org/viewcvs/index.cgi/equinox-incubator/demos/app-model/org.eclipse.equinox.examples.app.selector/src/org/eclipse/equinox/examples/app/selector/Activator.java?view=markup

-- 
Steven E. Harris