use of org.jboss.as.webservices.deployers.WebServiceAnnotationInfo in project wildfly by wildfly.
the class ASHelper method isJaxwsEndpoint.
public static boolean isJaxwsEndpoint(final EEModuleClassDescription classDescription, final CompositeIndex index) {
ClassInfo classInfo = null;
WebServiceAnnotationInfo webserviceAnnoationInfo = null;
final ClassAnnotationInformation<WebService, WebServiceAnnotationInfo> classAnnotationInfo = classDescription.getAnnotationInformation(WebService.class);
if (classAnnotationInfo != null && !classAnnotationInfo.getClassLevelAnnotations().isEmpty()) {
webserviceAnnoationInfo = classAnnotationInfo.getClassLevelAnnotations().get(0);
classInfo = (ClassInfo) webserviceAnnoationInfo.getTarget();
}
WebServiceProviderAnnotationInfo webserviceProviderAnnoationInfo = null;
final ClassAnnotationInformation<WebServiceProvider, WebServiceProviderAnnotationInfo> providerAnnotationInfo = classDescription.getAnnotationInformation(WebServiceProvider.class);
if (providerAnnotationInfo != null && !providerAnnotationInfo.getClassLevelAnnotations().isEmpty()) {
webserviceProviderAnnoationInfo = providerAnnotationInfo.getClassLevelAnnotations().get(0);
classInfo = (ClassInfo) webserviceProviderAnnoationInfo.getTarget();
}
if (classInfo == null) {
return false;
}
// assert JAXWS endpoint class flags
final short flags = classInfo.flags();
if (Modifier.isInterface(flags))
return false;
if (Modifier.isAbstract(flags))
return false;
if (!Modifier.isPublic(flags))
return false;
if (isJaxwsService(classInfo, index))
return false;
if (webserviceAnnoationInfo != null && webserviceProviderAnnoationInfo != null) {
WSLogger.ROOT_LOGGER.mutuallyExclusiveAnnotations(classInfo.name().toString());
return false;
}
if (Modifier.isFinal(flags)) {
WSLogger.ROOT_LOGGER.finalEndpointClassDetected(classInfo.name().toString());
return false;
}
return true;
}
Aggregations