Brooklyn

brooklyn.location.basic
[Java] Class LocalhostMachineProvisioningLocation

java.lang.Object
  brooklyn.location.basic.AbstractLocation
      brooklyn.location.basic.FixedListMachineProvisioningLocation
          brooklyn.location.basic.LocalhostMachineProvisioningLocation
All Implemented Interfaces:
AddressableLocation

public class LocalhostMachineProvisioningLocation
extends FixedListMachineProvisioningLocation

An implementation of 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.


Nested Class Summary
static class LocalhostMachineProvisioningLocation.LocalhostMachine

 
Field Summary
static Logger LOG

 
Fields inherited from class FixedListMachineProvisioningLocation
inUse, machines, pendingRemoval
 
Fields inherited from class AbstractLocation
LOG, PARENT_LOCATION, hostGeoInfo, name
 
Constructor Summary
LocalhostMachineProvisioningLocation()

Construct a new instance.

LocalhostMachineProvisioningLocation(java.util.Map properties)

@param properties the properties of the new instance.

LocalhostMachineProvisioningLocation(java.lang.String name)

LocalhostMachineProvisioningLocation(java.lang.String name, int count)

 
Method Summary
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)#isPortAvailable(int)

void configure(java.util.Map flags)

java.net.InetAddress getAddress()

static java.net.InetAddress getLocalhostInetAddress()

static boolean isSudoAllowed()

static int obtainPort(PortRange range)

static int obtainPort(java.net.InetAddress localAddress, PortRange range)

static boolean obtainSpecificPort(java.net.InetAddress localAddress, int portNumber)

protected void provisionMore(int size, java.util.Map flags)

void release(SshMachineLocation machine)

static void releasePort(java.net.InetAddress localAddress, int portNumber)

static LocationSpec spec()

 
Methods inherited from class FixedListMachineProvisioningLocation
addChild, addMachine, canProvisionMore, close, configure, getAllMachines, getAvailable, getInUse, getMachines, getProvisioningFlags, init, newSubLocation, obtain, obtain, provisionMore, provisionMore, release, removeChild, removeMachine, toVerboseString
 
Methods inherited from class AbstractLocation
addChild, addChild, addChildLocation, addExtension, assertNotYetManaged, configure, containsLocation, equals, findLocationProperty, getAllConfig, getAllConfig, getChildLocations, getChildren, getConfig, getConfigBag, getDisplayName, getExtension, getHostGeoInfo, getId, getLocationProperty, getManagementContext, getName, getParent, getParentLocation, getRawLocalConfigBag, getRebindSupport, hasConfig, hasConfig, hasExtension, hasLocationProperty, hashCode, init, isLegacyConstruction, isManaged, onManagementStarted, onManagementStopped, removeChild, removeChildLocation, setConfig, setHostGeoInfo, setManagementContext, setName, setParent, setParentLocation, string, toMetadataRecord, toString, toVerboseString
 

Field Detail

LOG

public static final Logger LOG


 
Constructor Detail

LocalhostMachineProvisioningLocation

public LocalhostMachineProvisioningLocation()
Construct a new instance. The constructor recognises the following properties:


LocalhostMachineProvisioningLocation

public LocalhostMachineProvisioningLocation(java.util.Map properties)
deprecated:
since 0.6
Parameters:
properties - the properties of the new instance.
See Also:
LocalhostMachineProvisioningLocation()


LocalhostMachineProvisioningLocation

public LocalhostMachineProvisioningLocation(java.lang.String name)


LocalhostMachineProvisioningLocation

public LocalhostMachineProvisioningLocation(java.lang.String name, int count)


 
Method Detail

canProvisionMore

return canProvisionMore;
public boolean canProvisionMore()


checkPortAvailable

public 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)#isPortAvailable(int)


configure

public void configure(java.util.Map flags)


getAddress

return address;
public java.net.InetAddress getAddress()


getLocalhostInetAddress

public static java.net.InetAddress getLocalhostInetAddress()


isSudoAllowed

public static boolean isSudoAllowed()


obtainPort

public static int obtainPort(PortRange range)


obtainPort

public static int obtainPort(java.net.InetAddress localAddress, PortRange range)


obtainSpecificPort

public static boolean obtainSpecificPort(java.net.InetAddress localAddress, int portNumber)


provisionMore

for (int i=0; iprovisionMore(int size, java.util.Map flags)


release

public void release(SshMachineLocation machine)


releasePort

public static void releasePort(java.net.InetAddress localAddress, int portNumber)


spec

public static LocationSpec spec()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.