added missing location spec

This commit is contained in:
Adrian Cole 2010-10-17 19:41:32 -07:00
parent 176f528572
commit ae3a9e4f64
1 changed files with 11 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import org.jclouds.compute.strategy.DestroyNodeStrategy;
import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
import org.jclouds.compute.strategy.ListNodesStrategy;
import org.jclouds.compute.strategy.RebootNodeStrategy;
import org.jclouds.domain.Location;
import com.google.common.base.Supplier;
import com.google.common.collect.Sets;
@ -64,6 +65,7 @@ public abstract class StandaloneComputeServiceContextModule extends BaseComputeS
private Class<? extends RebootNodeStrategy> rebootNodeStrategy;
private Class<? extends Supplier<Set<? extends Hardware>>> hardwareSupplier;
private Class<? extends Supplier<Set<? extends Image>>> imageSupplier;
private Class<? extends Supplier<Set<? extends Location>>> locationSupplier = LocationSupplier.class;
public Builder install(Module module) {
this.modules.add(module);
@ -105,6 +107,11 @@ public abstract class StandaloneComputeServiceContextModule extends BaseComputeS
return this;
}
public Builder defineLocationSupplier(Class<? extends Supplier<Set<? extends Location>>> locationSupplier) {
this.locationSupplier = locationSupplier;
return this;
}
public StandaloneComputeServiceContextModule build() {
return new StandaloneComputeServiceContextModule() {
@ -143,6 +150,10 @@ public abstract class StandaloneComputeServiceContextModule extends BaseComputeS
return rebootNodeStrategy;
}
protected Class<? extends Supplier<Set<? extends Location>>> defineLocationSupplier() {
return locationSupplier;
}
@Override
protected void configure() {
for (Module module : modules)