Brooklyn

brooklyn.location.basic
[Java] Class BasicLocationRegistry

java.lang.Object
  brooklyn.location.basic.BasicLocationRegistry
All Implemented Interfaces:
LocationRegistry

@java.lang.SuppressWarnings({"rawtypes","unchecked"})
public class BasicLocationRegistry

Field Summary
static Logger log

protected java.util.Map resolvers

protected java.lang.ThreadLocal specsSeen

 
Constructor Summary
BasicLocationRegistry(ManagementContext mgmt)

 
Method Summary
boolean canMaybeResolve(java.lang.String spec)

static java.util.List expandCommaSeparateLocations(java.lang.String locations)

Splits a comma-separated list of locations (names or specs) into an explicit list.

protected void findServices()

LocationDefinition getDefinedLocationById(java.lang.String id)

LocationDefinition getDefinedLocationByName(java.lang.String name)

java.util.Map getDefinedLocations()

java.util.Map getProperties()

protected LocationResolver getSpecDefaultResolver(java.lang.String spec)

providers default impl for RegistryLocationResolver.accepts

protected LocationResolver getSpecFirstResolver(java.lang.String spec, java.lang.String... resolversToCheck)

protected LocationResolver getSpecResolver(java.lang.String spec)

static boolean isResolverPrefixForSpec(LocationResolver resolver, java.lang.String spec, boolean argumentRequired)

boolean registerResolver(LocationResolver r)

Registers the given resolver, invoking LocationResolver#init(ManagementContext)#init(ManagementContext) on the argument and returning true, unless the argument indicates false for EnableableLocationResolver#isEnabled()#isEnabled()

void removeDefinedLocation(java.lang.String id)

Location resolve(java.lang.String spec)

Location resolve(java.lang.String spec, java.util.Map locationFlags)

java.util.List resolve(java.lang.Iterable spec)

Location resolve(LocationDefinition ld)

Location resolve(LocationDefinition ld, java.util.Map flags)

Location resolveForPeeking(LocationDefinition ld)

Location resolveIfPossible(java.lang.String spec)

java.util.List resolveList(java.lang.Object l)

Location resolveLocationDefinition(LocationDefinition ld, java.util.Map locationFlags, java.lang.String optionalName)

static void setupLocationRegistryForTesting(ManagementContext mgmt)

void updateDefinedLocation(LocationDefinition l)

void updateDefinedLocations()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

log

public static final Logger log


resolvers

protected final java.util.Map resolvers


specsSeen

protected java.lang.ThreadLocal specsSeen


 
Constructor Detail

BasicLocationRegistry

public BasicLocationRegistry(ManagementContext mgmt)


 
Method Detail

canMaybeResolve

@java.lang.Overrideif (!canMaybeResolve(spec)) return null;
public boolean canMaybeResolve(java.lang.String spec)


expandCommaSeparateLocations

public static java.util.List expandCommaSeparateLocations(java.lang.String locations)
Splits a comma-separated list of locations (names or specs) into an explicit list. The splitting is very careful to handle commas embedded within specs, to split correctly.


findServices

protected void findServices()


getDefinedLocationById

@java.lang.Overridereturn definedLocations.get(id);
public LocationDefinition getDefinedLocationById(java.lang.String id)


getDefinedLocationByName

@java.lang.Overridesynchronized (definedLocations) {
public LocationDefinition getDefinedLocationByName(java.lang.String name)


getDefinedLocations

@java.lang.Overridesynchronized (definedLocations) {
public java.util.Map getDefinedLocations()


getProperties

@java.lang.Override}
public java.util.Map getProperties()


getSpecDefaultResolver

protected LocationResolver getSpecDefaultResolver(java.lang.String spec)
providers default impl for RegistryLocationResolver.accepts


getSpecFirstResolver

protected LocationResolver getSpecFirstResolver(java.lang.String spec, java.lang.String... resolversToCheck)


getSpecResolver

protected LocationResolver getSpecResolver(java.lang.String spec)


isResolverPrefixForSpec

public static boolean isResolverPrefixForSpec(LocationResolver resolver, java.lang.String spec, boolean argumentRequired)


registerResolver

public boolean registerResolver(LocationResolver r)
Registers the given resolver, invoking LocationResolver#init(ManagementContext)#init(ManagementContext) on the argument and returning true, unless the argument indicates false for EnableableLocationResolver#isEnabled()#isEnabled()


removeDefinedLocation

@java.lang.Overridesynchronized (definedLocations) {
public void removeDefinedLocation(java.lang.String id)


resolve

@java.lang.Overridelog.trace("Unable to resolve "+spec+": "+e, e);
public final Location resolve(java.lang.String spec)


resolve

@java.lang.Override
public Location resolve(java.lang.String spec, java.util.Map locationFlags)


resolve

@java.lang.Override}
public java.util.List resolve(java.lang.Iterable spec)


resolve

@java.lang.Overridepublic Location resolve(LocationDefinition ld, Map flags) {
public Location resolve(LocationDefinition ld)


resolve

@java.lang.Override}
public Location resolve(LocationDefinition ld, java.util.Map flags)


resolveForPeeking

@java.lang.OverrideConfigBag newLocationFlags = ConfigBag.newInstance(ld.getConfig())
public Location resolveForPeeking(LocationDefinition ld)


resolveIfPossible

@java.lang.Override
public final Location resolveIfPossible(java.lang.String spec)


resolveList

public java.util.List resolveList(java.lang.Object l)


resolveLocationDefinition

public Location resolveLocationDefinition(LocationDefinition ld, java.util.Map locationFlags, java.lang.String optionalName)


setupLocationRegistryForTesting

@VisibleForTesting
public static void setupLocationRegistryForTesting(ManagementContext mgmt)


updateDefinedLocation

@java.lang.Overridesynchronized (definedLocations) {
public void updateDefinedLocation(LocationDefinition l)


updateDefinedLocations

public void updateDefinedLocations()


 

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