@Override public AbstractLocation configure(Map<?,?> properties) { if (lock == null) { lock = new Object(); provisioners = Lists.<MachineProvisioningLocation<T>>newArrayList(); inUse = Maps.<T, MachineProvisioningLocation<T>>newLinkedHashMap(); } return super.configure(properties); }
@Override public AbstractLocation configure(Map<?,?> properties) { if (machines == null) machines = Sets.newLinkedHashSet(); if (inUse == null) inUse = Sets.newLinkedHashSet(); if (pendingRemoval == null) pendingRemoval = Sets.newLinkedHashSet(); if (origConfigs == null) origConfigs = Maps.newLinkedHashMap(); return super.configure(properties); }
@Override public SshMachineLocation configure(Map<?,?> properties) { super.configure(properties); // TODO Note that check for addresss!=null is done automatically in super-constructor, in FlagUtils.checkRequiredFields // Yikes, dangerous code for accessing fields of sub-class in super-class' constructor! But getting away with it so far! boolean deferConstructionChecks = (properties.containsKey("deferConstructionChecks") && TypeCoercions.coerce(properties.get("deferConstructionChecks"), Boolean.class)); if (!deferConstructionChecks) { if (getDisplayName() == null) { setDisplayName((groovyTruth(user) ? user+"@" : "") + address.getHostName()); } } return this; }
AbstractLocation checkWeGetThis = configure(properties); assert this.equals(checkWeGetThis) : this+" configure method does not return itself; returns "+checkWeGetThis+" instead of "+this;
location.configure(ConfigBag.newInstance().putAll(spec.getFlags()).putAll(spec.getConfig()).getAllConfig());