use of org.eclipse.epp.mpc.core.service.ITransportFactory in project epp.mpc by eclipse.
the class MappedTransportFactory method register.
public void register() throws IllegalStateException {
ITransportFactory transportFactory = ServiceHelper.getTransportFactory();
if (transportFactory != this) {
unregister();
ITransportFactory delegate = transportFactory;
if (delegate instanceof MappedTransportFactory) {
delegate = ((MappedTransportFactory) delegate).getDelegate();
}
this.delegate = delegate;
Dictionary<String, Object> maxServiceRanking = new Hashtable<String, Object>(Collections.singletonMap(Constants.SERVICE_RANKING, Integer.MAX_VALUE));
registration = MarketplaceClientCorePlugin.getBundle().getBundleContext().registerService(ITransportFactory.class, this, maxServiceRanking);
transportFactory = ServiceHelper.getTransportFactory();
if (transportFactory != this) {
throw new IllegalStateException("Factory not selected after registration");
}
}
}
Aggregations