> +    private ComputeServiceAdapter<VirtualMachine, 
> RoleSizeListResponse.RoleSize, OSImage, LocationsListResponse.Location> 
> adapter;
> +    private Function<LocationsListResponse.Location, Location> transformer;
> +
> +    @Inject
> +    public LocationSupplier(ComputeServiceAdapter<VirtualMachine, 
> RoleSizeListResponse.RoleSize, OSImage,
> +            LocationsListResponse.Location> adapter, 
> Function<LocationsListResponse.Location, Location> transformer) {
> +        this.adapter = adapter;
> +        this.transformer = transformer;
> +    }
> +
> +    @Override
> +    public Set<? extends Location> get() {
> +        return 
> FluentIterable.from(adapter.listLocations()).filter(notNull()).transform(transformer).toSet();
> +//            return transformGuardingNull(adapter.listLocations(), 
> transformer);
> +    }
> +}

There is no need to provide a custom location supplier, as the adapter already 
has a method that lists them. Just add this binding to the 
`AzoreComputeServiceContextModule` configure method:
```java
install(new LocationsFromComputeServiceAdapterModule<VirtualMachine, 
RoleSizeListResponse.RoleSize, OSImage, LocationsListResponse.Location>() {
});
```
And then you can remove this class. jclouds will extract the locations by 
calling the compute service implementation and the corresponding transformation 
function.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/132/files#r24749478

Reply via email to