Пример #1
0
 /** If any servlet/filter classes are declared, then we probably don't want to scan. */
 protected boolean hasBootClasses(JBossWebMetaData webdata)
     throws DeploymentUnitProcessingException {
   if (webdata.getServlets() != null) {
     for (ServletMetaData servlet : webdata.getServlets()) {
       String servletClass = servlet.getServletClass();
       if (BOOT_CLASSES.contains(servletClass)) return true;
     }
   }
   if (webdata.getFilters() != null) {
     for (FilterMetaData filter : webdata.getFilters()) {
       if (BOOT_CLASSES.contains(filter.getFilterClass())) return true;
     }
   }
   return false;
 }
Пример #2
0
  protected Class<?> checkDeclaredApplicationClassAsServlet(
      JBossWebMetaData webData, ClassLoader classLoader) throws DeploymentUnitProcessingException {
    if (webData.getServlets() == null) return null;

    for (ServletMetaData servlet : webData.getServlets()) {
      String servletClass = servlet.getServletClass();
      if (servletClass == null) continue;
      Class<?> clazz = null;
      try {
        clazz = classLoader.loadClass(servletClass);
      } catch (ClassNotFoundException e) {
        throw new DeploymentUnitProcessingException(e);
      }
      if (Application.class.isAssignableFrom(clazz)) {
        servlet.setServletClass(HttpServlet30Dispatcher.class.getName());
        servlet.setAsyncSupported(true);
        ParamValueMetaData param = new ParamValueMetaData();
        param.setParamName("javax.ws.rs.Application");
        param.setParamValue(servletClass);
        List<ParamValueMetaData> params = servlet.getInitParam();
        if (params == null) {
          params = new ArrayList<ParamValueMetaData>();
          servlet.setInitParam(params);
        }
        params.add(param);

        return clazz;
      }
    }
    return null;
  }
Пример #3
0
  /**
   * Returns endpoint class name.
   *
   * @param servletMD servlet meta data
   * @return endpoint class name
   */
  public static String getEndpointName(final ServletMetaData servletMD) {
    final String endpointClass = servletMD.getServletClass();

    return endpointClass != null ? endpointClass.trim() : null;
  }
Пример #4
0
 /**
  * Returns endpoint name.
  *
  * @param servletMD servlet meta data
  * @return endpoint name
  */
 public static String getEndpointName(final ServletMetaData servletMD) {
   final String endpointName = servletMD.getName();
   return endpointName != null ? endpointName.trim() : null;
 }