Author: asoldano
Date: 2014-10-17 09:44:18 -0400 (Fri, 17 Oct 2014)
New Revision: 19012
Modified:
container/wildfly81/branches/jbossws-wildfly810-4.3.x/
container/wildfly81/branches/jbossws-wildfly810-4.3.x/pom.xml
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
Log:
[JBWS-3838] Sort UnifiedHandlerMetaData instances before adding to the chain
Property changes on: container/wildfly81/branches/jbossws-wildfly810-4.3.x
___________________________________________________________________
Modified: svn:mergeinfo
- /container/wildfly81/branches/jbossws-wildfly810:18650-18651,18859
+ /container/wildfly81/branches/jbossws-wildfly810:18650-18651,18859,19010
Modified: container/wildfly81/branches/jbossws-wildfly810-4.3.x/pom.xml
===================================================================
--- container/wildfly81/branches/jbossws-wildfly810-4.3.x/pom.xml 2014-10-17 13:40:59 UTC
(rev 19011)
+++ container/wildfly81/branches/jbossws-wildfly810-4.3.x/pom.xml 2014-10-17 13:44:18 UTC
(rev 19012)
@@ -51,7 +51,7 @@
<properties>
<jbossws.api.version>1.0.2.Final</jbossws.api.version>
- <jbossws.spi.version>2.3.0.Final</jbossws.spi.version>
+ <jbossws.spi.version>2.3.1-SNAPSHOT</jbossws.spi.version>
<jbossws.common.version>2.3.1.Final</jbossws.common.version>
<jboss.msc.version>1.2.2.Final</jboss.msc.version>
<wildfly.version>8.1.0.Final</wildfly.version>
Modified:
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2014-10-17
13:40:59 UTC (rev 19011)
+++
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2014-10-17
13:44:18 UTC (rev 19012)
@@ -29,6 +29,7 @@
import static org.jboss.as.webservices.dmr.PackageUtils.getHandlerServiceName;
import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.as.controller.AbstractAddStepHandler;
import org.jboss.as.controller.OperationContext;
@@ -51,6 +52,7 @@
final class HandlerAdd extends AbstractAddStepHandler {
static final HandlerAdd INSTANCE = new HandlerAdd();
+ static final AtomicInteger counter = new AtomicInteger(0);
private HandlerAdd() {
// forbidden instantiation
@@ -77,7 +79,7 @@
final String handlerName = address.getElement(address.size() -
1).getValue();
final String handlerClass = operation.require(CLASS).asString();
- final HandlerService service = new HandlerService(handlerName,
handlerClass);
+ final HandlerService service = new HandlerService(handlerName, handlerClass,
counter.incrementAndGet());
final ServiceTarget target = context.getServiceTarget();
final ServiceName configServiceName = getConfigServiceName(configType,
configName);
final ServiceRegistry registry = context.getServiceRegistry(false);
Modified:
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2014-10-17
13:40:59 UTC (rev 19011)
+++
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2014-10-17
13:44:18 UTC (rev 19012)
@@ -24,6 +24,8 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import org.jboss.as.webservices.dmr.ListInjector;
@@ -63,6 +65,15 @@
@Override
public void start(final StartContext context) throws StartException {
+ Comparator<UnifiedHandlerMetaData> c = new
Comparator<UnifiedHandlerMetaData>() {
+ @Override
+ public int compare(UnifiedHandlerMetaData o1, UnifiedHandlerMetaData o2) {
+ return o1.getId().compareTo(o2.getId());
+ }
+ };
+ synchronized (handlers) {
+ Collections.sort(handlers, c);
+ }
handlerChain = new UnifiedHandlerChainMetaData(null, null, protocolBindings,
handlers, false, handlerChainId);
}
Modified:
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2014-10-17
13:40:59 UTC (rev 19011)
+++
container/wildfly81/branches/jbossws-wildfly810-4.3.x/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2014-10-17
13:44:18 UTC (rev 19012)
@@ -36,11 +36,13 @@
private final String handlerName;
private final String handlerClass;
+ private final int counter;
private volatile UnifiedHandlerMetaData handler;
- public HandlerService(String handlerName, String handlerClass) {
+ public HandlerService(String handlerName, String handlerClass, int counter) {
this.handlerName = handlerName;
this.handlerClass = handlerClass;
+ this.counter = counter;
}
@Override
@@ -50,7 +52,7 @@
@Override
public void start(final StartContext context) throws StartException {
- handler = new UnifiedHandlerMetaData(handlerClass, handlerName, null, null, null,
null);
+ handler = new UnifiedHandlerMetaData(handlerClass, handlerName, null, null, null,
null, String.valueOf(counter));
}
@Override