Author: richard.opalka(a)jboss.com
Date: 2007-10-17 14:28:41 -0400 (Wed, 17 Oct 2007)
New Revision: 4785
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java
stack/native/branches/ropalka/trunk/src/main/resources/schema/jaxws-config_2_0.xsd
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
Log:
adding WSRM Policy port specific configuration support
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/WSRMPolicyAssertionDeployer.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -79,10 +79,11 @@
EndpointMetaData endpointMD = (EndpointMetaData) extMetaData;
// prepare wsrm metadata
- ReliableMessagingMetaData wsrmMD =
endpointMD.getConfig().getReliableMessaging();
- if (wsrmMD == null)
+ ReliableMessagingMetaData rmMD = endpointMD.getConfig().getRMMetaData();
+ if (rmMD == null)
{
- wsrmMD = new ReliableMessagingMetaData();
+ rmMD = new ReliableMessagingMetaData();
+ endpointMD.getConfig().setRMMetaData(rmMD);
}
// construct new port metadata
@@ -92,13 +93,13 @@
portMD.setDeliveryAssurance(constructDeliveryAssurance(wsrmpAssertions));
// ensure port does not exists yet
- for (PortMetaData pMD : wsrmMD.getPorts())
+ for (PortMetaData pMD : rmMD.getPorts())
{
assert ! pMD.getPortName().equals(portMD.getPortName());
}
// set up port WSRMP metadata
- wsrmMD.getPorts().add(portMD);
+ rmMD.getPorts().add(portMD);
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -76,12 +76,12 @@
features.remove(nameToURI(type));
}
- public void setReliableMessaging(ReliableMessagingMetaData wsrmCfg)
+ public void setRMMetaData(ReliableMessagingMetaData wsrmCfg)
{
this.wsrmCfg = wsrmCfg;
}
- public ReliableMessagingMetaData getReliableMessaging()
+ public ReliableMessagingMetaData getRMMetaData()
{
return this.wsrmCfg;
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -135,7 +135,7 @@
if ("reliable-messaging".equals(localName))
{
ReliableMessagingMetaData wsrmCfg = new ReliableMessagingMetaData();
- commonConfig.setReliableMessaging(wsrmCfg);
+ commonConfig.setRMMetaData(wsrmCfg);
return wsrmCfg;
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -62,6 +62,8 @@
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.config.EndpointFeature;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
+import org.jboss.ws.metadata.wsrm.PortMetaData;
+import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -702,11 +704,57 @@
{
log.debug("Create new config [name=" + getConfigName() +
",file=" + getConfigFile() + "]");
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ List<PortMetaData> rmPortMetaData = backupRMMD();
config = factory.getConfig(getRootFile(), getConfigName(), getConfigFile());
+ propagateRMMD(rmPortMetaData);
reconfigHandlerMetaData();
}
+
+ private List<PortMetaData> backupRMMD()
+ {
+ if ((config != null) && (config.getRMMetaData() != null))
+ return config.getRMMetaData().getPorts();
+ return null;
+ }
+
+ private void propagateRMMD(List<PortMetaData> backedUpMD)
+ {
+ if ((backedUpMD != null) && (backedUpMD.size() > 0))
+ {
+ if (config.getRMMetaData() == null)
+ {
+ config.setRMMetaData(new ReliableMessagingMetaData());
+ config.getRMMetaData().getPorts().addAll(backedUpMD);
+ }
+ else
+ {
+ // RM policy specified in config file will be always used
+ List<PortMetaData> ports = config.getRMMetaData().getPorts();
+ for (PortMetaData portMD : backedUpMD)
+ {
+ QName portName = portMD.getPortName();
+ if (!contains(ports, portName))
+ {
+ ports.add(portMD);
+ }
+ }
+ }
+ }
+ }
+
+ private boolean contains(List<PortMetaData> ports, QName portName)
+ {
+ for (PortMetaData pMD : ports)
+ {
+ if (pMD.getPortName().equals(portName))
+ return true;
+ }
+
+ return false;
+ }
+
private void reconfigHandlerMetaData()
{
log.debug("Configure EndpointMetaData");
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/DeliveryAssuranceMetaData.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -62,5 +62,5 @@
{
return "inOrder=\"" + this.inOrder + "\",
quality=\"" + this.quality + "\"";
}
-
+
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/PortMetaData.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -64,5 +64,5 @@
{
return "portName=\"" + this.portName + "\",
deliveryAssurance={" + this.deliveryAssurance + "}";
}
-
+
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/metadata/wsrm/ReliableMessagingMetaData.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -21,9 +21,11 @@
*/
package org.jboss.ws.metadata.wsrm;
+import java.util.List;
import java.util.LinkedList;
-import java.util.List;
+import javax.xml.namespace.QName;
+
/**
* Reliable messaging configuration metadata
*
Modified:
stack/native/branches/ropalka/trunk/src/main/resources/schema/jaxws-config_2_0.xsd
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2007-10-17
18:28:41 UTC (rev 4785)
@@ -163,11 +163,11 @@
<xsd:annotation>
<xsd:documentation>
This WSDL port specific WS-RM delivery assurance configuration
- applies to all operations on this port.
+ applies to all its operations.
This configuration always overrides the global configuration.
- If there is the WS-Policy with attached WS-RM assertion in WSDL
+ If there is a WS-Policy with attached WS-RM assertion in WSDL
associated with this port or its associated binding it
- will always override this port specific configuration.
+ will be always overriden this port specific configuration.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2007-10-17
18:28:41 UTC (rev 4785)
@@ -137,7 +137,7 @@
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURL());
EndpointConfigJAXWS epConfig =
(EndpointConfigJAXWS)config.getConfigByName("Standard WSRM Endpoint");
- ReliableMessagingMetaData wsrmConfig = epConfig.getReliableMessaging();
+ ReliableMessagingMetaData wsrmConfig = epConfig.getRMMetaData();
assertNotNull(wsrmConfig);
DeliveryAssuranceMetaData deliveryAssurance = wsrmConfig.getDeliveryAssurance();
assertEquals(deliveryAssurance.getInOrder(), "true");
Modified:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml 2007-10-17
13:00:58 UTC (rev 4784)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/META-INF/wsrm-jaxws-client-config.xml 2007-10-17
18:28:41 UTC (rev 4785)
@@ -11,14 +11,9 @@
<reliable-messaging>
<delivery-assurance inOrder="true"
quality="AtLeastOnce"/>
<provider
specVersion="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
- <message-store
- id="wsrmStoreId"
- class="custom.MessageStoreImpl">
+ <message-store id="wsrmStoreId"
class="custom.MessageStoreImpl">
<config-file>META-INF/config.xml</config-file>
</message-store>
- <port name="{http://org.jboss.ws/jaxws/wsrm}ReqResPort">
- <delivery-assurance inOrder="false"
quality="AtMostOnce"/>
- </port>
</reliable-messaging>
</client-config>