The attribute policyOption is undefined for the annotation type Reference | Community
Skip to main content
Level 3
Aug 21, 2018 3:11 PM UTC
Solved

The attribute policyOption is undefined for the annotation type Reference

Hi

can anyone help on this below issue,

We are replacing felix annotations with OSGI DS annotations. We have come across with a challenge please find below

Felix annotation :

  @Reference(policyOption = ReferencePolicyOption.GREEDY)

  protected UserConnector userConnector;

 

OSGI Annotation I tried :

  protected UserConnector userConnector;

 

  @Reference(policyOption = ReferencePolicyOption.GREEDY)

  public void bindUserConnector(UserConnector userConnector) {

    this.userConnector = userConnector;

  }

  public void unbindUserConnector(UserConnector userConnector) {

    this.userConnector = userConnector;

  }

 

But there is an error in eclipse where “The attribute policyOption is undefined for the annotation type Reference”.

Can you please tell me whether policyOption is deprecated in OSGi annotations.

Please let me know how to use policyOption = ReferencePolicyOption.Greedy in @Reference OSGI annotation.

Much Appreciated in advance.

Arun Patidar​

Feike Visser​

smacdonald2008​

Thanks

Vijay

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 21, 2018 3:31 PM UTC

12 replies

arunpatidar
arunpatidarAccepted solution
New Participant
Aug 21, 2018 3:31 PM UTC
smacdonald2008
Level 10
Aug 21, 2018 3:29 PM UTC

The syntax is not a 1-1 match between felix and DS annotations.

Here is the reference for a DS annotation that will help...

https://osgi.org/javadoc/r4v43/cmpn/org/osgi/service/component/annotations/Reference.html

You can see the applicable values for policyOption.

Hope this helps... 

Translate