org.glassfish.embeddable.GlassFish.getStatus()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(144)

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

GlassFish.getStatus介绍

[英]Get the current status of GlassFish.
[中]获取GlassFish的当前状态。

代码示例

代码示例来源:origin: org.glassfish.main.core/glassfish

@Override
public Status getStatus() throws GlassFishException {
  return decoratedGf.getStatus();
}

代码示例来源:origin: eclipse-ee4j/glassfish

@Override
public Status getStatus() throws GlassFishException {
  return decoratedGf.getStatus();
}

代码示例来源:origin: eclipse-ee4j/glassfish

public void stop(BundleContext context) throws Exception {
  if (nonEmbedded) {
    System.out.println("We are in non-embedded mode, so " + context.getBundle() + " has nothing to do.");
    return;
  }
  try {
    // gf can be null - especially in non-embedded mode.
    if (gf != null && gf.getStatus() != GlassFish.Status.DISPOSED) {
      gf.dispose(); // dispose calls stop
    }
  } finally {
    gf = null;
  }
  if (gfr != null) { // gfr is non-null only if this activator has bootstrapped, else it's null.
    gfr.shutdown();
    gfr = null;
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

public synchronized void shutdown() throws GlassFishException {
  // make a copy to avoid ConcurrentModificationException
  for (GlassFish gf : new ArrayList<GlassFish>(gfs)) {
    if (gf.getStatus() != GlassFish.Status.DISPOSED) {
      try {
        gf.dispose();
      } catch (GlassFishException e) {
        e.printStackTrace();
      }
    }
  }
  gfs.clear();
  shutdownInternal();
  System.out.println("Completed shutdown of GlassFish runtime");
}

代码示例来源:origin: org.glassfish.main.core/glassfish

public synchronized void shutdown() throws GlassFishException {
  // make a copy to avoid ConcurrentModificationException
  for (GlassFish gf : new ArrayList<GlassFish>(gfs)) {
    if (gf.getStatus() != GlassFish.Status.DISPOSED) {
      try {
        gf.dispose();
      } catch (GlassFishException e) {
        e.printStackTrace();
      }
    }
  }
  gfs.clear();
  shutdownInternal();
  System.out.println("Completed shutdown of GlassFish runtime");
}

代码示例来源:origin: eclipse-ee4j/glassfish

/**
 * Starts the embedded server, opening ports, and running the startup
 * services.
 *
 * @throws LifecycleException if the server cannot be started propertly
 */
public synchronized void start() throws LifecycleException {
  if(glassfish != null) {
    try {
      if (glassfish.getStatus() != GlassFish.Status.STARTED) {
        glassfish.start();
      }
    } catch (GlassFishException e) {
      throw new LifecycleException(e); // TODO(Sahoo): Proper Exception Handling
    }
    logger.finer("GlassFish has been started");
  }
}

代码示例来源:origin: org.glassfish.main.core/glassfish

public void stop(BundleContext context) throws Exception {
  if (nonEmbedded) {
    System.out.println("We are in non-embedded mode, so " + context.getBundle() + " has nothing to do.");
    return;
  }
  try {
    // gf can be null - especially in non-embedded mode.
    if (gf != null && gf.getStatus() != GlassFish.Status.DISPOSED) {
      gf.dispose(); // dispose calls stop
    }
  } finally {
    gf = null;
  }
  if (gfr != null) { // gfr is non-null only if this activator has bootstrapped, else it's null.
    gfr.shutdown();
    gfr = null;
  }
}

代码示例来源:origin: org.glassfish.common/internal-api

/**
 * Starts the embedded server, opening ports, and running the startup
 * services.
 *
 * @throws LifecycleException if the server cannot be started propertly
 */
public synchronized void start() throws LifecycleException {
  if(glassfish != null) {
    try {
      if (glassfish.getStatus() != GlassFish.Status.STARTED) {
        glassfish.start();
      }
    } catch (GlassFishException e) {
      throw new LifecycleException(e); // TODO(Sahoo): Proper Exception Handling
    }
    logger.finer("GlassFish has been started");
  }
}

代码示例来源:origin: org.glassfish.fighterfish/osgi-javaee-base

while ((status = gf.getStatus()) != GlassFish.Status.STARTED) {
  if (status == GlassFish.Status.DISPOSED) return;
  try {

代码示例来源:origin: org.glassfish.main.core/glassfish

System.out.println("command = " + command);
if ("start".equalsIgnoreCase(command)) {
  if (gf.getStatus() != GlassFish.Status.STARTED || gf.getStatus() == GlassFish.Status.STOPPING || gf.getStatus() == GlassFish.Status.STARTING)
    gf.start();
  else System.out.println("Already started or stopping or starting");
} else if ("stop".equalsIgnoreCase(command)) {
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;
  System.out.println("Deployed = " + name);
} else if (command.startsWith("undeploy")) {
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;
  System.exit(0);
} else {
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;

代码示例来源:origin: eclipse-ee4j/glassfish

System.out.println("command = " + command);
if ("start".equalsIgnoreCase(command)) {
  if (gf.getStatus() != GlassFish.Status.STARTED || gf.getStatus() == GlassFish.Status.STOPPING || gf.getStatus() == GlassFish.Status.STARTING)
    gf.start();
  else System.out.println("Already started or stopping or starting");
} else if ("stop".equalsIgnoreCase(command)) {
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;
  System.out.println("Deployed = " + name);
} else if (command.startsWith("undeploy")) {
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;
  System.exit(0);
} else {
  if (gf.getStatus() != GlassFish.Status.STARTED) {
    System.out.println("GlassFish is not started yet. Please execute start first.");
    continue;

代码示例来源:origin: org.glassfish.main.ejb/ejb-container

_logger.info("[EJBContainerImpl] GlassFish status: " + server.getStatus());
if (app instanceof ScatteredArchive) {
  _logger.info("[EJBContainerImpl] Deploying as a ScatteredArchive");

代码示例来源:origin: eclipse-ee4j/glassfish

"GlassFish Status = {1}", new Object[]{glassfish, glassfish.getStatus()});
} catch (Throwable ex) {
  throw new RuntimeException(ex);

代码示例来源:origin: org.glassfish.common/internal-api

"GlassFish Status = {1}", new Object[]{glassfish, glassfish.getStatus()});
} catch (Throwable ex) {
  throw new RuntimeException(ex);

相关文章