use of org.jboss.as.webservices.injection.WSEndpointHandlersMapping in project wildfly by wildfly.
the class WSIntegrationProcessorJAXWS_HANDLER method processAnnotation.
@Override
protected void processAnnotation(final DeploymentUnit unit, final EEModuleDescription moduleDescription) throws DeploymentUnitProcessingException {
final WSEndpointHandlersMapping mapping = getOptionalAttachment(unit, WS_ENDPOINT_HANDLERS_MAPPING_KEY);
final VirtualFile root = unit.getAttachment(DEPLOYMENT_ROOT).getRoot();
final JBossWebservicesMetaData jbossWebservicesMD = unit.getAttachment(WSAttachmentKeys.JBOSS_WEBSERVICES_METADATA_KEY);
final CompositeIndex index = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
final boolean war = DeploymentTypeMarker.isType(DeploymentType.WAR, unit);
final JBossWebMetaData jwmd = ASHelper.getJBossWebMetaData(unit);
for (EEModuleClassDescription classDescription : moduleDescription.getClassDescriptions()) {
ClassInfo classInfo = null;
ClassAnnotationInformation<WebService, WebServiceAnnotationInfo> annotationInfo = classDescription.getAnnotationInformation(WebService.class);
if (annotationInfo != null) {
classInfo = (ClassInfo) annotationInfo.getClassLevelAnnotations().get(0).getTarget();
}
final ClassAnnotationInformation<WebServiceProvider, WebServiceProviderAnnotationInfo> providreInfo = classDescription.getAnnotationInformation(WebServiceProvider.class);
if (providreInfo != null) {
classInfo = (ClassInfo) providreInfo.getClassLevelAnnotations().get(0).getTarget();
}
if (classInfo != null && isJaxwsEndpoint(classInfo, index, false)) {
final String endpointClassName = classInfo.name().toString();
final ConfigResolver configResolver = new ConfigResolver(classInfo, jbossWebservicesMD, jwmd, root, war);
final EndpointConfig config = configResolver.resolveEndpointConfig();
if (config != null) {
registerConfigMapping(endpointClassName, config, unit);
}
final Set<String> handlers = getHandlers(endpointClassName, config, configResolver, mapping);
if (!handlers.isEmpty()) {
if (isEjb3(classInfo)) {
for (final EJBEndpoint ejbEndpoint : getJaxwsEjbs(unit)) {
if (endpointClassName.equals(ejbEndpoint.getClassName())) {
for (final String handlerClassName : handlers) {
final String ejbEndpointName = ejbEndpoint.getName();
final String handlerName = ejbEndpointName + "-" + handlerClassName;
final ComponentDescription jaxwsHandlerDescription = createComponentDescription(unit, handlerName, handlerClassName, ejbEndpointName);
propagateNamingContext(jaxwsHandlerDescription, ejbEndpoint);
}
}
}
} else {
for (final POJOEndpoint pojoEndpoint : getJaxwsPojos(unit)) {
if (endpointClassName.equals(pojoEndpoint.getClassName())) {
for (final String handlerClassName : handlers) {
final String pojoEndpointName = pojoEndpoint.getName();
final String handlerName = pojoEndpointName + "-" + handlerClassName;
createComponentDescription(unit, handlerName, handlerClassName, pojoEndpointName);
}
}
}
}
}
}
}
}
use of org.jboss.as.webservices.injection.WSEndpointHandlersMapping in project wildfly by wildfly.
the class XTSHandlerDeploymentProcessor method isAnyOfHandlersRegistered.
private boolean isAnyOfHandlersRegistered(final DeploymentUnit unit, final String endpointClass, final List<String> handlers) {
final WSEndpointHandlersMapping mapping = unit.getAttachment(WSAttachmentKeys.WS_ENDPOINT_HANDLERS_MAPPING_KEY);
if (mapping == null) {
return false;
}
final Set<String> existingHandlers = mapping.getHandlers(endpointClass);
if (existingHandlers == null) {
return false;
}
for (final String handler : handlers) {
if (existingHandlers.contains(handler)) {
return true;
}
}
return false;
}
use of org.jboss.as.webservices.injection.WSEndpointHandlersMapping in project wildfly by wildfly.
the class XTSHandlerDeploymentProcessor method registerHandlersWithAS.
private void registerHandlersWithAS(DeploymentUnit unit, String endpointClass, List<String> handlersToAdd) {
WSEndpointHandlersMapping mapping = unit.getAttachment(WSAttachmentKeys.WS_ENDPOINT_HANDLERS_MAPPING_KEY);
if (mapping == null) {
mapping = new WSEndpointHandlersMapping();
unit.putAttachment(WSAttachmentKeys.WS_ENDPOINT_HANDLERS_MAPPING_KEY, mapping);
}
Set<String> existingHandlers = mapping.getHandlers(endpointClass);
if (existingHandlers == null) {
existingHandlers = new HashSet<String>();
} else {
//Existing collection is an unmodifiableSet
existingHandlers = new HashSet<String>(existingHandlers);
}
for (String handler : handlersToAdd) {
existingHandlers.add(handler);
}
mapping.registerEndpointHandlers(endpointClass, existingHandlers);
}
Aggregations