cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r535269 - in /incubator/cxf/trunk/rt/ws/rm/src: main/java/org/apache/cxf/ws/rm/ test/java/org/apache/cxf/ws/rm/
Date Fri, 04 May 2007 14:47:47 GMT
Author: andreasmyth
Date: Fri May  4 07:47:45 2007
New Revision: 535269

URL: http://svn.apache.org/viewvc?view=rev&rev=535269
Log:
Removed catching of IOExceptions from RM code (remnants from Celtix Objectweb architecture).

Propagate exceptions thrown during sending of RM protocol messages where possible, i.e. in
the context of processing an application (or another RM protocol) message, log as SEVERE otherwise
(i.e. in tasks run by the endpoint's executor).

Modified:
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java Fri May
 4 07:47:45 2007
@@ -19,14 +19,10 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
@@ -34,8 +30,6 @@
 
 public class Destination extends AbstractEndpoint {
 
-    private static final Logger LOG = LogUtils.getL7dLogger(Destination.class);
-
     private Map<String, DestinationSequence> map;
 
     Destination(RMEndpoint reliableEndpoint) {
@@ -116,13 +110,8 @@
                     replyToAddress = maps.getReplyTo().getAddress().getValue();
                 }
                 if (!(seq.getAcksTo().getAddress().getValue().equals(replyToAddress) || seq
-                    .canPiggybackAckOnPartialResponse())) {
-                    try {
-                        getReliableEndpoint().getProxy().acknowledge(seq);
-                    } catch (IOException ex) {
-                        LogUtils.log(LOG, Level.SEVERE, "SEQ_ACK_SEND_EXC", ex, seq);
-                        // TODO
-                    }
+                    .canPiggybackAckOnPartialResponse())) {                    
+                    getReliableEndpoint().getProxy().acknowledge(seq);                  
 
                 }
             }
         } else {

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
Fri May  4 07:47:45 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigInteger;
 import java.util.ArrayList;
@@ -365,8 +364,8 @@
                 RMEndpoint rme = destination.getReliableEndpoint();
                 Proxy proxy = rme.getProxy();
                 proxy.acknowledge(DestinationSequence.this);
-            } catch (IOException ex) {
-                LogUtils.log(LOG, Level.SEVERE, "SEQ_ACK_SEND_EXC", ex, DestinationSequence.this);
+            } catch (RMException ex) {
+                // already logged
             } finally {
                 synchronized (DestinationSequence.this) {
                     DestinationSequence.this.deferredAcknowledgments.remove(this);

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties Fri
May  4 07:47:45 2007
@@ -45,4 +45,5 @@
 RMASSERTION_UNMARSHAL_EXC = Failed to unmarshal RMAssertion element.
 
 MESSAGE_ALREADY_DELIVERED_EXC = Message with number {0} in sequence {1} has already been
delivered.
-
+SEND_PROTOCOL_MSG_FAILED_EXC = Failed to send RM protocol message {0}.
+CORRELATED_SEQ_TERMINATION_EXC = Could not terminate correlated sequence.
\ No newline at end of file

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java Fri May  4
07:47:45 2007
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.rm;
 
 
-import java.io.IOException;
 import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -66,7 +65,7 @@
         return reliableEndpoint;
     }
 
-    void acknowledge(DestinationSequence ds) throws IOException {        
+    void acknowledge(DestinationSequence ds) throws RMException {        
         if (RMConstants.getAnonymousAddress().equals(ds.getAcksTo().getAddress().getValue()))
{
             LOG.log(Level.WARNING, "STANDALONE_ANON_ACKS_NOT_SUPPORTED");
             return;
@@ -77,7 +76,7 @@
         invoke(oi, new Object[] {}, null);
     }
     
-    void terminate(SourceSequence ss) throws IOException {
+    void terminate(SourceSequence ss) throws RMException {
         OperationInfo oi = reliableEndpoint.getEndpoint().getEndpointInfo().getService().getInterface()
             .getOperation(RMConstants.getTerminateSequenceOperationName());
         
@@ -86,7 +85,7 @@
         invoke(oi, new Object[] {ts}, null);
     }
     
-    void createSequenceResponse(final CreateSequenceResponseType createResponse) {
+    void createSequenceResponse(final CreateSequenceResponseType createResponse) throws RMException
{
         LOG.fine("sending CreateSequenceResponse from client side");
         final OperationInfo oi = reliableEndpoint.getEndpoint().getEndpointInfo().getService().getInterface()
             .getOperation(RMConstants.getCreateSequenceResponseOnewayOperationName());
@@ -100,7 +99,7 @@
     public CreateSequenceResponseType createSequence(
                         EndpointReferenceType defaultAcksTo,
                         RelatesToType relatesTo,
-                        boolean isServer) throws IOException {
+                        boolean isServer) throws RMException {
         
         SourcePolicyType sp = reliableEndpoint.getManager().getSourcePolicy();
         final CreateSequenceType create = RMUtils.getWSRMFactory().createCreateSequenceType();
       
@@ -146,7 +145,11 @@
             LOG.fine("sending CreateSequenceRequest from server side");
             Runnable r = new Runnable() {
                 public void run() {
-                    invoke(oi, new Object[] {create}, null);
+                    try {
+                        invoke(oi, new Object[] {create}, null);
+                    } catch (RMException ex) {
+                        // already logged
+                    }
                 }
             };
             reliableEndpoint.getApplicationEndpoint().getExecutor().execute(r);
@@ -157,7 +160,7 @@
         return (CreateSequenceResponseType)invoke(oi, new Object[] {create}, null);
     }
     
-    void lastMessage(SourceSequence s) throws IOException {
+    void lastMessage(SourceSequence s) throws RMException {
         // TODO
     }
     
@@ -171,11 +174,10 @@
         }
     }
        
-    Object invoke(OperationInfo oi, Object[] params, Map<String, Object> context) {
+    Object invoke(OperationInfo oi, Object[] params, Map<String, Object> context) throws
RMException {
         
         if (LOG.isLoggable(Level.INFO)) {
-            LOG.log(Level.INFO, "Invoking out-of-band RM protocol message {0} on thread "
-                    + Thread.currentThread(), 
+            LOG.log(Level.INFO, "Sending out-of-band RM protocol message {0}.", 
                     oi == null ? null : oi.getName());
         }
         
@@ -194,8 +196,12 @@
                 return result[0];
             }
             
-        } catch (Exception ex) {
-            ex.printStackTrace();
+        } catch (Exception ex) {  
+            org.apache.cxf.common.i18n.Message msg = 
+                new org.apache.cxf.common.i18n.Message("SEND_PROTOCOL_MSG_FAILED_EXC", LOG,

+                                                       oi == null ? null : oi.getName());
+            LOG.log(Level.SEVERE, msg.toString(), ex);
+            throw new RMException(msg, ex);
         }
         return null;
     }

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java Fri
May  4 07:47:45 2007
@@ -106,7 +106,7 @@
         assertReliability(message);
     }
     
-    void processAcknowledgments(RMProperties rmps) throws SequenceFault {
+    void processAcknowledgments(RMProperties rmps) throws SequenceFault, RMException {
         
         Collection<SequenceAcknowledgement> acks = rmps.getAcks();
         if (null != acks) {

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Fri May
 4 07:47:45 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.math.BigInteger;
 import java.util.HashMap;
 import java.util.Map;
@@ -58,7 +57,7 @@
 public class RMManager extends RMManagerConfigBean {
 
     private static final Logger LOG = LogUtils.getL7dLogger(RMManager.class);
-    
+
     private Bus bus;
     private RMStore store;
     private SequenceIdentifierGenerator idGenerator;
@@ -75,7 +74,7 @@
     public void setBus(Bus b) {
         bus = b;
     }
-    
+
     @PostConstruct
     public void register() {
         if (null != bus) {
@@ -98,7 +97,7 @@
     public void setRetransmissionQueue(RetransmissionQueue rq) {
         retransmissionQueue = rq;
     }
-    
+
     public SequenceIdentifierGenerator getIdGenerator() {
         return idGenerator;
     }
@@ -110,18 +109,19 @@
     public Timer getTimer() {
         return timer;
     }
-    
+
     public BindingFaultFactory getBindingFaultFactory(Binding binding) {
         return new SoapFaultFactory(binding);
     }
-    
+
     public synchronized RMEndpoint getReliableEndpoint(Message message) {
         Endpoint endpoint = message.getExchange().get(Endpoint.class);
         if (LOG.isLoggable(Level.FINE)) {
             LOG.fine("Getting RMEndpoint for endpoint with info: " + endpoint.getEndpointInfo().getName());
         }
         if (endpoint.getEndpointInfo().getName().equals(
-            new QName(RMConstants.getWsdlNamespace(), "SequenceAbstractSoapPort"))) {
+                                                        new QName(RMConstants.getWsdlNamespace(),
+                                                                  "SequenceAbstractSoapPort")))
{
             WrappedEndpoint wrappedEndpoint = (WrappedEndpoint)endpoint;
             endpoint = wrappedEndpoint.getWrappedEndpoint();
         }
@@ -133,9 +133,9 @@
             if (null != destination) {
                 AddressingPropertiesImpl maps = RMContextUtils.retrieveMAPs(message, false,
false);
                 replyTo = maps.getReplyTo();
-            } 
+            }
             rme.initialise(message.getExchange().getConduit(message), replyTo);
-            reliableEndpoints.put(endpoint, rme); 
+            reliableEndpoints.put(endpoint, rme);
             LOG.fine("Created new RMEndpoint.");
         }
         return rme;
@@ -148,7 +148,7 @@
         }
         return null;
     }
-    
+
     public SourceSequence getSourceSequence(Identifier id) {
         return sourceSequences.get(id.getValue());
     }
@@ -162,7 +162,7 @@
     }
 
     public SourceSequence getSequence(Identifier inSeqId, Message message, AddressingProperties
maps)
-        throws SequenceFault {
+        throws SequenceFault, RMException {
 
         Source source = getSource(message);
         SourceSequence seq = source.getCurrent(inSeqId);
@@ -170,44 +170,39 @@
             // TODO: better error handling
             org.apache.cxf.ws.addressing.EndpointReferenceType to = null;
             boolean isServer = RMContextUtils.isServerSide(message);
-            try {
-                EndpointReferenceType acksTo = null;
-                RelatesToType relatesTo = null;
-                if (isServer) {
-
-                    AddressingPropertiesImpl inMaps = RMContextUtils.retrieveMAPs(message,
false, false);
-                    inMaps.exposeAs(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
-                    acksTo = RMUtils.createReference2004(inMaps.getTo().getValue());
-                    to = inMaps.getReplyTo();
-                    source.getReliableEndpoint().getServant().setUnattachedIdentifier(inSeqId);
-                    relatesTo = (new org.apache.cxf.ws.addressing.ObjectFactory()).createRelatesToType();
-                    Destination destination = getDestination(message);
-                    DestinationSequence inSeq = inSeqId == null ? null : destination.getSequence(inSeqId);
-                    relatesTo.setValue(inSeq != null ? inSeq.getCorrelationID() : null);
-
-                } else {
-                    to = RMUtils.createReference(maps.getTo().getValue());
-                    acksTo = VersionTransformer.convert(maps.getReplyTo()); 
-                    if (RMConstants.getNoneAddress().equals(acksTo.getAddress().getValue()))
{
-                        org.apache.cxf.transport.Destination dest = message.getExchange()
-                            .getConduit(message).getBackChannel();
-                        if (null == dest) {
-                            acksTo = RMUtils.createAnonymousReference2004();
-                        } else {
-                            acksTo = VersionTransformer.convert(dest.getAddress());
-                        }
+            EndpointReferenceType acksTo = null;
+            RelatesToType relatesTo = null;
+            if (isServer) {
+
+                AddressingPropertiesImpl inMaps = RMContextUtils.retrieveMAPs(message, false,
false);
+                inMaps.exposeAs(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
+                acksTo = RMUtils.createReference2004(inMaps.getTo().getValue());
+                to = inMaps.getReplyTo();
+                source.getReliableEndpoint().getServant().setUnattachedIdentifier(inSeqId);
+                relatesTo = (new org.apache.cxf.ws.addressing.ObjectFactory()).createRelatesToType();
+                Destination destination = getDestination(message);
+                DestinationSequence inSeq = inSeqId == null ? null : destination.getSequence(inSeqId);
+                relatesTo.setValue(inSeq != null ? inSeq.getCorrelationID() : null);
+
+            } else {
+                to = RMUtils.createReference(maps.getTo().getValue());
+                acksTo = VersionTransformer.convert(maps.getReplyTo());
+                if (RMConstants.getNoneAddress().equals(acksTo.getAddress().getValue()))
{
+                    org.apache.cxf.transport.Destination dest = message.getExchange().getConduit(message)
+                        .getBackChannel();
+                    if (null == dest) {
+                        acksTo = RMUtils.createAnonymousReference2004();
+                    } else {
+                        acksTo = VersionTransformer.convert(dest.getAddress());
                     }
                 }
+            }
 
-                Proxy proxy = source.getReliableEndpoint().getProxy();
-                CreateSequenceResponseType createResponse = 
-                    proxy.createSequence(acksTo, relatesTo, isServer);
-                if (!isServer) {
-                    Servant servant = source.getReliableEndpoint().getServant();
-                    servant.createSequenceResponse(createResponse);
-                }
-            } catch (IOException ex) {
-                ex.printStackTrace();
+            Proxy proxy = source.getReliableEndpoint().getProxy();
+            CreateSequenceResponseType createResponse = proxy.createSequence(acksTo, relatesTo,
isServer);
+            if (!isServer) {
+                Servant servant = source.getReliableEndpoint().getServant();
+                servant.createSequenceResponse(createResponse);
             }
 
             seq = source.awaitCurrent(inSeqId);
@@ -216,22 +211,24 @@
 
         return seq;
     }
-    
+
     @PreDestroy
     public void shutdown() {
         // shutdown retransmission queue
         if (null != retransmissionQueue) {
             retransmissionQueue.stop();
         }
-        
-        // cancel outstanding timer tasks (deferred acknowledgements) for all destination
sequences
+
+        // cancel outstanding timer tasks (deferred acknowledgements) for all
+        // destination sequences
         for (RMEndpoint rme : reliableEndpoints.values()) {
             for (DestinationSequence ds : rme.getDestination().getAllSequences()) {
                 ds.cancelDeferredAcknowledgments();
             }
         }
-        
-        // remove references to timer tasks cancelled above to make them eligible for garbage
collection
+
+        // remove references to timer tasks cancelled above to make them
+        // eligible for garbage collection
         timer.purge();
         timer.cancel();
     }
@@ -250,17 +247,16 @@
         if (!isSetSourcePolicy()) {
             SourcePolicyType sp = factory.createSourcePolicyType();
             setSourcePolicy(sp);
-            
+
         }
         if (!getSourcePolicy().isSetSequenceTerminationPolicy()) {
-            getSourcePolicy().setSequenceTerminationPolicy(
-                factory.createSequenceTerminationPolicyType());            
+            getSourcePolicy().setSequenceTerminationPolicy(factory.createSequenceTerminationPolicyType());
         }
         if (!isSetDestinationPolicy()) {
             DestinationPolicyType dp = factory.createDestinationPolicyType();
             dp.setAcksPolicy(factory.createAcksPolicyType());
             setDestinationPolicy(dp);
-        }    
+        }
         if (null == retransmissionQueue) {
             retransmissionQueue = new RetransmissionQueueImpl(this);
         }
@@ -268,25 +264,24 @@
             idGenerator = new DefaultSequenceIdentifierGenerator();
         }
     }
-       
+
     @Override
-    public void setRMAssertion(RMAssertion rma) {        
-        
-        org.apache.cxf.ws.rm.policy.ObjectFactory factory = 
-            new org.apache.cxf.ws.rm.policy.ObjectFactory();
+    public void setRMAssertion(RMAssertion rma) {
+
+        org.apache.cxf.ws.rm.policy.ObjectFactory factory = new org.apache.cxf.ws.rm.policy.ObjectFactory();
         if (null == rma) {
             rma = factory.createRMAssertion();
             rma.setExponentialBackoff(factory.createRMAssertionExponentialBackoff());
         }
         BaseRetransmissionInterval bri = rma.getBaseRetransmissionInterval();
         if (null == bri) {
-            bri = factory.createRMAssertionBaseRetransmissionInterval();  
+            bri = factory.createRMAssertionBaseRetransmissionInterval();
             rma.setBaseRetransmissionInterval(bri);
         }
         if (null == bri.getMilliseconds()) {
             bri.setMilliseconds(new BigInteger(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL));
         }
-                
+
         super.setRMAssertion(rma);
     }
 
@@ -296,21 +291,21 @@
         }
         sourceSequences.put(ss.getIdentifier().getValue(), ss);
     }
-    
+
     void removeSourceSequence(Identifier id) {
         if (null != sourceSequences) {
             sourceSequences.remove(id.getValue());
         }
-    } 
-    
+    }
+
     class DefaultSequenceIdentifierGenerator implements SequenceIdentifierGenerator {
 
         public Identifier generateSequenceIdentifier() {
             String sequenceID = RMContextUtils.generateUUID();
             Identifier sid = RMUtils.getWSRMFactory().createIdentifier();
-            sid.setValue(sequenceID);        
+            sid.setValue(sequenceID);
             return sid;
-        }   
+        }
     }
-   
+
 }

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
Fri May  4 07:47:45 2007
@@ -44,7 +44,7 @@
         addAfter(MAPAggregator.class.getName());
     }
     
-    protected void handle(Message message) throws SequenceFault {
+    protected void handle(Message message) throws SequenceFault, RMException {
         LOG.entering(getClass().getName(), "handleMessage");
         
         if (isRuntimeFault(message)) {

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java Fri May 
4 07:47:45 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
 import java.util.logging.Level;
@@ -183,7 +182,7 @@
         }
     }
 
-    public void terminateSequence(Message message) throws SequenceFault {
+    public void terminateSequence(Message message) throws SequenceFault, RMException {
         LOG.fine("Terminating sequence");
         
         TerminateSequenceType terminate = (TerminateSequenceType)getParameter(message);
@@ -214,8 +213,8 @@
                 Proxy proxy = new Proxy(reliableEndpoint);
                 try {
                     proxy.lastMessage(outboundSeq);
-                } catch (IOException ex) {
-                    LOG.log(Level.SEVERE, "Could not terminate correlated sequence.", ex);
+                } catch (RMException ex) {
+                    LogUtils.log(LOG, Level.SEVERE, "CORRELATED_SEQ_TERMINATION_EXC", ex);
                 }
                 
                 break;

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java Fri
May  4 07:47:45 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.math.BigInteger;
 import java.util.Date;
 import java.util.logging.Level;
@@ -27,7 +26,6 @@
 
 import javax.xml.datatype.Duration;
 
-import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.jaxb.DatatypeFactory;
 import org.apache.cxf.ws.addressing.ContextUtils;
@@ -138,24 +136,20 @@
      * 
      * @param acknowledgement an acknowledgement for this sequence
      */
-    public void setAcknowledged(SequenceAcknowledgement a) {
+    public void setAcknowledged(SequenceAcknowledgement a) throws RMException {
         acknowledgement = a;
         source.getManager().getRetransmissionQueue().purgeAcknowledged(this);
         if (allAcknowledged()) {
             RMEndpoint rme = source.getReliableEndpoint();
             Proxy proxy = rme.getProxy();
-            try {
-                proxy.terminate(this);
-                source.getManager().removeSourceSequence(id);
-            } catch (IOException ex) {
-                Message msg = new Message("SEQ_TERMINATION_FAILURE", LOG, id);
-                LOG.log(Level.SEVERE, msg.toString(), ex);
-            }
+            proxy.terminate(this);
+            source.getManager().removeSourceSequence(id);
         }
     }
-    
-    /** 
+
+    /**
      * Returns the source associated with this source sequence.
+     * 
      * @return the source.
      */
     public Source getSource() {

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
Fri May  4 07:47:45 2007
@@ -380,7 +380,7 @@
     }
     
     @Test
-    public void testAcknowledgeDeferred() throws SequenceFault, IOException {
+    public void testAcknowledgeDeferred() throws SequenceFault, RMException {
         Timer timer = new Timer();
         setUpDestination(timer);
         

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java Fri
May  4 07:47:45 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.lang.reflect.Method;
 import java.math.BigInteger;
 
@@ -208,7 +207,7 @@
         Proxy proxy = control.createMock(Proxy.class);
         EasyMock.expect(rme.getProxy()).andReturn(proxy);
         proxy.acknowledge(ds);
-        EasyMock.expectLastCall().andThrow(new IOException(""));
+        EasyMock.expectLastCall();
         
         control.replay();
         destination.acknowledge(message);   

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java Fri May
 4 07:47:45 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
@@ -90,7 +89,7 @@
     }
     
     @Test
-    public void testAcknowledgeNotSupported() throws IOException {
+    public void testAcknowledgeNotSupported() throws RMException {
         DestinationSequence ds = control.createMock(DestinationSequence.class);
         EndpointReferenceType acksToEPR = control.createMock(EndpointReferenceType.class);
         EasyMock.expect(ds.getAcksTo()).andReturn(acksToEPR);
@@ -104,7 +103,7 @@
     }
     
     @Test
-    public void testAcknowledge() throws NoSuchMethodException, IOException {
+    public void testAcknowledge() throws NoSuchMethodException, RMException {
         Method m = Proxy.class.getDeclaredMethod("invoke", 
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
@@ -133,7 +132,7 @@
     }
     
     @Test    
-    public void testTerminate() throws NoSuchMethodException, IOException {
+    public void testTerminate() throws NoSuchMethodException, RMException {
         Method m = Proxy.class.getDeclaredMethod("invoke", 
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
@@ -157,7 +156,7 @@
     }
     
     @Test
-    public void testCreateSequenceResponse() throws NoSuchMethodException, IOException {
+    public void testCreateSequenceResponse() throws NoSuchMethodException, RMException {
         Method m = Proxy.class.getDeclaredMethod("invoke", 
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
@@ -180,12 +179,12 @@
     }
     
     @Test
-    public void testCreateSequenceOnClient() throws NoSuchMethodException, IOException {
+    public void testCreateSequenceOnClient() throws NoSuchMethodException, RMException {
         testCreateSequence(false); 
     }
     
     @Test
-    public void testCreateSequenceOnServer() throws NoSuchMethodException, IOException {
+    public void testCreateSequenceOnServer() throws NoSuchMethodException, RMException {
         testCreateSequence(true); 
     }
     
@@ -253,7 +252,7 @@
     
     
     
-    private void testCreateSequence(boolean isServer) throws NoSuchMethodException, IOException
{
+    private void testCreateSequence(boolean isServer) throws NoSuchMethodException, RMException
{
         Method m = Proxy.class.getDeclaredMethod("invoke", 
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
@@ -308,7 +307,7 @@
     }
     
     @SuppressWarnings("unchecked")
-    private void expectInvoke(Proxy proxy, OperationInfo oi, Object expectedReturn) {
+    private void expectInvoke(Proxy proxy, OperationInfo oi, Object expectedReturn) throws
RMException {
         EasyMock.expect(proxy.invoke(EasyMock.same(oi), EasyMock.isA(Object[].class), 
             (Map)EasyMock.isNull())).andReturn(expectedReturn);
     }

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
Fri May  4 07:47:45 2007
@@ -197,7 +197,7 @@
     }  
     
     @Test
-    public void testProcessAcknowledgments() {
+    public void testProcessAcknowledgments() throws RMException {
         interceptor = new RMInInterceptor();
         manager = control.createMock(RMManager.class);
         interceptor.setManager(manager);

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java Fri
May  4 07:47:45 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.io.IOException;
 import java.lang.reflect.Method;
 import java.math.BigInteger;
 import java.util.Date;
@@ -173,7 +172,7 @@
     }
      
     @Test
-    public void testGetExistingSequence() throws NoSuchMethodException, SequenceFault {
+    public void testGetExistingSequence() throws NoSuchMethodException, SequenceFault, RMException
{
         Method m = RMManager.class
            .getDeclaredMethod("getSource", new Class[] {Message.class});
         RMManager manager = control.createMock(RMManager.class, new Method[] {m});
@@ -190,7 +189,7 @@
     }
     
     @Test
-    public void testGetNewSequence() throws NoSuchMethodException, SequenceFault, IOException
{
+    public void testGetNewSequence() throws NoSuchMethodException, SequenceFault, RMException
{
         Method m = RMManager.class.getDeclaredMethod("getSource", new Class[] {Message.class});
         RMManager manager = control.createMock(RMManager.class, new Method[] {m});
         Message message = control.createMock(Message.class);

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
Fri May  4 07:47:45 2007
@@ -65,7 +65,7 @@
     } 
     
     @Test 
-    public void testHandleRuntimeFault() throws NoSuchMethodException, SequenceFault {
+    public void testHandleRuntimeFault() throws NoSuchMethodException, SequenceFault, RMException
{
         Method[] mocked = new Method[] {                                                
             RMOutInterceptor.class.getDeclaredMethod("isRuntimeFault", new Class[] {Message.class})
         };
@@ -78,7 +78,7 @@
     }
     
     @Test 
-    public void testHandleNoMAPs() throws NoSuchMethodException, SequenceFault {
+    public void testHandleNoMAPs() throws NoSuchMethodException, SequenceFault, RMException
{
         Method[] mocked = new Method[] {                                                
             RMOutInterceptor.class.getDeclaredMethod("isRuntimeFault", new Class[] {Message.class})
         };
@@ -94,7 +94,7 @@
     }
     
     @Test
-    public void testHandleApplicationMessage() throws NoSuchMethodException, SequenceFault
{
+    public void testHandleApplicationMessage() throws NoSuchMethodException, SequenceFault,
RMException {
         AddressingPropertiesImpl maps = createMAPs("greetMe", "localhost:9000/GreeterPort",

             org.apache.cxf.ws.addressing.Names.WSA_NONE_ADDRESS);
         Method[] mocked = new Method[] {

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java?view=diff&rev=535269&r1=535268&r2=535269
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
Fri May  4 07:47:45 2007
@@ -164,7 +164,7 @@
     }
     
     @Test
-    public void testSetAcknowledged() {
+    public void testSetAcknowledged() throws RMException {
         SourceSequence seq = new SourceSequence(id);
         setUpSource();
         seq.setSource(source);
@@ -197,7 +197,7 @@
     } 
 
     @Test
-    public void testAllAcknowledged() throws SequenceFault {
+    public void testAllAcknowledged() throws SequenceFault, RMException {
         
         SourceSequence seq = new SourceSequence(id, null, null, new BigInteger("4"), false);
       
         setUpSource();
@@ -224,7 +224,7 @@
     }
     
     @Test
-    public void testNextMessageNumber() {     
+    public void testNextMessageNumber() throws RMException {     
         SourceSequence seq = null;        
         setUpSource();
         rq.purgeAcknowledged(EasyMock.isA(SourceSequence.class));
@@ -327,7 +327,7 @@
         return seq.isLastMessage();
     }
     
-    protected void acknowledge(SourceSequence seq, int... messageNumbers) {
+    protected void acknowledge(SourceSequence seq, int... messageNumbers) throws RMException
{
         SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
         int i = 0;
         while (i < messageNumbers.length) {



Mime
View raw message