Search in sources :

Example 1 with AlphavantageQuoteFeed

use of name.abuchen.portfolio.online.impl.AlphavantageQuoteFeed in project portfolio by buchen.

the class Preference2EnvAddon method setAlphavantageApiKey.

@Inject
@Optional
public void setAlphavantageApiKey(@Preference(value = UIConstants.Preferences.ALPHAVANTAGE_API_KEY) String alphavantageApiKey) {
    // this is a hack to pass the eclipse-based preference via environment
    // to the AlphavantageQuoteFeed implementation which is not created via
    // dependency injection but via Java Service Locator.
    AlphavantageQuoteFeed quoteFeed = (AlphavantageQuoteFeed) Factory.getQuoteFeedProvider(AlphavantageQuoteFeed.ID);
    quoteFeed.setApiKey(alphavantageApiKey);
}
Also used : AlphavantageQuoteFeed(name.abuchen.portfolio.online.impl.AlphavantageQuoteFeed) Inject(javax.inject.Inject) Optional(org.eclipse.e4.core.di.annotations.Optional)

Aggregations

Inject (javax.inject.Inject)1 AlphavantageQuoteFeed (name.abuchen.portfolio.online.impl.AlphavantageQuoteFeed)1 Optional (org.eclipse.e4.core.di.annotations.Optional)1