You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by ct...@apache.org on 2009/01/28 15:10:31 UTC
svn commit: r738492 - in
/webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl:
Messages.properties SimpleComponentAddress.java
Author: ctwiner
Date: Wed Jan 28 14:10:31 2009
New Revision: 738492
URL: http://svn.apache.org/viewvc?rev=738492&view=rev
Log:
MUSE-298
Modified:
webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/Messages.properties
webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/SimpleComponentAddress.java
Modified: webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/Messages.properties
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/Messages.properties?rev=738492&r1=738491&r2=738492&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/Messages.properties (original)
+++ webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/Messages.properties Wed Jan 28 14:10:31 2009
@@ -5,3 +5,5 @@
PriorityOutOfBounds=The situation priority value is XXX, which is out-of-bounds. The lowest possible value is XXX, the highest is XXX.
SeverityOutOfBounds=The situation priority value is XXX, which is out-of-bounds. Use the Situation.*_SEVERITY fields to set a proper severity value for the situation.
InvalidDisposition=The situation disposition value is XXX, which is not valid - the only possible values are 'Unsuccessful' and 'Successful'.
+NoAddressChild=The WEF ComponentAddress does not have a child element. This should be an EPR.
+
\ No newline at end of file
Modified: webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/SimpleComponentAddress.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/SimpleComponentAddress.java?rev=738492&r1=738491&r2=738492&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/SimpleComponentAddress.java (original)
+++ webservices/muse/trunk/modules/muse-wsdm-wef-impl/src/org/apache/muse/ws/dm/muws/events/impl/SimpleComponentAddress.java Wed Jan 28 14:10:31 2009
@@ -20,9 +20,13 @@
package org.apache.muse.ws.dm.muws.events.impl;
+import javax.xml.namespace.QName;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
import org.apache.muse.util.xml.XmlUtils;
import org.apache.muse.ws.dm.muws.events.ComponentAddress;
import org.apache.muse.ws.dm.muws.events.WefConstants;
@@ -37,15 +41,32 @@
extends AbstractExtendedElements implements ComponentAddress
{
private Element _contents = null;
-
+ //
+ // used to lookup all exception messages
+ //
+ private static Messages _MESSAGES = MessagesFactory.get(SimpleComponentAddress.class);
+
public SimpleComponentAddress()
{
- this(null);
}
public SimpleComponentAddress(Element contents)
{
- _contents = contents;
+ if (contents != null) {
+ // don't keep the wrapping element.
+ QName qn = XmlUtils.getElementQName(contents);
+
+ if (qn.equals(WefConstants.COMP_ADDRESS_QNAME)){
+ Element el = XmlUtils.getFirstElement( contents );
+ if (el == null) {
+ throw new RuntimeException(_MESSAGES.get("NoAddressChild"));
+ } else {
+ _contents = el;
+ }
+ } else {
+ _contents = contents;
+ }
+ }
}
public Element toXML()