user1278890
user1278890

Reputation: 663

Accessing BundleContext with Felix dependency manager

I am using Apache Felix dependency manager in my project. In the service activation method

@org.apache.felix.dm.annotation.api.Start
public void activate() {
// Need BundleContext here
}

I need an access to BundleContext or Bundle. How can I achieve this?

Upvotes: 2

Views: 199

Answers (1)

Jeroen
Jeroen

Reputation: 413

You can make a volatile BundleContext field in your class and the dependency manager will inject it.

Upvotes: 1

Related Questions