Author: asoldano
Date: 2014-05-14 07:01:01 -0400 (Wed, 14 May 2014)
New Revision: 18643
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXRPC_EJB.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefAnnotationProcessor.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
Log:
[JBWS-3793] Changes to use latest jbossws-spi
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java 2014-05-14
11:00:15 UTC (rev 18642)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java 2014-05-14
11:01:01 UTC (rev 18643)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -51,12 +51,12 @@
*/
final EJBArchiveMetaData create(final Deployment dep) {
ROOT_LOGGER.creatingEjbDeployment(dep.getSimpleName());
- final EJBArchiveMetaData ejbArchiveMD = new EJBArchiveMetaData();
+ final EJBArchiveMetaData.Builder ejbArchiveMDBuilder = new
EJBArchiveMetaData.Builder();
- this.buildEnterpriseBeansMetaData(dep, ejbArchiveMD);
- this.buildWebservicesMetaData(dep, ejbArchiveMD);
+ this.buildEnterpriseBeansMetaData(dep, ejbArchiveMDBuilder);
+ this.buildWebservicesMetaData(dep, ejbArchiveMDBuilder);
- return ejbArchiveMD;
+ return ejbArchiveMDBuilder.build();
}
/**
@@ -67,7 +67,7 @@
* @param ejbMetaData
* universal EJB meta data model
*/
- protected abstract void buildEnterpriseBeansMetaData(Deployment dep,
EJBArchiveMetaData ejbMetaData);
+ protected abstract void buildEnterpriseBeansMetaData(Deployment dep,
EJBArchiveMetaData.Builder ejbMetaDataBuilder);
/**
* Builds webservices meta data. This methods sets:
@@ -81,7 +81,7 @@
* @param dep webservice deployment
* @param ejbArchiveMD universal EJB meta data model
*/
- private void buildWebservicesMetaData(final Deployment dep, final EJBArchiveMetaData
ejbArchiveMD)
+ private void buildWebservicesMetaData(final Deployment dep, final
EJBArchiveMetaData.Builder ejbArchiveMDBuilder)
{
final JBossWebservicesMetaData webservicesMD = WSHelper.getOptionalAttachment(dep,
JBossWebservicesMetaData.class);
@@ -89,23 +89,23 @@
// set context root
final String contextRoot = webservicesMD.getContextRoot();
- ejbArchiveMD.setWebServiceContextRoot(contextRoot);
+ ejbArchiveMDBuilder.setWebServiceContextRoot(contextRoot);
ROOT_LOGGER.settingContextRoot(contextRoot);
// set config name
final String configName = webservicesMD.getConfigName();
- ejbArchiveMD.setConfigName(configName);
+ ejbArchiveMDBuilder.setConfigName(configName);
ROOT_LOGGER.settingConfigName(configName);
// set config file
final String configFile = webservicesMD.getConfigFile();
- ejbArchiveMD.setConfigFile(configFile);
+ ejbArchiveMDBuilder.setConfigFile(configFile);
ROOT_LOGGER.settingConfigFile(configFile);
// set wsdl location resolver
final JBossWebserviceDescriptionMetaData[] wsDescriptionsMD =
webservicesMD.getWebserviceDescriptions();
final PublishLocationAdapter resolver = new
PublishLocationAdapterImpl(wsDescriptionsMD);
- ejbArchiveMD.setPublishLocationAdapter(resolver);
+ ejbArchiveMDBuilder.setPublishLocationAdapter(resolver);
}
protected JBossPortComponentMetaData getPortComponent(final String ejbName, final
JBossWebservicesMetaData jbossWebservicesMD) {
@@ -125,37 +125,29 @@
* jboss agnostic EJBs meta data
*/
protected void buildEnterpriseBeanMetaData(final List<EJBMetaData> wsEjbsMD,
final EJBEndpoint ejbEndpoint, final JBossWebservicesMetaData jbossWebservicesMD) {
- final EJBMetaData wsEjbMD = new SLSBMetaData();
+ final SLSBMetaData.Builder wsEjbMDBuilder = new SLSBMetaData.Builder();
// set EJB name and class
- wsEjbMD.setEjbName(ejbEndpoint.getName());
- wsEjbMD.setEjbClass(ejbEndpoint.getClassName());
+ wsEjbMDBuilder.setEjbName(ejbEndpoint.getName());
+ wsEjbMDBuilder.setEjbClass(ejbEndpoint.getClassName());
final JBossPortComponentMetaData portComponentMD =
getPortComponent(ejbEndpoint.getName(), jbossWebservicesMD);
if (portComponentMD != null) {
// set port component meta data
- wsEjbMD.setPortComponentName(portComponentMD.getPortComponentName());
- wsEjbMD.setPortComponentURI(portComponentMD.getPortComponentURI());
+ wsEjbMDBuilder.setPortComponentName(portComponentMD.getPortComponentName());
+ wsEjbMDBuilder.setPortComponentURI(portComponentMD.getPortComponentURI());
}
// set security meta data
- buildSecurityMetaData(wsEjbMD, ejbEndpoint, portComponentMD);
-
- wsEjbsMD.add(wsEjbMD);
- }
-
- private static void buildSecurityMetaData(final EJBMetaData wsEjbMD, final
EJBEndpoint ejbEndpoint, final JBossPortComponentMetaData portComponentMD) {
- final EJBSecurityMetaData smd = new EJBSecurityMetaData();
// auth method
final String authMethod = getAuthMethod(ejbEndpoint, portComponentMD);
- smd.setAuthMethod(authMethod);
// transport guarantee
final String transportGuarantee = getTransportGuarantee(ejbEndpoint,
portComponentMD);
- smd.setTransportGuarantee(transportGuarantee);
// secure wsdl access
final boolean secureWsdlAccess = isSecureWsdlAccess(ejbEndpoint,
portComponentMD);
- smd.setSecureWSDLAccess(secureWsdlAccess);
// propagate
- wsEjbMD.setSecurityMetaData(smd);
+ wsEjbMDBuilder.setSecurityMetaData(new EJBSecurityMetaData(authMethod,
transportGuarantee, secureWsdlAccess));
+
+ wsEjbsMD.add(wsEjbMDBuilder.build());
}
private static String getAuthMethod(final EJBEndpoint ejbEndpoint, final
JBossPortComponentMetaData portComponentMD) {
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java 2014-05-14
11:00:15 UTC (rev 18642)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java 2014-05-14
11:01:01 UTC (rev 18643)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -38,13 +38,11 @@
import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
import org.jboss.metadata.web.spec.ServletMappingMetaData;
import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
import org.jboss.ws.common.integration.WSConstants;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
import org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
@@ -72,40 +70,40 @@
final JBossWebMetaData jbossWebMD = WSHelper.getRequiredAttachment(dep,
JBossWebMetaData.class);
final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep,
DeploymentUnit.class);
final List<POJOEndpoint> pojoEndpoints = getPojoEndpoints(unit);
- final JSEArchiveMetaData jseArchiveMD = new JSEArchiveMetaData();
+ final JSEArchiveMetaData.Builder jseArchiveMDBuilder = new
JSEArchiveMetaData.Builder();
// set context root
final String contextRoot = getContextRoot(dep, jbossWebMD);
- jseArchiveMD.setContextRoot(contextRoot);
+ jseArchiveMDBuilder.setContextRoot(contextRoot);
ROOT_LOGGER.settingContextRoot(contextRoot);
// set servlet url patterns mappings
final Map<String, String> servletMappings =
getServletUrlPatternsMappings(jbossWebMD, pojoEndpoints);
- jseArchiveMD.setServletMappings(servletMappings);
+ jseArchiveMDBuilder.setServletMappings(servletMappings);
// set servlet class names mappings
final Map<String, String> servletClassNamesMappings =
getServletClassMappings(jbossWebMD, pojoEndpoints);
- jseArchiveMD.setServletClassNames(servletClassNamesMappings);
+ jseArchiveMDBuilder.setServletClassNames(servletClassNamesMappings);
// set security domain
final String securityDomain = jbossWebMD.getSecurityDomain();
- jseArchiveMD.setSecurityDomain(securityDomain);
+ jseArchiveMDBuilder.setSecurityDomain(securityDomain);
// set wsdl location resolver
final JBossWebservicesMetaData jbossWebservicesMD =
WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
if (jbossWebservicesMD != null) {
final PublishLocationAdapter resolver = new
PublishLocationAdapterImpl(jbossWebservicesMD.getWebserviceDescriptions());
- jseArchiveMD.setPublishLocationAdapter(resolver);
+ jseArchiveMDBuilder.setPublishLocationAdapter(resolver);
}
// set security meta data
final List<JSESecurityMetaData> jseSecurityMDs =
getSecurityMetaData(jbossWebMD.getSecurityConstraints());
- jseArchiveMD.setSecurityMetaData(jseSecurityMDs);
+ jseArchiveMDBuilder.setSecurityMetaData(jseSecurityMDs);
// set config name and file
- setConfigNameAndFile(jseArchiveMD, jbossWebMD, jbossWebservicesMD);
+ setConfigNameAndFile(jseArchiveMDBuilder, jbossWebMD, jbossWebservicesMD);
- return jseArchiveMD;
+ return jseArchiveMDBuilder.build();
}
protected abstract List<POJOEndpoint> getPojoEndpoints(final DeploymentUnit
unit);
@@ -116,14 +114,14 @@
* @param jseArchiveMD universal JSE meta data model
* @param jbossWebMD jboss web meta data
*/
- private void setConfigNameAndFile(final JSEArchiveMetaData jseArchiveMD, final
JBossWebMetaData jbossWebMD, final JBossWebservicesMetaData jbossWebservicesMD) {
+ private void setConfigNameAndFile(final JSEArchiveMetaData.Builder
jseArchiveMDBuilder, final JBossWebMetaData jbossWebMD, final JBossWebservicesMetaData
jbossWebservicesMD) {
if (jbossWebservicesMD != null) {
if (jbossWebservicesMD.getConfigName() != null) {
final String configName = jbossWebservicesMD.getConfigName();
- jseArchiveMD.setConfigName(configName);
+ jseArchiveMDBuilder.setConfigName(configName);
ROOT_LOGGER.settingConfigName(configName);
final String configFile = jbossWebservicesMD.getConfigFile();
- jseArchiveMD.setConfigFile(configFile);
+ jseArchiveMDBuilder.setConfigFile(configFile);
ROOT_LOGGER.settingConfigFile(configFile);
// ensure higher priority against web.xml context parameters
@@ -136,12 +134,12 @@
for (final ParamValueMetaData contextParam : contextParams) {
if (WSConstants.JBOSSWS_CONFIG_NAME.equals(contextParam.getParamName()))
{
final String configName = contextParam.getParamValue();
- jseArchiveMD.setConfigName(configName);
+ jseArchiveMDBuilder.setConfigName(configName);
ROOT_LOGGER.settingConfigName(configName);
}
if (WSConstants.JBOSSWS_CONFIG_FILE.equals(contextParam.getParamName()))
{
final String configFile = contextParam.getParamValue();
- jseArchiveMD.setConfigFile(configFile);
+ jseArchiveMDBuilder.setConfigFile(configFile);
ROOT_LOGGER.settingConfigFile(configFile);
}
}
@@ -159,15 +157,17 @@
if (securityConstraintsMD != null) {
for (final SecurityConstraintMetaData securityConstraintMD :
securityConstraintsMD) {
- final JSESecurityMetaData jseSecurityMD = new JSESecurityMetaData();
+ final JSESecurityMetaData.Builder jseSecurityMDBuilder = new
JSESecurityMetaData.Builder();
// transport guarantee
-
jseSecurityMD.setTransportGuarantee(securityConstraintMD.getTransportGuarantee().name());
-
+
jseSecurityMDBuilder.setTransportGuarantee(securityConstraintMD.getTransportGuarantee().name());
+
// web resources
- this.setWebResources(jseSecurityMD, securityConstraintMD);
+ for (final WebResourceCollectionMetaData webResourceMD :
securityConstraintMD.getResourceCollections()) {
+ jseSecurityMDBuilder.addWebResource(webResourceMD.getName(),
webResourceMD.getUrlPatterns());
+ }
- jseSecurityMDs.add(jseSecurityMD);
+ jseSecurityMDs.add(jseSecurityMDBuilder.build());
}
}
@@ -175,24 +175,6 @@
}
/**
- * Sets web resources in universal meta data model.
- *
- * @param jseSecurityMD universal JSE security meta data model
- * @param securityConstraintMD security constraint meta data
- */
- private void setWebResources(final JSESecurityMetaData jseSecurityMD, final
SecurityConstraintMetaData securityConstraintMD) {
- final WebResourceCollectionsMetaData webResources =
securityConstraintMD.getResourceCollections();
-
- for (final WebResourceCollectionMetaData webResourceMD : webResources) {
- final JSEResourceCollection jseResource =
jseSecurityMD.addWebResource(webResourceMD.getName());
-
- for (final String webResourceUrlPatterns : webResourceMD.getUrlPatterns()) {
- jseResource.addPattern(webResourceUrlPatterns);
- }
- }
- }
-
- /**
* Returns servlet name to url pattern mappings.
*
* @param jbossWebMD jboss web meta data
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXRPC_EJB.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXRPC_EJB.java 2014-05-14
11:00:15 UTC (rev 18642)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXRPC_EJB.java 2014-05-14
11:01:01 UTC (rev 18643)
@@ -39,7 +39,7 @@
final class MetaDataBuilderJAXRPC_EJB extends AbstractMetaDataBuilderEJB {
@Override
- protected void buildEnterpriseBeansMetaData(final Deployment dep, final
EJBArchiveMetaData ejbArchiveMD) {
+ protected void buildEnterpriseBeansMetaData(final Deployment dep, final
EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
final List<EJBMetaData> wsEjbsMD = new LinkedList<EJBMetaData>();
final JBossWebservicesMetaData jbossWebservicesMD =
WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
final JAXRPCDeployment jaxrpcDeployment = WSHelper.getRequiredAttachment(dep,
JAXRPCDeployment.class);
@@ -48,7 +48,7 @@
buildEnterpriseBeanMetaData(wsEjbsMD, ejbEndpoint, jbossWebservicesMD);
}
- ejbArchiveMD.setEnterpriseBeans(wsEjbsMD);
+ ejbArchiveMDBuilder.setEnterpriseBeans(wsEjbsMD);
}
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java 2014-05-14
11:00:15 UTC (rev 18642)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java 2014-05-14
11:01:01 UTC (rev 18643)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -42,14 +42,14 @@
final class MetaDataBuilderJAXWS_EJB extends AbstractMetaDataBuilderEJB {
@Override
- protected void buildEnterpriseBeansMetaData(final Deployment dep, final
EJBArchiveMetaData ejbArchiveMD) {
+ protected void buildEnterpriseBeansMetaData(final Deployment dep, final
EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
if (!WSHelper.isJaxwsJseDeployment(dep)) { // [AS7-1605] support
final JBossWebMetaData jbossWebMD = WSHelper.getOptionalAttachment(dep,
JBossWebMetaData.class);
final String contextRoot = getContextRoot(dep, jbossWebMD);
if (contextRoot != null) {
- final JSEArchiveMetaData jseArchiveMD = new JSEArchiveMetaData();
- jseArchiveMD.setContextRoot(contextRoot);
- dep.addAttachment(JSEArchiveMetaData.class, jseArchiveMD);
+ final JSEArchiveMetaData.Builder jseArchiveMDBuilder = new
JSEArchiveMetaData.Builder();
+ jseArchiveMDBuilder.setContextRoot(contextRoot);
+ dep.addAttachment(JSEArchiveMetaData.class,
jseArchiveMDBuilder.build());
}
}
@@ -61,7 +61,7 @@
buildEnterpriseBeanMetaData(wsEjbsMD, jbossEjbMD, jbossWebservicesMD);
}
- ejbArchiveMD.setEnterpriseBeans(wsEjbsMD);
+ ejbArchiveMDBuilder.setEnterpriseBeans(wsEjbsMD);
}
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefAnnotationProcessor.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefAnnotationProcessor.java 2014-05-14
11:00:15 UTC (rev 18642)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefAnnotationProcessor.java 2014-05-14
11:01:01 UTC (rev 18643)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2014, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -28,7 +28,6 @@
import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_REFS_ANNOTATION;
import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_REF_ANNOTATION;
import static org.jboss.as.webservices.webserviceref.WSRefUtils.processAnnotatedElement;
-import static org.jboss.as.webservices.webserviceref.WSRefUtils.processType;
import java.lang.reflect.AccessibleObject;
import java.util.List;
@@ -63,6 +62,8 @@
import org.jboss.modules.Module;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaDataBuilder;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
/**
* @WebServiceRef annotation processor.
@@ -195,8 +196,10 @@
final String cacheKey = getCacheKey(componentDescription, serviceRefName);
UnifiedServiceRefMetaData serviceRefUMDM = wsRefRegistry.get(cacheKey);
if (serviceRefUMDM == null) {
- serviceRefUMDM = new UnifiedServiceRefMetaData(getUnifiedVirtualFile(unit));
- serviceRefUMDM.setServiceRefName(serviceRefName);
+ UnifiedServiceRefMetaDataBuilder builder = new
UnifiedServiceRefMetaDataBuilder();
+ builder.setVfsRoot(getUnifiedVirtualFile(unit));
+ builder.setServiceRefName(serviceRefName);
+ serviceRefUMDM = builder.build();
wsRefRegistry.add(cacheKey, serviceRefUMDM);
}
return serviceRefUMDM;
@@ -253,7 +256,8 @@
serviceRefUMDM.setServiceInterface(Service.class.getName());
}
// ref type
- processType(serviceRefUMDM);
+// processType(serviceRefUMDM);
+ serviceRefUMDM.setType(ServiceRefType.JAXWS);
return serviceRefUMDM;
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java 2014-05-14
11:00:15 UTC (rev 18642)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java 2014-05-14
11:01:01 UTC (rev 18643)
@@ -82,8 +82,8 @@
private static UnifiedServiceRefMetaData getServiceRef(final DeploymentUnit unit,
final ComponentDescription componentDescription, final ServiceReferenceMetaData
serviceRefMD) throws DeploymentUnitProcessingException {
// construct service ref
- final UnifiedServiceRefMetaData serviceRefUMDM = new
UnifiedServiceRefMetaData(getUnifiedVirtualFile(unit));
- translate(serviceRefMD, serviceRefUMDM);
+ final UnifiedServiceRefMetaData serviceRefUMDM = translate(serviceRefMD);
+ serviceRefUMDM.setVfsRoot(getUnifiedVirtualFile(unit));
processWSFeatures(unit, serviceRefMD.getInjectionTargets(), serviceRefUMDM);
// register it
final WSReferences wsRefRegistry = getWSRefRegistry(unit);
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2014-05-14
11:00:15 UTC (rev 18642)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2014-05-14
11:01:01 UTC (rev 18643)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2014, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -53,12 +53,17 @@
import org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainsMetaData;
import org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData;
import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.AddressingMetadata;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.MTOMMetadata;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.RespectBindingMetadata;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import
org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaDataBuilder;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaDataBuilder;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
import org.jboss.wsf.spi.serviceref.ServiceRefType;
@@ -72,22 +77,22 @@
private WSRefUtils() {
}
- static UnifiedServiceRefMetaData translate(final ServiceReferenceMetaData
serviceRefMD, final UnifiedServiceRefMetaData serviceRefUMDM) {
- serviceRefUMDM.setServiceRefName(serviceRefMD.getName());
- serviceRefUMDM.setServiceRefType(serviceRefMD.getServiceRefType());
- serviceRefUMDM.setServiceInterface(serviceRefMD.getServiceInterface());
- serviceRefUMDM.setWsdlFile(serviceRefMD.getWsdlFile());
- serviceRefUMDM.setMappingFile(serviceRefMD.getJaxrpcMappingFile());
- serviceRefUMDM.setServiceQName(serviceRefMD.getServiceQname());
+ static UnifiedServiceRefMetaData translate(final ServiceReferenceMetaData
serviceRefMD) {
+ UnifiedServiceRefMetaDataBuilder builder = new
UnifiedServiceRefMetaDataBuilder();
+ builder.setServiceRefName(serviceRefMD.getName());
+ builder.setServiceRefType(serviceRefMD.getServiceRefType());
+ builder.setServiceInterface(serviceRefMD.getServiceInterface());
+ builder.setWsdlFile(serviceRefMD.getWsdlFile());
+ builder.setMappingFile(serviceRefMD.getJaxrpcMappingFile());
+ builder.setServiceQName(serviceRefMD.getServiceQname());
// propagate port components
final Collection<? extends PortComponentRef> portComponentsMD =
serviceRefMD.getPortComponentRef();
if (portComponentsMD != null) {
for (final PortComponentRef portComponentMD : portComponentsMD) {
- final UnifiedPortComponentRefMetaData portComponentUMDM =
getUnifiedPortComponentRefMetaData(serviceRefUMDM,
- portComponentMD);
+ final UnifiedPortComponentRefMetaData portComponentUMDM =
getUnifiedPortComponentRefMetaData(portComponentMD);
if (portComponentUMDM.getServiceEndpointInterface() != null ||
portComponentUMDM.getPortQName() != null) {
- serviceRefUMDM.addPortComponentRef(portComponentUMDM);
+ builder.addPortComponentRef(portComponentUMDM);
} else {
ROOT_LOGGER.ignoringPortComponentRef(portComponentUMDM);
}
@@ -99,7 +104,7 @@
if (handlersMD != null) {
for (final ServiceReferenceHandlerMetaData handlerMD : handlersMD) {
final UnifiedHandlerMetaData handlerUMDM =
getUnifiedHandlerMetaData(handlerMD);
- serviceRefUMDM.addHandler(handlerUMDM);
+ builder.addHandler(handlerUMDM);
}
}
@@ -107,82 +112,75 @@
ServiceReferenceHandlerChainsMetaData handlerChainsMD =
serviceRefMD.getHandlerChains();
if (handlerChainsMD != null) {
final UnifiedHandlerChainsMetaData handlerChainsUMDM =
getUnifiedHandlerChainsMetaData(handlerChainsMD);
- serviceRefUMDM.setHandlerChains(handlerChainsUMDM);
+ builder.setHandlerChains(handlerChainsUMDM);
}
// propagate jboss specific MD
if (serviceRefMD instanceof JBossServiceReferenceMetaData) {
- processUnifiedJBossServiceRefMetaData(serviceRefUMDM, serviceRefMD);
+ final JBossServiceReferenceMetaData jbossServiceRefMD =
(JBossServiceReferenceMetaData) serviceRefMD;
+ builder.setServiceImplClass(jbossServiceRefMD.getServiceClass());
+ builder.setConfigName(jbossServiceRefMD.getConfigName());
+ builder.setConfigFile(jbossServiceRefMD.getConfigFile());
+ builder.setWsdlOverride(jbossServiceRefMD.getWsdlOverride());
+ builder.setHandlerChain(jbossServiceRefMD.getHandlerChain());
}
// detect JAXWS or JAXRPC type
- processType(serviceRefUMDM);
+ final boolean isJAXRPC = serviceRefMD.getJaxrpcMappingFile() != null ||
"javax.xml.rpc.Service".equals(serviceRefMD.getServiceInterface());
+ builder.setType(isJAXRPC ? ServiceRefType.JAXRPC : ServiceRefType.JAXWS);
- return serviceRefUMDM;
+ return builder.build();
}
- private static void processUnifiedJBossServiceRefMetaData(final
UnifiedServiceRefMetaData serviceRefUMDM, final ServiceReferenceMetaData serviceRefMD) {
- final JBossServiceReferenceMetaData jbossServiceRefMD =
(JBossServiceReferenceMetaData) serviceRefMD;
- serviceRefUMDM.setServiceImplClass(jbossServiceRefMD.getServiceClass());
- serviceRefUMDM.setConfigName(jbossServiceRefMD.getConfigName());
- serviceRefUMDM.setConfigFile(jbossServiceRefMD.getConfigFile());
- serviceRefUMDM.setWsdlOverride(jbossServiceRefMD.getWsdlOverride());
- serviceRefUMDM.setHandlerChain(jbossServiceRefMD.getHandlerChain());
- }
+ private static UnifiedPortComponentRefMetaData
getUnifiedPortComponentRefMetaData(final PortComponentRef portComponentMD) {
+ final UnifiedPortComponentRefMetaDataBuilder builder = new
UnifiedPortComponentRefMetaDataBuilder();
- private static UnifiedPortComponentRefMetaData
getUnifiedPortComponentRefMetaData(final UnifiedServiceRefMetaData serviceRefUMDM, final
PortComponentRef portComponentMD) {
- final UnifiedPortComponentRefMetaData portComponentUMDM = new
UnifiedPortComponentRefMetaData(serviceRefUMDM);
-
// propagate service endpoint interface
-
portComponentUMDM.setServiceEndpointInterface(portComponentMD.getServiceEndpointInterface());
+
builder.setServiceEndpointInterface(portComponentMD.getServiceEndpointInterface());
// propagate MTOM properties
- portComponentUMDM.setMtomEnabled(portComponentMD.isEnableMtom());
- portComponentUMDM.setMtomThreshold(portComponentMD.getMtomThreshold());
+ builder.setMtomEnabled(portComponentMD.isEnableMtom());
+ builder.setMtomThreshold(portComponentMD.getMtomThreshold());
// propagate addressing properties
final Addressing addressingMD = portComponentMD.getAddressing();
if (addressingMD != null) {
- portComponentUMDM.setAddressingAnnotationSpecified(true);
- portComponentUMDM.setAddressingEnabled(addressingMD.isEnabled());
- portComponentUMDM.setAddressingRequired(addressingMD.isRequired());
- portComponentUMDM.setAddressingResponses(addressingMD.getResponses());
+ builder.setAddressingAnnotationSpecified(true);
+ builder.setAddressingEnabled(addressingMD.isEnabled());
+ builder.setAddressingRequired(addressingMD.isRequired());
+ builder.setAddressingResponses(addressingMD.getResponses());
}
// propagate respect binding properties
if (portComponentMD.getRespectBinding() != null) {
- portComponentUMDM.setRespectBindingAnnotationSpecified(true);
- portComponentUMDM.setRespectBindingEnabled(true);
+ builder.setRespectBindingAnnotationSpecified(true);
+ builder.setRespectBindingEnabled(true);
}
// propagate link
- portComponentUMDM.setPortComponentLink(portComponentMD.getPortComponentLink());
+ builder.setPortComponentLink(portComponentMD.getPortComponentLink());
// propagate jboss specific MD
if (portComponentMD instanceof JBossPortComponentRef) {
- processUnifiedJBossPortComponentRefMetaData(portComponentUMDM,
portComponentMD);
- }
+ final JBossPortComponentRef jbossPortComponentMD = (JBossPortComponentRef)
portComponentMD;
- return portComponentUMDM;
- }
+ // propagate port QName
+ builder.setPortQName(jbossPortComponentMD.getPortQname());
- private static void processUnifiedJBossPortComponentRefMetaData(final
UnifiedPortComponentRefMetaData portComponentUMDM, final PortComponentRef portComponentMD)
{
- final JBossPortComponentRef jbossPortComponentMD = (JBossPortComponentRef)
portComponentMD;
+ // propagate configuration properties
+ builder.setConfigName(jbossPortComponentMD.getConfigName());
+ builder.setConfigFile(jbossPortComponentMD.getConfigFile());
- // propagate port QName
- portComponentUMDM.setPortQName(jbossPortComponentMD.getPortQname());
-
- // propagate configuration properties
- portComponentUMDM.setConfigName(jbossPortComponentMD.getConfigName());
- portComponentUMDM.setConfigFile(jbossPortComponentMD.getConfigFile());
-
- // propagate stub properties
- final List<StubPropertyMetaData> stubPropertiesMD =
jbossPortComponentMD.getStubProperties();
- if (stubPropertiesMD != null) {
- for (final StubPropertyMetaData stubPropertyMD : stubPropertiesMD) {
- portComponentUMDM.addStubProperty(new
UnifiedStubPropertyMetaData(stubPropertyMD.getPropName(),
stubPropertyMD.getPropValue()));
+ // propagate stub properties
+ final List<StubPropertyMetaData> stubPropertiesMD =
jbossPortComponentMD.getStubProperties();
+ if (stubPropertiesMD != null) {
+ for (final StubPropertyMetaData stubPropertyMD : stubPropertiesMD) {
+ builder.addStubProperty(new
UnifiedStubPropertyMetaData(stubPropertyMD.getPropName(),
stubPropertyMD.getPropValue()));
+ }
}
}
+
+ return builder.build();
}
private static UnifiedHandlerMetaData
getUnifiedHandlerMetaData(ServiceReferenceHandlerMetaData srhmd) {
@@ -217,11 +215,6 @@
return new UnifiedHandlerChainsMetaData(uhcmds);
}
- static void processType(final UnifiedServiceRefMetaData serviceRefUMDM) {
- final boolean isJAXRPC = serviceRefUMDM.getMappingFile() != null ||
"javax.xml.rpc.Service".equals(serviceRefUMDM.getServiceInterface());
- serviceRefUMDM.setType(isJAXRPC ? ServiceRefType.JAXRPC : ServiceRefType.JAXWS);
- }
-
static void processAnnotatedElement(final AnnotatedElement anElement, final
UnifiedServiceRefMetaData serviceRefUMDM) {
processAddressingAnnotation(anElement, serviceRefUMDM);
processMTOMAnnotation(anElement, serviceRefUMDM);
@@ -234,10 +227,10 @@
final javax.xml.ws.soap.Addressing addressingAnnotation =
getAnnotation(anElement, javax.xml.ws.soap.Addressing.class);
if (addressingAnnotation != null) {
- serviceRefUMDM.setAddressingAnnotationSpecified(true);
- serviceRefUMDM.setAddressingEnabled(addressingAnnotation.enabled());
- serviceRefUMDM.setAddressingRequired(addressingAnnotation.required());
-
serviceRefUMDM.setAddressingResponses(addressingAnnotation.responses().toString());
+ serviceRefUMDM.setAddressingMedadata(new AddressingMetadata(true,
+ addressingAnnotation.enabled(),
+ addressingAnnotation.required(),
+ addressingAnnotation.responses().toString()));
}
}
@@ -245,9 +238,7 @@
final MTOM mtomAnnotation = getAnnotation(anElement, MTOM.class);
if (mtomAnnotation != null) {
- serviceRefUMDM.setMtomAnnotationSpecified(true);
- serviceRefUMDM.setMtomEnabled(mtomAnnotation.enabled());
- serviceRefUMDM.setMtomThreshold(mtomAnnotation.threshold());
+ serviceRefUMDM.setMTOMMetadata(new MTOMMetadata(true,
mtomAnnotation.enabled(), mtomAnnotation.threshold()));
}
}
@@ -255,8 +246,7 @@
final javax.xml.ws.RespectBinding respectBindingAnnotation =
getAnnotation(anElement, javax.xml.ws.RespectBinding.class);
if (respectBindingAnnotation != null) {
- serviceRefUMDM.setRespectBindingAnnotationSpecified(true);
- serviceRefUMDM.setRespectBindingEnabled(respectBindingAnnotation.enabled());
+ serviceRefUMDM.setRespectBindingMetadata(new RespectBindingMetadata(true,
respectBindingAnnotation.enabled()));
}
}