use of org.eclipse.scout.jaxws.apt.internal.EntryPointDefinition in project scout.rt by eclipse.
the class JaxWsAnnotationProcessor method generateEntryPoints.
/**
* Generates an <em>entry point port type</em> for all declared {@link WebServiceEntryPoint} annotations.
*/
protected void generateEntryPoints(final RoundEnvironment roundEnv) {
// Collect endpoint interfaces.
final Set<String> endpointInterfaceNames = collectEndpointInterfaceNames(roundEnv);
// Collect 'entryPointDefinitions' to generate entry point port types.
for (final Element _element : roundEnv.getElementsAnnotatedWith(WebServiceEntryPoint.class)) {
final TypeElement _entryPointDefinition = (TypeElement) _element;
String endpointInterfaceName = null;
try {
final AnnotationMirror _entryPointAnnotationMirror = AnnotationUtil.findAnnotationMirror(WebServiceEntryPoint.class.getName(), _entryPointDefinition);
// Resolve and validate the endpoint interface.
final TypeElement _endpointInterface = AnnotationUtil.getTypeElement(_entryPointAnnotationMirror, "endpointInterface", processingEnv.getElementUtils(), processingEnv.getTypeUtils());
Assertions.assertNotNull(_endpointInterface, "Failed to resolve endpoint interface [entryPointDefinition={}]", _entryPointDefinition.getQualifiedName().toString());
endpointInterfaceName = _endpointInterface.getQualifiedName().toString();
Assertions.assertNotNull(_endpointInterface.getAnnotation(WebService.class), "Invalid endpoint interface. Must be annoated with {} annotation [entryPointDefinition={}, endpointInterface={}]", WebService.class.getSimpleName(), _entryPointDefinition.getQualifiedName().toString(), endpointInterfaceName);
// Mark endpoint interface as processed.
endpointInterfaceNames.remove(endpointInterfaceName);
final EntryPointDefinition entryPointDefinition = new EntryPointDefinition((TypeElement) _entryPointDefinition, _endpointInterface, processingEnv);
if (entryPointDefinition.isIgnore()) {
m_logger.info("Ignore entry point definition for endpoint interface '{}' [entryPoint={}, wsdl:portType={}, wsdl:service={}, wsdl:port={}]", endpointInterfaceName, entryPointDefinition.getEntryPointQualifiedName(), entryPointDefinition.getPortTypeName(), entryPointDefinition.getServiceName(), entryPointDefinition.getPortName());
} else {
m_logger.info("Generate entry point for endpoint interface '{}' [entryPoint={}, wsdl:portType={}, wsdl:service={}, wsdl:port={}]", endpointInterfaceName, entryPointDefinition.getEntryPointQualifiedName(), entryPointDefinition.getPortTypeName(), entryPointDefinition.getServiceName(), entryPointDefinition.getPortName());
generateEntryPoint(entryPointDefinition, roundEnv);
}
} catch (final Exception e) {
m_logger.error("Failed to generate entry point for endpoint interface '{}' [entryPointDefinition={}]", endpointInterfaceName, _entryPointDefinition.getQualifiedName().toString(), e);
}
}
// Log endpoint interfaces for which no entry point was generated.
for (final String endpointInterfaceName : endpointInterfaceNames) {
m_logger.info("Skipped entry point generation for endpoint interface '{}' because not configured with {} annotation.", endpointInterfaceName, WebServiceEntryPoint.class.getSimpleName());
}
}
Aggregations