org.apache.catalina.Wrapper.getFacade()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(162)

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

Wrapper.getFacade介绍

[英]Get the facade ServletRegistration.
[中]去登记。

代码示例

代码示例来源:origin: jboss.web/jbossweb

public ServletRegistration getServletRegistration(String servletName) {
  if (restricted) {
    throw new UnsupportedOperationException(sm.getString("applicationContext.restricted"));
  }
  Wrapper wrapper = (Wrapper) context.findChild(servletName);
  if (wrapper != null) {
    return wrapper.getFacade();
  } else {
    return null;
  }
}

代码示例来源:origin: jboss.web/jbossweb

public Map<String, ServletRegistration> getServletRegistrations() {
  if (restricted) {
    throw new UnsupportedOperationException(sm.getString("applicationContext.restricted"));
  }
  HashMap<String, ServletRegistration> result = 
    new HashMap<String, ServletRegistration>();
  Container[] wrappers = context.findChildren();
  for (int i = 0; i < wrappers.length; i++) {
    Wrapper wrapper = (Wrapper) wrappers[i];
    result.put(wrapper.getName(), wrapper.getFacade());
  }
  return Collections.unmodifiableMap(result);
}

代码示例来源:origin: org.jboss.web/jbossweb

public ServletRegistration getServletRegistration(String servletName) {
  if (restricted) {
    throw MESSAGES.restrictedListenerCannotCallMethod();
  }
  Wrapper wrapper = (Wrapper)context.findChild(servletName);
  if (wrapper != null) {
    return wrapper.getFacade();
  } else {
    return null;
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

public Map<String, ServletRegistration> getServletRegistrations() {
  if (restricted) {
    throw MESSAGES.restrictedListenerCannotCallMethod();
  }
  HashMap<String, ServletRegistration> result = 
    new HashMap<String, ServletRegistration>();
  Container[] wrappers = context.findChildren();
  for (int i = 0; i < wrappers.length; i++) {
    Wrapper wrapper = (Wrapper) wrappers[i];
    result.put(wrapper.getName(), wrapper.getFacade());
  }
  return Collections.unmodifiableMap(result);
}

代码示例来源:origin: jboss.web/jbossweb

public ServletRegistration.Dynamic addServlet(String servletName, String className)
    throws IllegalArgumentException, IllegalStateException {
  if (restricted) {
    throw new UnsupportedOperationException(sm.getString("applicationContext.restricted"));
  }
  if (!context.isStarting()) {
    throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
            getContextPath()));
  }
  if (context.findChild(servletName) != null) {
    return null;
  }
  Wrapper wrapper = context.createWrapper();
  wrapper.setDynamic(true);
  wrapper.setName(servletName);
  wrapper.setServletClass(className);
  context.addChild(wrapper);
  return (ServletRegistration.Dynamic) wrapper.getFacade();
}

代码示例来源:origin: jboss.web/jbossweb

public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {
  if (restricted) {
    throw new UnsupportedOperationException(sm.getString("applicationContext.restricted"));
  }
  if (!context.isStarting()) {
    throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
            getContextPath()));
  }
  if (context.findChild(servletName) != null) {
    return null;
  }
  // Servlet instance unicity
  for (Container container : context.getParent().findChildren()) {
    for (Container wrapper : container.findChildren()) {
      if (((Wrapper) wrapper).getServlet() == servlet) {
        return null;
      }
    }
  }
  Wrapper wrapper = context.createWrapper();
  wrapper.setDynamic(true);
  wrapper.setName(servletName);
  wrapper.setServletClass(servlet.getClass().getName());
  wrapper.setServlet(servlet);
  context.addChild(wrapper);
  return (ServletRegistration.Dynamic) wrapper.getFacade();
}

代码示例来源:origin: org.jboss.web/jbossweb

wrapper.setServlet(servlet);
context.addChild(wrapper);
return (ServletRegistration.Dynamic) wrapper.getFacade();

代码示例来源:origin: org.jboss.web/jbossweb

public ServletRegistration.Dynamic addServlet(String servletName, String className)
    throws IllegalArgumentException, IllegalStateException {
  if (restricted) {
    throw MESSAGES.restrictedListenerCannotCallMethod();
  }
  if (!context.isStarting()) {
    throw MESSAGES.contextAlreadyInitialized(getContextPath());
  }
  Wrapper existingWrapper = (Wrapper)context.findChild(servletName);
  if (existingWrapper != null) {
    if (existingWrapper.isOverridable()) {
      existingWrapper.setOverridable(false);
    } else {
      return null;
    }
  }
  Wrapper wrapper = context.createWrapper();
  wrapper.setDynamic(true);
  wrapper.setName(servletName);
  wrapper.setServletClass(className);
  context.addChild(wrapper);
  return (ServletRegistration.Dynamic) wrapper.getFacade();
}

相关文章