Search in sources :

Example 1 with CachingMarketplaceService

use of org.eclipse.epp.internal.mpc.core.service.CachingMarketplaceService in project epp.mpc by eclipse.

the class ServiceLocator method createMarketplaceService.

protected IMarketplaceService createMarketplaceService(String baseUrl) {
    IMarketplaceService service;
    URL base;
    try {
        base = URLUtil.toURL(baseUrl);
    } catch (MalformedURLException e) {
        throw new IllegalArgumentException(e);
    }
    DefaultMarketplaceService defaultService = new DefaultMarketplaceService(base);
    Map<String, String> requestMetaParameters = computeDefaultRequestMetaParameters();
    defaultService.setRequestMetaParameters(requestMetaParameters);
    IUserFavoritesService favoritesService = getFavoritesService(baseUrl);
    // FIXME this should be a service reference!
    defaultService.setUserFavoritesService(favoritesService);
    service = new CachingMarketplaceService(defaultService);
    return service;
}
Also used : MalformedURLException(java.net.MalformedURLException) CachingMarketplaceService(org.eclipse.epp.internal.mpc.core.service.CachingMarketplaceService) DefaultMarketplaceService(org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService) IUserFavoritesService(org.eclipse.epp.mpc.core.service.IUserFavoritesService) IMarketplaceService(org.eclipse.epp.mpc.core.service.IMarketplaceService) URL(java.net.URL)

Aggregations

MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 CachingMarketplaceService (org.eclipse.epp.internal.mpc.core.service.CachingMarketplaceService)1 DefaultMarketplaceService (org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService)1 IMarketplaceService (org.eclipse.epp.mpc.core.service.IMarketplaceService)1 IUserFavoritesService (org.eclipse.epp.mpc.core.service.IUserFavoritesService)1