use of org.platformlayer.xaas.services.ServiceProviderDictionary in project platformlayer by platformlayer.
the class ServiceProviderHelpers method getModelClass.
public ModelClass<?> getModelClass(PlatformLayerKey platformLayerKey) {
OpsContext ops = OpsContext.get();
ServiceProviderDictionary serviceProviderDictionary = ops.getInjector().getInstance(ServiceProviderDictionary.class);
ServiceType serviceType = platformLayerKey.getServiceType();
ItemType itemType = platformLayerKey.getItemType();
ServiceProvider serviceProvider = serviceProviderDictionary.getServiceProvider(serviceType);
if (serviceProvider == null) {
throw new IllegalArgumentException();
}
ModelClass<?> modelClass = serviceProvider.getModelClass(itemType);
if (modelClass == null) {
throw new IllegalArgumentException();
}
return modelClass;
}
Aggregations