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.BuilderAbstractLocation.BasicSubscriptionSupportBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupportBrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal| Modifier and Type | Field and Description |
|---|---|
static ConfigKey<java.lang.Boolean> |
SKIP_ON_BOX_BASE_DIR_RESOLUTION |
INITIAL_MACHINES_FACTORY, MACHINE_CHOOSER, MACHINE_LOCATION_CUSTOMIZERS, MACHINE_SPECSPARENT_LOCATION, TEMPORARY_LOCATIONFINAL_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 boolean |
checkPortAvailable(java.net.InetAddress localAddress,
int portNumber,
java.lang.Boolean reuseAddr) |
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(java.net.InetAddress localAddress,
PortRange range,
java.lang.Boolean reuseAddr) |
static int |
obtainPort(PortRange range) |
static int |
obtainPort(PortRange range,
java.lang.Boolean reuseAddr) |
static boolean |
obtainSpecificPort(java.net.InetAddress localAddress,
int portNumber) |
static boolean |
obtainSpecificPort(java.net.InetAddress localAddress,
int portNumber,
java.lang.Boolean reuseAddr) |
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, toVerboseStringaddExtension, config, containsLocation, equals, getChildren, getConfig, getConfig, getDisplayName, getExtension, getHostGeoInfo, getLocationTypeInternal, getParent, getRebindSupport, hasExtension, hashCode, isManaged, onManagementStarted, onManagementStopped, rebind, relations, setDisplayName, setHostGeoInfo, setManagementContext, setParent, setParent, subscriptions, toMetadataRecord, toStringaddSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, getManagementContext, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId, tagscontainsLocation, getChildren, getConfig, getDisplayName, getExtension, getId, getParent, hasExtension, relations, setParent, toVerboseStringgetCatalogItemId, getCatalogItemIdSearchPath, subscriptions, tagsconfig, getConfiggetManagementContextaddSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemIdpublic static final ConfigKey<java.lang.Boolean> SKIP_ON_BOX_BASE_DIR_RESOLUTION
public LocalhostMachineProvisioningLocation()
@Deprecated 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)
AbstractBrooklynObjectConfigBag.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()
AddressableLocationgetAddress in interface AddressableLocationpublic boolean canProvisionMore()
public static boolean obtainSpecificPort(java.net.InetAddress localAddress,
int portNumber)
public static boolean obtainSpecificPort(java.net.InetAddress localAddress,
int portNumber,
java.lang.Boolean reuseAddr)
public static boolean checkPortAvailable(java.net.InetAddress localAddress,
int portNumber)
Networking.isPortAvailable(int)public static boolean checkPortAvailable(java.net.InetAddress localAddress,
int portNumber,
java.lang.Boolean reuseAddr)
public static int obtainPort(PortRange range)
public static int obtainPort(PortRange range, java.lang.Boolean reuseAddr)
public static int obtainPort(java.net.InetAddress localAddress,
PortRange range)
public static int obtainPort(java.net.InetAddress localAddress,
PortRange range,
java.lang.Boolean reuseAddr)
public static void releasePort(java.net.InetAddress localAddress,
int portNumber)
public void release(SshMachineLocation machine)
MachineProvisioningLocationrelease 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)
LocationWithObjectStorePersistenceObjectStore pointed at the given container/directory.newPersistenceObjectStore in interface LocationWithObjectStore