@Singleton public class MastersLoadingCache extends com.google.common.cache.AbstractLoadingCache<Image,Master>
LoadingCache
for masters. If the requested master has been
previously created this returns it, if not it coordinates its creation
including downloading isos and creating cache/config directories. This also
implements Supplier
in order to provide jetty with the current image
(only one master can be created at a time).Modifier and Type | Field and Description |
---|---|
protected Logger |
logger |
static int |
MASTER_PORT |
Constructor and Description |
---|
MastersLoadingCache(String version,
String installationKeySequence,
String preconfigurationUrl,
String workingDir,
com.google.common.base.Function<MasterSpec,org.virtualbox_4_1.IMachine> masterLoader,
com.google.common.base.Supplier<Map<Image,YamlImage>> yamlMapper,
com.google.common.base.Supplier<org.virtualbox_4_1.VirtualBoxManager> manager,
RunScriptOnNode.Factory runScriptOnNodeFactory,
RetryIfSocketNotYetOpen socketTester,
com.google.common.base.Supplier<NodeMetadata> host,
com.google.common.base.Supplier<URI> providerSupplier,
HardcodedHostToHostNodeMetadata hardcodedHostToHostNodeMetadata) |
Modifier and Type | Method and Description |
---|---|
void |
createCacheDirStructure() |
Master |
get(Image key) |
Master |
getIfPresent(Object key) |
apply, getAll, getUnchecked, refresh
asMap, cleanUp, get, getAllPresent, invalidate, invalidateAll, invalidateAll, put, putAll, size, stats
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int MASTER_PORT
@Named(value="jclouds.compute") protected Logger logger
@Inject public MastersLoadingCache(String version, @Named(value="jclouds.virtualbox.installationkeysequence") String installationKeySequence, @Named(value="jclouds.virtualbox.preconfigurationurl") String preconfigurationUrl, @Named(value="jclouds.virtualbox.workingdir") String workingDir, com.google.common.base.Function<MasterSpec,org.virtualbox_4_1.IMachine> masterLoader, com.google.common.base.Supplier<Map<Image,YamlImage>> yamlMapper, com.google.common.base.Supplier<org.virtualbox_4_1.VirtualBoxManager> manager, RunScriptOnNode.Factory runScriptOnNodeFactory, RetryIfSocketNotYetOpen socketTester, com.google.common.base.Supplier<NodeMetadata> host, com.google.common.base.Supplier<URI> providerSupplier, HardcodedHostToHostNodeMetadata hardcodedHostToHostNodeMetadata)
@PostConstruct public void createCacheDirStructure()
public Master get(Image key) throws ExecutionException
ExecutionException
Copyright © 2009-2013 jclouds. All Rights Reserved.