public class LocalhostMachineProvisioningLocation extends FixedListMachineProvisioningLocation<SshMachineLocation> implements AddressableLocation, LocationWithObjectStore
MachineProvisioningLocation
that can provision a SshMachineLocation
for the
local host.
By default you can only obtain a single SshMachineLocation for the localhost. Optionally, you can "overload"
and choose to allow localhost to be provisioned multiple times, which may be useful in some testing scenarios.Modifier and Type | Class and Description |
---|---|
static class |
LocalhostMachineProvisioningLocation.LocalhostMachine |
FixedListMachineProvisioningLocation.Builder
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
static ConfigKey<java.lang.Boolean> |
SKIP_ON_BOX_BASE_DIR_RESOLUTION |
PARENT_LOCATION, TEMPORARY_LOCATION
FINAL_SPEC, NAMED_SPEC_NAME, ORIGINAL_SPEC
Constructor and Description |
---|
LocalhostMachineProvisioningLocation()
Construct a new instance.
|
LocalhostMachineProvisioningLocation(java.util.Map properties)
Deprecated.
since 0.6
|
LocalhostMachineProvisioningLocation(java.lang.String name) |
LocalhostMachineProvisioningLocation(java.lang.String name,
int count) |
Modifier and Type | Method and Description |
---|---|
boolean |
canProvisionMore() |
static boolean |
checkPortAvailable(java.net.InetAddress localAddress,
int portNumber)
checks the actual availability of the port on localhost, ie by binding to it; cf
Networking.isPortAvailable(int) |
static void |
clearStaticData() |
LocalhostMachineProvisioningLocation |
configure(java.util.Map<?,?> flags)
Will set fields from flags, and put the remaining ones into the 'leftovers' map.
|
java.net.InetAddress |
getAddress()
Return the single most appropriate address for this location.
|
static java.net.InetAddress |
getLocalhostInetAddress() |
static boolean |
isSudoAllowed() |
PersistenceObjectStore |
newPersistenceObjectStore(java.lang.String container)
Creates a
PersistenceObjectStore pointed at the given container/directory. |
static int |
obtainPort(java.net.InetAddress localAddress,
PortRange range) |
static int |
obtainPort(PortRange range) |
static boolean |
obtainSpecificPort(java.net.InetAddress localAddress,
int portNumber) |
void |
release(SshMachineLocation machine)
Release a previously-obtained machine.
|
static void |
releasePort(java.net.InetAddress localAddress,
int portNumber) |
static LocationSpec<LocalhostMachineProvisioningLocation> |
spec() |
addChild, addMachine, close, getAllMachines, getAvailable, getInUse, getProvisioningFlags, init, newSubLocation, obtain, obtain, removeChild, removeMachine, toVerboseString
addExtension, config, containsLocation, equals, getAllConfig, getAllConfigBag, getChildren, getConfig, getConfig, getDisplayName, getExtension, getHostGeoInfo, getLocalConfigBag, getParent, getRawLocalConfigBag, getRebindSupport, hasConfig, hasExtension, hashCode, isManaged, onManagementStarted, onManagementStopped, setConfig, setDisplayName, setHostGeoInfo, setManagementContext, setName, setParent, setParent, toMetadataRecord, toString
getCatalogItemId, getId, getManagementContext, getTagSupport, rebind, setCatalogItemId, tags
containsLocation, getAllConfig, getChildren, getConfig, getConfig, getDisplayName, getExtension, getId, getParent, hasConfig, hasExtension, setParent, toVerboseString
getCatalogItemId, getTagSupport, tags
config, setConfig
getManagementContext
setCatalogItemId
public static final org.slf4j.Logger LOG
public static final ConfigKey<java.lang.Boolean> SKIP_ON_BOX_BASE_DIR_RESOLUTION
public LocalhostMachineProvisioningLocation()
public LocalhostMachineProvisioningLocation(java.util.Map properties)
properties
- the properties of the new instance.LocalhostMachineProvisioningLocation()
public LocalhostMachineProvisioningLocation(java.lang.String name)
public LocalhostMachineProvisioningLocation(java.lang.String name, int count)
public static void clearStaticData()
public static LocationSpec<LocalhostMachineProvisioningLocation> spec()
public LocalhostMachineProvisioningLocation configure(java.util.Map<?,?> flags)
AbstractBrooklynObject
ConfigBag.getUnusedConfig()
.
To be overridden by AbstractEntity, AbstractLoation, AbstractPolicy, AbstractEnricher, etc.
But should not be overridden by specific entity types. If you do, the entity may break in subsequent releases. Also note that if you require fields to be initialized you must do that in this method. You must *not* rely on field initializers because they may not run until *after* this method (this method is invoked by the constructor in this class, so initializers in subclasses will not have run when this overridden method is invoked.)
configure
in class FixedListMachineProvisioningLocation<SshMachineLocation>
public static java.net.InetAddress getLocalhostInetAddress()
public java.net.InetAddress getAddress()
AddressableLocation
getAddress
in interface AddressableLocation
public boolean canProvisionMore()
public static boolean obtainSpecificPort(java.net.InetAddress localAddress, int portNumber)
public static boolean checkPortAvailable(java.net.InetAddress localAddress, int portNumber)
Networking.isPortAvailable(int)
public static int obtainPort(PortRange range)
public static int obtainPort(java.net.InetAddress localAddress, PortRange range)
public static void releasePort(java.net.InetAddress localAddress, int portNumber)
public void release(SshMachineLocation machine)
MachineProvisioningLocation
release
in interface MachineProvisioningLocation<SshMachineLocation>
release
in interface ProvisioningLocation<SshMachineLocation>
release
in class FixedListMachineProvisioningLocation<SshMachineLocation>
machine
- a MachineLocation
previously obtained from a call to #obtain()
public static boolean isSudoAllowed()
public PersistenceObjectStore newPersistenceObjectStore(java.lang.String container)
LocationWithObjectStore
PersistenceObjectStore
pointed at the given container/directory.newPersistenceObjectStore
in interface LocationWithObjectStore