WebBundleDescriptor webBundle = (WebBundleDescriptor) bundleDesc;
if(endpoint.getWebComponentLink() == null) {
endpoint.setWebComponentLink(portComponentName);
}
if(endpoint.getWebComponentImpl() == null) {
WebComponentDescriptor webComponent = (WebComponentDescriptor) webBundle.
getWebComponentByCanonicalName(endpoint.getWebComponentLink());
if (webComponent == null) {
//GLASSFISH-3297
WebComponentDescriptor[] wcs = webBundle.getWebComponentByImplName(((Class) annElem).getCanonicalName());
if (wcs.length > 0) {
webComponent = wcs[0];
}
}
// if servlet is not known, we should add it now
if (webComponent == null) {
webComponent = new WebComponentDescriptorImpl();
webComponent.setServlet(true);
webComponent.setWebComponentImplementation(((Class) annElem).getCanonicalName());
webComponent.setName(endpoint.getEndpointName());
webComponent.addUrlPattern("/"+newWS.getName());
webBundle.addWebComponentDescriptor(webComponent);
}
endpoint.setWebComponentImpl(webComponent);
}
} else {