org.jboss.resteasy.spi.Registry.getSize()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(99)

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

Registry.getSize介绍

暂无

代码示例

代码示例来源:origin: resteasy/Resteasy

@Override
public int getSize()
{
 return delegate.getSize();
}

代码示例来源:origin: org.jboss.resteasy/resteasy-vertx

@Override
public int getSize()
{
 return delegate.getSize();
}

代码示例来源:origin: org.switchyard.components/switchyard-component-resteasy

/**
 * Unregisters a RESTEasy servlet.
 * @param alias alias
 */
public void unregisterRESTEasyServlet(String alias) {
  OsgiRESTEasyServletWrapper servlet = getRegisteredRESTEasyServlet(alias);
  if (servlet == null) {
    throw new IllegalArgumentException("No RESTEasy servlet is registered for the alias '" + alias + "'");
  }
  if (servlet.getDispatcher().getRegistry().getSize() != 0) {
    throw new IllegalStateException("Cannot remove RESTEasy Servlet '" + alias + "' - registry is not empty");
  }
  _httpService.unregister(alias);
  _servlets.remove(alias);
}

代码示例来源:origin: jboss-switchyard/components

/**
 * Unregisters a RESTEasy servlet.
 * @param alias alias
 */
public void unregisterRESTEasyServlet(String alias) {
  OsgiRESTEasyServletWrapper servlet = getRegisteredRESTEasyServlet(alias);
  if (servlet == null) {
    throw new IllegalArgumentException("No RESTEasy servlet is registered for the alias '" + alias + "'");
  }
  if (servlet.getDispatcher().getRegistry().getSize() != 0) {
    throw new IllegalStateException("Cannot remove RESTEasy Servlet '" + alias + "' - registry is not empty");
  }
  _httpService.unregister(alias);
  _servlets.remove(alias);
}

代码示例来源:origin: jboss-switchyard/components

@Override
public void stop() {
  _registry.unregisterRESTEasyResources(_alias, _classes);
  OsgiRESTEasyServletWrapper servlet = _registry.getRegisteredRESTEasyServlet(_alias);
  if (servlet != null && servlet.getDispatcher().getRegistry().getSize() == 0) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Unregistering RESTEasy servlet with an alias '" + _alias + "'");
    }
    _registry.unregisterRESTEasyServlet(_alias);
  }
}

代码示例来源:origin: org.switchyard.components/switchyard-component-resteasy

@Override
public void stop() {
  _registry.unregisterRESTEasyResources(_alias, _classes);
  OsgiRESTEasyServletWrapper servlet = _registry.getRegisteredRESTEasyServlet(_alias);
  if (servlet != null && servlet.getDispatcher().getRegistry().getSize() == 0) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Unregistering RESTEasy servlet with an alias '" + _alias + "'");
    }
    _registry.unregisterRESTEasyServlet(_alias);
  }
}

代码示例来源:origin: org.switchyard/switchyard-deploy-jboss-as7

/**
   * {@inheritDoc}
   */
  public void stop() {
    if ((_context != null) && _context.isStarted()) {
      Registry registry = (Registry)_context.getServletContext().getAttribute(Registry.class.getName());
      if (registry != null) {
        // Remove registrations
        for (Class<?> clazz : _classes) {
          LOG.debug("Stopping ... " + clazz);
          registry.removeRegistrations(clazz);
        }
        // Destroy the web context unless if it is default
        if ((registry.getSize() == 0) && (!_context.getPath().equals("/"))) {
          try {
            Container container = _context.getParent();
            container.removeChild(_context);
            _context.stop();
            _context.destroy();
            LOG.info("Destroyed RESTEasy context " + _context.getPath());
          } catch (Exception e) {
            ExtensionLogger.ROOT_LOGGER.unableToDestroyWebContext(_context.getPath(), e);
          }
        }
      }
    }
  }
}

代码示例来源:origin: jboss-switchyard/release

/**
   * {@inheritDoc}
   */
  public void stop() {
    if ((_context != null) && _context.isStarted()) {
      Registry registry = (Registry)_context.getServletContext().getAttribute(Registry.class.getName());
      if (registry != null) {
        // Remove registrations
        for (Class<?> clazz : _classes) {
          LOG.debug("Stopping ... " + clazz);
          registry.removeRegistrations(clazz);
        }
        // Destroy the web context unless if it is default
        if ((registry.getSize() == 0) && (!_context.getPath().equals("/"))) {
          try {
            Container container = _context.getParent();
            container.removeChild(_context);
            _context.stop();
            _context.destroy();
            LOG.info("Destroyed RESTEasy context " + _context.getPath());
          } catch (Exception e) {
            ExtensionLogger.ROOT_LOGGER.unableToDestroyWebContext(_context.getPath(), e);
          }
        }
      }
    }
  }
}

相关文章