org.apache.brooklyn.api.mgmt.LocationManager.manage()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.apache.brooklyn.api.mgmt.LocationManager.manage()方法的一些代码示例,展示了LocationManager.manage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocationManager.manage()方法的具体详情如下:
包路径:org.apache.brooklyn.api.mgmt.LocationManager
类名称:LocationManager
方法名:manage

LocationManager.manage介绍

[英]Begins management for the given location and its children, recursively. depending on the implementation of the management context, this might push it out to one or more remote management nodes. Manage a location.
[中]递归地开始对给定位置及其子对象的管理。根据管理上下文的实现,这可能会将其推送到一个或多个远程管理节点。管理一个位置。

代码示例

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

@Override
@Deprecated
public Location manage(Location loc) {
  if (isInitialManagementContextReal()) {
    return initialManagementContext.getLocationManager().manage(loc);
  } else {
    throw new IllegalStateException("Non-deployment context "+this+" is not valid for this operation: cannot manage "+loc);
  }
}

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

/**
 * Registers the given location (and all its children) with the management context. 
 * @throws IllegalStateException if the parent location is not already managed
 * 
 * @since 0.6.0 (added only for backwards compatibility, where locations are being created directly; previously in {@link Entities}).
 * @deprecated in 0.6.0; use {@link LocationManager#createLocation(LocationSpec)} instead.
 */
@Deprecated
public static void manage(Location loc, ManagementContext managementContext) {
  if (!managementContext.getLocationManager().isManaged(loc)) {
    log.warn("Deprecated use of unmanaged location ("+loc+"); will be managed automatically now but not supported in future versions");
    // FIXME this occurs MOST OF THE TIME e.g. including BrooklynLauncher.location(locationString)
    // not sure what is the recommend way to convert from locationString to locationSpec, or the API we want to expose;
    // deprecating some of the LocationRegistry methods seems sensible?
    log.debug("Stack trace for location of: Deprecated use of unmanaged location; will be managed automatically now but not supported in future versions", new Exception("TRACE for: Deprecated use of unmanaged location"));
    managementContext.getLocationManager().manage(loc);
  }
}

代码示例来源:origin: org.apache.brooklyn/brooklyn-software-base

@Override
  public void reloaded() {
    Location resolved = context.getLocationRegistry().resolve(definition);
    context.getLocationRegistry().updateDefinedLocation(definition);
    context.getLocationManager().manage(resolved);
  }
};

代码示例来源:origin: io.brooklyn.networking/brooklyn-networking-cloudstack

getManagementContext().getLocationManager().manage(l);

相关文章