brooklyn.entity.basic.Entities.startManagement()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(113)

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

Entities.startManagement介绍

[英]Starts managing the given (unmanaged) app, setting the given brooklyn properties on the new management context.
[中]开始管理给定(非托管)应用程序,在新的管理上下文中设置给定的brooklyn属性。

代码示例

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

/**
 * Builds and manages the application, calling the user's {@link #doBuild()} method.
 * 
 * @throws IllegalStateException If already managed, or if called during {@link #doBuild()}, or if 
 *                               multiple concurrent calls
 */
public final StartableApplication manage(ManagementContext managementContext) {
  if (!inManage.compareAndSet(false, true)) {
    throw new IllegalStateException("Concurrent and re-entrant calls to manage() forbidden on "+this);
  }
  try {
    checkNotManaged();
    this.app = managementContext.getEntityManager().createEntity(appSpec);
    this.managementContext = managementContext;
    doBuild();
    Entities.startManagement(app, managementContext);
    managed = true;
    return app;
  } finally {
    inManage.set(false);
  }
}

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

/** Launches the web console on the given port, and a Brooklyn application, with a single command.
 * For readability and flexibility, clients may prefer the {@link #newLauncher()} builder-style syntax.
 * 
 * @deprecated in 0.5; use newInstance().webconsolePort(port).shutdownOnExit(shutdownApp).webconsole(startWebConsole).application(app).start()
 */
@Deprecated
public static ManagementContext manage(final AbstractApplication app, int port, boolean shutdownApp, boolean startWebConsole) {
  // Locate the management context
  Entities.startManagement(app);
  LocalManagementContext context = (LocalManagementContext) app.getManagementContext();
  if (startWebConsole) {
    try {
      new BrooklynWebServer(context, port).start();
    } catch (Exception e) {
      LOG.warn("Failed to start Brooklyn web-console", e);
    }
  }
  if (shutdownApp) Entities.invokeStopOnShutdown(app);
  
  return context;
}

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

/** convenience for starting an entity, esp a new Startable instance which has been created dynamically
 * (after the application is started) */
public static void start(Entity e, Collection<? extends Location> locations) {
  if (!isManaged(e) && !manage(e)) {
    log.warn("Using discouraged mechanism to start management -- Entities.start(Application, Locations) -- caller should create and use the preferred management context");
    startManagement(e);
  }
  if (e instanceof Startable) Entities.invokeEffector((EntityLocal)e, e, Startable.START,
      MutableMap.of("locations", locations)).getUnchecked();
}

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

public synchronized void attemptLegacyAutodeployment(String effectorName) {
  if (managementContext!=null) {
    log.warn("Autodeployment suggested but not required for "+entity+"."+effectorName);
    return;
  }
  if (entity instanceof Application) {
    log.warn("Autodeployment with new management context triggered for "+entity+"."+effectorName+" -- will not be supported in future. Explicit manage call required.");
    if (initialManagementContext != null) {
      initialManagementContext.getEntityManager().manage(entity);
    } else {
      Entities.startManagement(entity);
    }
    return;
  }
  if ("start".equals(effectorName)) {
    Entity e=entity;
    if (e.getParent()!=null && ((EntityInternal)e.getParent()).getManagementSupport().isDeployed()) { 
      log.warn("Autodeployment in parent's management context triggered for "+entity+"."+effectorName+" -- will not be supported in future. Explicit manage call required.");
      ((EntityInternal)e.getParent()).getManagementContext().getEntityManager().manage(entity);
      return;
    }
  }
  log.warn("Autodeployment not available for "+entity+"."+effectorName);
}

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

Entities.startManagement(app, managementContext);
apps.add(app);

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

Entities.startManagement((Application)rebindContext.getEntity(appId), managementContext);

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

Entities.startManagement(instance, mgmt);
Entities.startManagement(instance, mgmt);

代码示例来源:origin: io.brooklyn/brooklyn-rest-server

Entities.startManagement(instance, mgmt);
Entities.startManagement(instance, mgmt);

相关文章