}
Map<QName, JavaModel> map = CastUtils.cast((Map)penv.get(WSDLToJavaProcessor.MODEL_MAP));
for (JavaModel javaModel : map.values()) {
ClassCollector collector = penv.get(ClassCollector.class);
Map<String, JavaServiceClass> serviceClasses = javaModel.getServiceClasses();
if (serviceClasses.size() == 0) {
ServiceInfo serviceInfo = (ServiceInfo)env.get(ServiceInfo.class);
String wsdl = serviceInfo.getDescription().getBaseURI();
Message msg = new Message("CAN_NOT_GEN_SERVICE", LOG, wsdl);
if (penv.isVerbose()) {
System.out.println(msg.toString());
}
return;
}
for (JavaServiceClass js : serviceClasses.values()) {
if (js.getHandlerChains() != null) {
HandlerConfigGenerator handlerGen = new HandlerConfigGenerator();
handlerGen.setJavaInterface(js);
handlerGen.generate(getEnvironment());
JAnnotation annot = handlerGen.getHandlerAnnotation();
if (handlerGen.getHandlerAnnotation() != null) {
boolean existHandlerAnno = false;
for (JAnnotation jann : js.getAnnotations()) {
if (jann.getType() == HandlerChain.class) {
existHandlerAnno = true;
}
}
if (!existHandlerAnno) {
js.addAnnotation(annot);
js.addImport("javax.jws.HandlerChain");
}
}
}
for (JavaPort port : js.getPorts()) {
if (!port.getPackageName().equals(js.getPackageName())
&& !port.getInterfaceClass().equals(js.getName())) {
js.addImport(port.getFullClassName());
}
}
String url = (String)env.get(ToolConstants.CFG_WSDLURL);
String location = (String)env.get(ToolConstants.CFG_WSDLLOCATION);
if (location == null) {
location = url;
}
String serviceSuperclass = "Service";
for (String s : collector.getGeneratedFileInfo()) {
if (s.equals(js.getPackageName() + ".Service")) {
serviceSuperclass = "javax.xml.ws.Service";
}
}
clearAttributes();