Author: jim.ma
Date: 2014-06-21 21:24:54 -0400 (Sat, 21 Jun 2014)
New Revision: 18756
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml
container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
Log:
[JBWS-3733]:Add endpointMetrics in EndpointService
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java 2014-06-22
01:24:38 UTC (rev 18755)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java 2014-06-22
01:24:54 UTC (rev 18756)
@@ -81,7 +81,7 @@
ROOT_LOGGER.skippingAnnotationProcessing(unit.getName());
} else {
for (final DotName dotName : dotNames) {
- final List<AnnotationInstance> wsAnnotations =
index.getAnnotations(dotName);
+ /*final List<AnnotationInstance> wsAnnotations =
index.getAnnotations(dotName);
if (!wsAnnotations.isEmpty()) {
for (final AnnotationInstance wsAnnotation : wsAnnotations) {
final AnnotationTarget target = wsAnnotation.target();
@@ -92,7 +92,22 @@
}
}
}
- }
+ }*/
+ processAnnotations(unit, dotName, index);
+
+ if (unit.getParent() != null &&
DeploymentTypeMarker.isType(DeploymentType.EAR,
+ unit.getParent())) {
+ final CompositeIndex parentIndex = unit.getParent()
+ .getAttachment(
+ Attachments.COMPOSITE_ANNOTATION_INDEX);
+
+ if (parentIndex != null) {
+
+ processAnnotations(unit, dotName, parentIndex);
+
+ }
+
+ }
}
}
}
@@ -103,7 +118,33 @@
}
protected abstract void processAnnotation(final DeploymentUnit unit, final ClassInfo
classInfo, final AnnotationInstance wsAnnotation, final CompositeIndex compositeIndex)
throws DeploymentUnitProcessingException;
+
+ private void processAnnotations(final DeploymentUnit unit, final DotName dotName,
final CompositeIndex index)
+ throws DeploymentUnitProcessingException {
+ final List<AnnotationInstance> wsAnnotations =
index.getAnnotations(dotName);
+
+ if (!wsAnnotations.isEmpty()) {
+
+ for (final AnnotationInstance wsAnnotation : wsAnnotations) {
+
+ final AnnotationTarget target = wsAnnotation.target();
+
+ if (target instanceof ClassInfo) {
+
+ final ClassInfo classInfo = (ClassInfo) target;
+
+ if (isJaxwsEndpoint(classInfo, index)) {
+
+ processAnnotation(unit, classInfo, wsAnnotation, index);
+
+ }
+
+ }
+
+ }
+ }
+ }
static ComponentDescription createComponentDescription(final DeploymentUnit unit,
final String componentName, final String componentClassName, final String
dependsOnEndpointClassName) {
final EEModuleDescription moduleDescription = getRequiredAttachment(unit,
EE_MODULE_DESCRIPTION);
// JBoss WEB processors may install fake components for WS endpoints - removing
them forcibly
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java 2014-06-22
01:24:38 UTC (rev 18755)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java 2014-06-22
01:24:54 UTC (rev 18756)
@@ -35,6 +35,9 @@
import java.util.List;
import org.jboss.as.ee.component.ComponentDescription;
+import org.jboss.as.ee.structure.DeploymentType;
+import org.jboss.as.ee.structure.DeploymentTypeMarker;
+import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.annotation.CompositeIndex;
@@ -89,14 +92,25 @@
jaxwsDeployment.addEndpoint(new POJOEndpoint(endpointName,
endpointClassName, pojoViewName, urlPattern));
}
}
- if (!found) {
- // JSR 109, version 1.3 final spec, section 5.3.2.1 javax.jws.WebService
annotation
- final ComponentDescription pojoComponent =
createComponentDescription(unit, endpointClassName, endpointClassName,
endpointClassName);
- final ServiceName pojoViewName = registerView(pojoComponent,
endpointClassName);
- // register POJO endpoint
- final String urlPattern = getUrlPattern(classInfo);
- jaxwsDeployment.addEndpoint(new POJOEndpoint(endpointClassName,
pojoViewName, urlPattern));
- }
+ DeploymentUnit parentUnit = unit.getParent();
+
+ boolean isEarIndex = parentUnit != null &&
DeploymentTypeMarker.isType(DeploymentType.EAR, parentUnit)
+ && parentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX) ==
compositeIndex;
+
+ if (!found && !isEarIndex) {
+
+ // JSR 109, version 1.3 final spec, section 5.3.2.1
+ // javax.jws.WebService annotation
+ final ComponentDescription pojoComponent = createComponentDescription(
+ unit, endpointClassName, endpointClassName,
+ endpointClassName);
+ final ServiceName pojoViewName = registerView(pojoComponent,
+ endpointClassName);
+ // register POJO endpoint
+ final String urlPattern = getUrlPattern(classInfo);
+ jaxwsDeployment.addEndpoint(new POJOEndpoint(endpointClassName,
+ pojoViewName, urlPattern));
+ }
}
}
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2014-06-22
01:24:38 UTC (rev 18755)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2014-06-22
01:24:54 UTC (rev 18756)
@@ -63,9 +63,11 @@
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.ws.common.management.ManagedEndpoint;
import org.jboss.ws.common.monitoring.ManagedRecordProcessor;
+import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.management.EndpointMetricsFactory;
import org.jboss.wsf.spi.security.EJBMethodSecurityAttributeProvider;
/**
@@ -114,6 +116,8 @@
for (final RecordProcessor processor : processors) {
registerRecordProcessor(processor, endpoint);
}
+ final EndpointMetricsFactory factory =
SPIProvider.getInstance().getSPI(EndpointMetricsFactory.class);
+ endpoint.setEndpointMetrics(factory.newEndpointMetrics());
registerEndpoint(endpoint);
endpoint.getLifecycleHandler().start(endpoint);
}
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml 2014-06-22
01:24:38 UTC (rev 18755)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml 2014-06-22
01:24:54 UTC (rev 18756)
@@ -48,10 +48,6 @@
<property name="last"
class="boolean">true</property>
</deploymentAspect>
- <deploymentAspect
class="org.jboss.ws.common.deployment.EndpointMetricsDeploymentAspect">
- <property name="provides"
class="java.lang.String">EndpointMetrics</property>
- </deploymentAspect>
-
<deploymentAspect
class="org.jboss.ws.common.deployment.EndpointNameDeploymentAspect">
<property name="requires"
class="java.lang.String">URLPattern</property>
<property name="provides"
class="java.lang.String">EndpointName</property>
Modified:
container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2014-06-22
01:24:38 UTC (rev 18755)
+++
container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2014-06-22
01:24:54 UTC (rev 18756)
@@ -442,6 +442,7 @@
} else {
throw new Exception("Operation not successful; outcome = " +
result.get(OUTCOME));
}
+
}
private static CallbackHandler getCallbackHandler() {