org.eclipse.jetty.server.Handler.stop()方法的使用及代码示例

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

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

Handler.stop介绍

暂无

代码示例

代码示例来源:origin: dropwizard/dropwizard

@Override
protected void doStop() throws Exception {
  super.doStop();
  for (String key : handlers.keySet()) {
    handlers.get(key).stop();
  }
}

代码示例来源:origin: igniterealtime/Openfire

/**
 * Removes a Jetty handler to be added to the embedded web server that is used to expose BOSH (HTTP-bind)
 * functionality.
 *
 * Removing a handler, even when null, or non-existing, might have side-effects as introduced by the Jetty
 * implementation. At the time of writing, Jetty will re
 *
 * @param handler The handler (should not be null).
 */
public void removeJettyHandler( Handler handler )
{
  if (handler instanceof WebAppContext) {
    // A work-around of the Jetty bug described at https://github.com/eclipse/jetty.project/issues/1425
    // NOTE: According to some comments on WebAppLoaderFix, this may stop working on Java 9.
    // Hopefully the Jetty team will have fixed the underlying bug by then
    WebAppLoaderFix.checkAndClose(((WebAppContext) handler).getClassLoader());
  }
  extensionHandlers.removeHandler( handler );
  if ( handler.isStarted() )
  {
    try
    {
      handler.stop();
    }
    catch ( Exception e )
    {
      Log.warn( "Unable to stop the handler that was removed: {}", handler, e );
    }
  }
}

代码示例来源:origin: org.apache.calcite.avatica/avatica-server

@Override public void stop() throws Exception {
 handler.stop();
}

代码示例来源:origin: apache/calcite-avatica

@Override public void stop() throws Exception {
 handler.stop();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

@Override
protected void doStop() throws Exception
{
  if (_handler!=null)
    _handler.stop();
  super.doStop();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

@Override
protected void doStop() throws Exception
{
  if (_handler!=null)
    _handler.stop();
  super.doStop();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

@Override
protected void doStop() throws Exception
{
  if (_handler!=null)
    _handler.stop();
  super.doStop();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

@Override
protected void doStop() throws Exception
{
  if (_handler!=null)
    _handler.stop();
  super.doStop();
}

代码示例来源:origin: org.eclipse.jetty/server

@Override
protected void doStop() throws Exception
{
  if (_handler!=null)
    _handler.stop();
  super.doStop();
}

代码示例来源:origin: org.igniterealtime.openfire/xmppserver

/**
 * Removes a Jetty handler to be added to the embedded web server that is used to expose BOSH (HTTP-bind)
 * functionality.
 *
 * Removing a handler, even when null, or non-existing, might have side-effects as introduced by the Jetty
 * implementation. At the time of writing, Jetty will re
 *
 * @param handler The handler (should not be null).
 */
public void removeJettyHandler( Handler handler )
{
  extensionHandlers.removeHandler( handler );
  if ( handler.isStarted() )
  {
    try
    {
      handler.stop();
    }
    catch ( Exception e )
    {
      Log.warn( "Unable to stop the handler that was removed: {}", handler, e );
    }
  }
}

代码示例来源:origin: enioka/jqm

void stop()
{
  if (server == null)
  {
    return;
  }
  jqmlogger.trace("Jetty will now stop");
  try
  {
    for (Handler ha : server.getHandlers())
    {
      ha.stop();
      ha.destroy();
      handlers.removeHandler(ha);
    }
    this.server.stop();
    this.server.join();
    this.server.destroy();
    this.server = null;
    jqmlogger.info("Jetty has stopped");
  }
  catch (Exception e)
  {
    jqmlogger.error(
        "An error occured during Jetty stop. It is not an issue if it happens during JQM node shutdown, but one during restart (memeory leak).",
        e);
  }
}

代码示例来源:origin: io.gravitee.am.management/gravitee-am-management-api-jetty

private void removeHandler(Domain domain) {
  Handler handler = getInternalHandler(domain);
  if (handler != null && handler.isStarted()) {
    try {
      logger.info("Stopping handler for {}: {}", domain.getName(), handler);
      handler.stop();
    } catch (Exception ex) {
      logger.error("Unable to stop an handler", ex);
    }
    parent.unmanage(handler);
    parent.removeHandler(handler);
  }
}

代码示例来源:origin: io.gravitee.am.gateway/gravitee-am-gateway-jetty

private void removeHandler(Domain domain) {
  Handler handler = getInternalHandler(domain);
  if (handler != null && handler.isStarted()) {
    try {
      logger.info("Stopping handler for {}: {}", domain.getName(), handler);
      handler.stop();
    } catch (Exception ex) {
      logger.error("Unable to stop an handler", ex);
    }
    parent.unmanage(handler);
    parent.removeHandler(handler);
  }
}

代码示例来源:origin: gravitee-io/graviteeio-access-management

private void removeHandler(Domain domain) {
  Handler handler = getInternalHandler(domain);
  if (handler != null && handler.isStarted()) {
    try {
      logger.info("Stopping handler for {}: {}", domain.getName(), handler);
      handler.stop();
    } catch (Exception ex) {
      logger.error("Unable to stop an handler", ex);
    }
    parent.unmanage(handler);
    parent.removeHandler(handler);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http-jetty

if (contexts != null) {
  for (Handler h : contexts.getHandlers()) {
    h.stop();

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

@Override
protected void doStop() throws Exception
{
  MultiException mex=new MultiException();
  try { super.doStop(); } catch(Throwable e){mex.add(e);}
  if (_handlers!=null)
  {
    for (int i=_handlers.length;i-->0;)
      try{_handlers[i].stop();}catch(Throwable e){mex.add(e);}
  }
  mex.ifExceptionThrow();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

@Override
protected void doStop() throws Exception
{
  MultiException mex=new MultiException();
  try { super.doStop(); } catch(Throwable e){mex.add(e);}
  if (_handlers!=null)
  {
    for (int i=_handlers.length;i-->0;)
      try{_handlers[i].stop();}catch(Throwable e){mex.add(e);}
  }
  mex.ifExceptionThrow();
}

代码示例来源:origin: org.eclipse.jetty/server

@Override
protected void doStop() throws Exception
{
  MultiException mex=new MultiException();
  try { super.doStop(); } catch(Throwable e){mex.add(e);}
  if (_handlers!=null)
  {
    for (int i=_handlers.length;i-->0;)
      try{_handlers[i].stop();}catch(Throwable e){mex.add(e);}
  }
  mex.ifExceptionThrow();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

@Override
protected void doStop() throws Exception
{
  MultiException mex=new MultiException();
  try { super.doStop(); } catch(Throwable e){mex.add(e);}
  if (_handlers!=null)
  {
    for (int i=_handlers.length;i-->0;)
      try{_handlers[i].stop();}catch(Throwable e){mex.add(e);}
  }
  mex.ifExceptionThrow();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

@Override
protected void doStop() throws Exception
{
  MultiException mex=new MultiException();
  try { super.doStop(); } catch(Throwable e){mex.add(e);}
  if (_handlers!=null)
  {
    for (int i=_handlers.length;i-->0;)
      try{_handlers[i].stop();}catch(Throwable e){mex.add(e);}
  }
  mex.ifExceptionThrow();
}

相关文章