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

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

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

GlassFish.stop介绍

[英]Stop GlassFish. When this method is called, all the lifecycle (aka startup) services are stopped. GlassFish can be started again by calling the start method. Calling this method while the server is in Status#STARTED state is a no-op.
[中]停止玻璃鱼。调用此方法时,所有生命周期(也称为启动)服务都将停止。可以通过调用start方法再次启动GlassFish。当服务器处于“已启动”状态时调用此方法是不可操作的。

代码示例

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

@Override
public void stop() throws GlassFishException {
  decoratedGf.stop();
}

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

@Override
public void stop() throws GlassFishException {
  decoratedGf.stop();
}

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

public void run() {
    try {
      if (gf != null) {
        gf.stop();
        gf.dispose();
      }
    } catch (Exception ex) {
    }
  }
});

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

public void run() {
    try {
      if (gf != null) {
        gf.stop();
        gf.dispose();
      }
    } catch (Exception ex) {
    }
  }
});

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

void stop() {
  if (state == CLOSED) {
    return;
  }
  try {
    server.stop();
  } catch (GlassFishException e) {
    _logger.log(Level.WARNING, "Cannot stop embedded server", e);
  } finally {
    try {
      server.dispose();
    } catch (GlassFishException e) {
      _logger.log(Level.WARNING, "Cannot dispose embedded server", e);
    }
    state = CLOSED;
  }
}

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

void stop() {
  if (state == CLOSED) {
    return;
  }
  try {
    server.stop();
  } catch (GlassFishException e) {
    _logger.log(Level.WARNING, "Cannot stop embedded server", e);
  } finally {
    try {
      server.dispose();
    } catch (GlassFishException e) {
      _logger.log(Level.WARNING, "Cannot dispose embedded server", e);
    }
    state = CLOSED;
  }
}

代码示例来源:origin: com.java-adventures.junit/glassfish-junit-rule

public void stop() {
  try {
    gf.stop();
    gf.dispose();
    gf = null;
    gfr.shutdown();
    gfr = null;
  } catch (Exception e) {
    throw new RuntimeException("Shutdown failed", e);
  }
  log.info("GF has been shutdown");
}

代码示例来源:origin: ops4j/org.ops4j.pax.exam2

/**
 * Undeploys all modules and shuts down the GlassFish runtime.
 */
public synchronized void cleanup() {
  undeployModules();
  try {
    glassFish.stop();
  }
  catch (GlassFishException exc) {
    throw new TestContainerException(exc);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-glassfish-embedded-3.1

public void stop() throws LifecycleException {
  try {
    unbindCommandRunner();
    glassfish.stop();
  } catch (Exception e) {
    throw new LifecycleException("Could not stop GlassFish Embedded", e);
  }
}

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

/**
 * stops the embedded server instance, any deployed application will be stopped
 * ports will be closed and shutdown services will be ran.
 * EmbeddedFileSystem will be released, meaning that any managed directory will
 * be deleted rendering the EmbeddedFileSystem unusable.
 *
 * @throws LifecycleException if the server cannot shuts down properly
 */
public synchronized void stop() throws LifecycleException {
  try {
    if (glassfish != null) {
      glassfish.stop();
      logger.finer("GlassFish has been stopped");
    }
    if (glassfishRuntime != null) {
      glassfishRuntime.shutdown();
      logger.finer("GlassFishruntime has been shutdown");
    }
  } catch (Exception ex) {
    logger.log(Level.WARNING, ex.getMessage(), ex);
  } finally {
    synchronized(servers) {
      servers.remove(serverName);
    }
    fileSystem.get().preDestroy();
  }
}

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

/**
 * stops the embedded server instance, any deployed application will be stopped
 * ports will be closed and shutdown services will be ran.
 * EmbeddedFileSystem will be released, meaning that any managed directory will
 * be deleted rendering the EmbeddedFileSystem unusable.
 *
 * @throws LifecycleException if the server cannot shuts down properly
 */
public synchronized void stop() throws LifecycleException {
  try {
    if (glassfish != null) {
      glassfish.stop();
      logger.finer("GlassFish has been stopped");
    }
    if (glassfishRuntime != null) {
      glassfishRuntime.shutdown();
      logger.finer("GlassFishruntime has been shutdown");
    }
  } catch (Exception ex) {
    logger.log(Level.WARNING, ex.getMessage(), ex);
  } finally {
    synchronized(servers) {
      servers.remove(serverName);
    }
    fileSystem.getService().preDestroy();
  }
}

代码示例来源:origin: com.googlecode.jeeunit/jeeunit-glassfish

private void shutdownInternal() throws GlassFishException {
  if (glassFish != null) {
    glassFish.getDeployer().undeploy(getApplicationName());
    glassFish.stop();
    glassFish = null;
  }
}

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

gfKernel.stop();

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

gfKernel.stop();

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

gf.stop();
  gf.dispose();
} catch (Exception ex) {

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

gf.stop();
  gf.dispose();
} catch (Exception ex) {

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

continue;
  gf.stop();
} else if (command.startsWith("deploy")) {
  if (gf.getStatus() != GlassFish.Status.STARTED) {

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

continue;
  gf.stop();
} else if (command.startsWith("deploy")) {
  if (gf.getStatus() != GlassFish.Status.STARTED) {

代码示例来源:origin: stackoverflow.com

glassFish.stop();
glassFish.dispose();

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

server.stop();

相关文章