Exemple #1
0
  // This is not mandated by the spec. It is for WSIT.
  // We will also scan any servlets/filters/listeners classes specified
  // in web.xml additionally if those classes are not resided in the wars.
  private void scanXmlDefinedClassesIfNecessary(WebBundleDescriptor webBundleDesc)
      throws IOException {

    ClassLoader commonCL = clh.getCommonClassLoader();

    for (Iterator webComponents = webBundleDesc.getWebComponentDescriptors().iterator();
        webComponents.hasNext(); ) {
      WebComponentDescriptor webCompDesc = (WebComponentDescriptor) webComponents.next();
      if (webCompDesc.isServlet()) {
        String servletName = webCompDesc.getWebComponentImplementation();
        if (isScan(servletName, commonCL)) {
          addScanClassName(servletName);
        }
      }
    }

    Vector servletFilters = webBundleDesc.getServletFilters();
    for (int i = 0; i < servletFilters.size(); i++) {
      ServletFilter filter = (ServletFilter) servletFilters.elementAt(i);
      String filterName = filter.getClassName();
      if (isScan(filterName, commonCL)) {
        addScanClassName(filter.getClassName());
      }
    }

    Vector listeners = webBundleDesc.getAppListenerDescriptors();
    for (int j = 0; j < listeners.size(); j++) {
      AppListenerDescriptor listenerDesc = (AppListenerDescriptor) listeners.elementAt(j);
      String listenerName = listenerDesc.getListener();
      if (isScan(listenerName, commonCL)) {
        addScanClassName(listenerDesc.getListener());
      }
    }
  }
 void setServletName(Set webComponentDescriptors) {
   Iterator it = webComponentDescriptors.iterator();
   String endpointName = null;
   while (it.hasNext()) {
     WebComponentDescriptor desc = (WebComponentDescriptor) it.next();
     String name = desc.getCanonicalName();
     if (JAXWS_SERVLET.equals(desc.getWebComponentImplementation())) {
       endpointName = name;
     }
     if (desc.getSecurityRoleReferences().hasMoreElements()) {
       servletName = name;
       break;
     }
   }
   if (servletName == null) {
     servletName = endpointName;
   }
 }
 public WebComponentContext(WebComponentDescriptor wComp) {
   setDescriptor(wComp);
   if (wComp.isServlet()) {
     componentClassName = wComp.getWebComponentImplementation();
   }
 }