Skip to main content
Level 4
Nov 6, 2015 8:04 AM UTC
Solved

service activation

Hi,

i have a service designed to share its annotation properties. I have 2 global arraylist initialized into the activation of the service (@Activate).

Is there a way to launch the activation method of my service when the bundle starting?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Nov 8, 2015 5:11 PM UTC

When you have @component annotation and override activate() method it should automatically initialize when bundle become 'Active' status. 

To make it immediately active when the bundle is deployed, use 

@Component(immediate=true)

2 replies

smacdonald2008
Level 10
Nov 6, 2015 10:00 AM UTC

The method that has the Activate annotation is automatically invoked when you activate your OSGI bundle. Your Array list objects will be initialized.

Translate
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Nov 8, 2015 5:11 PM UTC

When you have @component annotation and override activate() method it should automatically initialize when bundle become 'Active' status. 

To make it immediately active when the bundle is deployed, use 

@Component(immediate=true)

Translate