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.


Field Summary
static Logger LOG

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

Construct a new instance.

LocalhostMachineProvisioningLocation(java.util.Map properties)

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

protected void configure()

protected void configure(java.util.Map flags)

java.net.InetAddress getAddress()

static java.net.InetAddress getLocalhostInetAddress()

static int obtainPort(PortRange range)

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

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

void provisionMore(int size)

void release(SshMachineLocation machine)

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

 
Methods inherited from class FixedListMachineProvisioningLocation
addChildLocation, canProvisionMore, configure, getAvailable, getInUse, getLatitude, getLongitude, getMachines, getProvisioningFlags, obtain, obtain, provisionMore, release, removeChildLocation
 
Methods inherited from class AbstractLocation
addChildLocation, configure, configure, containsLocation, equals, findLocationProperty, getChildLocations, getHostGeoInfo, getId, getLocationProperty, getName, getParentLocation, hasLocationProperty, hashCode, removeChildLocation, setHostGeoInfo, setParentLocation, string, toString
 

Field Detail

LOG

public static final Logger LOG


 
Constructor Detail

LocalhostMachineProvisioningLocation

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


LocalhostMachineProvisioningLocation

public LocalhostMachineProvisioningLocation(java.util.Map properties)


LocalhostMachineProvisioningLocation

public LocalhostMachineProvisioningLocation(java.lang.String name)


LocalhostMachineProvisioningLocation

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


 
Method Detail

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


configure

protected void configure()


configure

protected void configure(java.util.Map flags)


getAddress

public java.net.InetAddress getAddress()


getLocalhostInetAddress

public static java.net.InetAddress getLocalhostInetAddress()


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

@SuppressWarnings({ "unchecked", "rawtypes" })
public void provisionMore(int size)


release

public void release(SshMachineLocation machine)


releasePort

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


 

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