cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1299707 - /cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java
Date Mon, 12 Mar 2012 15:17:47 GMT
Author: ay
Date: Mon Mar 12 15:17:47 2012
New Revision: 1299707

URL: http://svn.apache.org/viewvc?rev=1299707&view=rev
Log:
handle null-EndpointReference in WS-RM Destination and Source for JMX monitor

Modified:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java?rev=1299707&r1=1299706&r2=1299707&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java Mon Mar 12
15:17:47 2012
@@ -39,6 +39,7 @@ import org.apache.cxf.management.annotat
 import org.apache.cxf.management.annotation.ManagedOperationParameter;
 import org.apache.cxf.management.annotation.ManagedOperationParameters;
 import org.apache.cxf.management.annotation.ManagedResource;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.rm.DestinationSequence.DeferredAcknowledgment;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange;
@@ -399,6 +400,13 @@ public class ManagedRMEndpoint implement
         return destination.getSequence(identifier);
     }
 
+    private static String getAddressValue(EndpointReferenceType epr) {
+        if (null != epr && null != epr.getAddress()) {
+            return epr.getAddress().getValue();
+        }
+        return null;
+    }
+    
     private CompositeData getSourceSequenceProperties(SourceSequence ss) throws JMException
{
         if (null == ss) {
             throw new IllegalArgumentException("no sequence");
@@ -407,7 +415,7 @@ public class ManagedRMEndpoint implement
         Object[] ssv = new Object[]{ss.getIdentifier().getValue(), ss.getCurrentMessageNr(),

                                     ss.getExpires(), ss.isLastMessage(),
                                     manager.getRetransmissionQueue().countUnacknowledged(ss),
-                                    ss.getTarget().getAddress().getValue()};
+                                    getAddressValue(ss.getTarget())};
         
         CompositeData ssps = new CompositeDataSupport(sourceSequenceType, 
                                                       SOURCE_SEQUENCE_NAMES, ssv);
@@ -420,7 +428,7 @@ public class ManagedRMEndpoint implement
         }
         Object[] dsv = new Object[]{ds.getIdentifier().getValue(), ds.getLastMessageNumber(),

                                     ds.getCorrelationID(),
-                                    ds.getAcksTo().getAddress().getValue()};
+                                    getAddressValue(ds.getAcksTo())};
         
         CompositeData dsps = new CompositeDataSupport(destinationSequenceType, 
                                                       DESTINATION_SEQUENCE_NAMES, dsv);



Mime
View raw message