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

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

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

GlassFish.dispose介绍

[英]Call this method if you don't need this GlassFish instance any more. This method will stop GlassFish if not already stopped. After this method is called, calling any method except #getStatuson the GlassFish object will cause an IllegalStateException to be thrown. When this method is called, any resource (like temporary files, threads, etc.) is also released.
[中]如果不再需要此GlassFish实例,请调用此方法。如果尚未停止,此方法将停止GlassFish。调用此方法后,在GlassFish对象上调用除#GetStatus之外的任何方法都会导致抛出IllegalStateException。调用此方法时,还将释放任何资源(如临时文件、线程等)。

代码示例

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

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

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

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

代码示例来源: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: eclipse-ee4j/glassfish

@Override
public synchronized void shutdown() throws GlassFishException {
  for (Object gf : gfMap.values()) {
    try {
      ((GlassFish) gf).dispose();
    } catch (IllegalStateException ex) {
      // ignore.
    }
  }
  gfMap.clear();
  try {
    shutdownInternal();
  } catch (GlassFishException ex) {
    logger.log(Level.WARNING, LogFacade.CAUGHT_EXCEPTION, ex.getMessage());
  }
}

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

@Override
public synchronized void shutdown() throws GlassFishException {
  for (Object gf : gfMap.values()) {
    try {
      ((GlassFish) gf).dispose();
    } catch (IllegalStateException ex) {
      // ignore.
    }
  }
  gfMap.clear();
  try {
    shutdownInternal();
  } catch (GlassFishException ex) {
    logger.log(Level.WARNING, LogFacade.CAUGHT_EXCEPTION, ex.getMessage());
  }
}

代码示例来源: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.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

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

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

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

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

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

glassFish.dispose();

相关文章