Examples of RMConfiguration


Examples of org.apache.cxf.ws.rm.RMConfiguration

       
        return message;
    }
   
    private void setupMessagePolicies(Message message) {
        RMConfiguration cfg = new RMConfiguration();
        EasyMock.expect(manager.getEffectiveConfiguration(message)).andReturn(cfg);
        cfg.setBaseRetransmissionInterval(new Long(5000));
        cfg.setExponentialBackoff(true);
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.RMConfiguration

    }
   
    @Test
    public void testIntersect() {
        RMAssertion rma = new RMAssertion();
        RMConfiguration cfg0 = new RMConfiguration();
        assertTrue(RMPolicyUtilities.equals(cfg0, RMPolicyUtilities.intersect(rma, cfg0)));
       
        InactivityTimeout aiat = new RMAssertion.InactivityTimeout();
        aiat.setMilliseconds(new Long(7200000));
        rma.setInactivityTimeout(aiat);
        cfg0.setInactivityTimeout(new Long(3600000));
       
        RMConfiguration cfg1 = RMPolicyUtilities.intersect(rma, cfg0);
        assertEquals(7200000L, cfg1.getInactivityTimeout().longValue());
        assertNull(cfg1.getBaseRetransmissionInterval());
        assertNull(cfg1.getAcknowledgementInterval());
        assertFalse(cfg1.isExponentialBackoff());
       
        BaseRetransmissionInterval abri = new RMAssertion.BaseRetransmissionInterval();
        abri.setMilliseconds(new Long(20000));
        rma.setBaseRetransmissionInterval(abri);
        cfg0.setBaseRetransmissionInterval(new Long(10000));
       
        cfg1 = RMPolicyUtilities.intersect(rma, cfg0);
        assertEquals(7200000L, cfg1.getInactivityTimeout().longValue());
        assertEquals(20000L, cfg1.getBaseRetransmissionInterval().longValue());
        assertNull(cfg1.getAcknowledgementInterval());
        assertFalse(cfg1.isExponentialBackoff());
      
        AcknowledgementInterval aai = new RMAssertion.AcknowledgementInterval();
        aai.setMilliseconds(new Long(2000));
        rma.setAcknowledgementInterval(aai);
       
        cfg1 = RMPolicyUtilities.intersect(rma, cfg0);
        assertEquals(7200000L, cfg1.getInactivityTimeout().longValue());
        assertEquals(20000L, cfg1.getBaseRetransmissionInterval().longValue());
        assertEquals(2000L, cfg1.getAcknowledgementInterval().longValue());
        assertFalse(cfg1.isExponentialBackoff());
       
        cfg0.setExponentialBackoff(true);
        cfg1 = RMPolicyUtilities.intersect(rma, cfg0);
        assertEquals(7200000L, cfg1.getInactivityTimeout().longValue());
        assertEquals(20000L, cfg1.getBaseRetransmissionInterval().longValue());
        assertEquals(2000L, cfg1.getAcknowledgementInterval().longValue());
        assertTrue(cfg1.isExponentialBackoff());   
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.RMConfiguration

        assertTrue(cfg1.isExponentialBackoff());   
    }
   
    @Test
    public void testGetRMConfiguration() {
        RMConfiguration cfg = new RMConfiguration();
        cfg.setBaseRetransmissionInterval(new Long(3000));
        cfg.setExponentialBackoff(true);
       
        Message message = control.createMock(Message.class);
        EasyMock.expect(message.get(AssertionInfoMap.class)).andReturn(null);
        control.replay();
        assertSame(cfg, RMPolicyUtilities.getRMConfiguration(cfg, message));
        control.verify();
       
        control.reset();
        AssertionInfoMap aim = control.createMock(AssertionInfoMap.class);
        EasyMock.expect(message.get(AssertionInfoMap.class)).andReturn(aim);
        Collection<AssertionInfo> ais = new ArrayList<AssertionInfo>();
        EasyMock.expect(aim.get(RM10Constants.RMASSERTION_QNAME)).andReturn(ais);
        control.replay();
        assertSame(cfg, RMPolicyUtilities.getRMConfiguration(cfg, message));
        control.verify();
       
        control.reset();
        RMAssertion b = new RMAssertion();
        BaseRetransmissionInterval bbri = new RMAssertion.BaseRetransmissionInterval();
        bbri.setMilliseconds(new Long(2000));
        b.setBaseRetransmissionInterval(bbri);
        JaxbAssertion<RMAssertion> assertion = new JaxbAssertion<RMAssertion>();
        assertion.setName(RM10Constants.RMASSERTION_QNAME);
        assertion.setData(b);
        AssertionInfo ai = new AssertionInfo(assertion);
        ais.add(ai);
        EasyMock.expect(message.get(AssertionInfoMap.class)).andReturn(aim);
        EasyMock.expect(aim.get(RM10Constants.RMASSERTION_QNAME)).andReturn(ais);
        control.replay();
        RMConfiguration cfg1 = RMPolicyUtilities.getRMConfiguration(cfg, message);
        assertNull(cfg1.getAcknowledgementInterval());
        assertNull(cfg1.getInactivityTimeout());
        assertEquals(2000L, cfg1.getBaseRetransmissionInterval().longValue());
        assertTrue(cfg1.isExponentialBackoff());  
        control.verify();
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.RMConfiguration

       
        return message;
    }
   
    private void setupMessagePolicies(Message message) {
        RMConfiguration cfg = new RMConfiguration();
        EasyMock.expect(manager.getEffectiveConfiguration(message)).andReturn(cfg);
        cfg.setBaseRetransmissionInterval(new Long(5000));
        cfg.setExponentialBackoff(true);
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.RMConfiguration

                    if (rmUri != null && rmUri.equals(ns)) {
                        if (codec == null) {
                            String wsauri = null;
                            AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, false, false);
                            if (maps == null) {
                                RMConfiguration config = getManager(message).getEffectiveConfiguration(message);
                                wsauri = config.getAddressingNamespace();
                            } else {
                                wsauri = maps.getNamespaceURI();
                            }
                            ProtocolVariation protocol = ProtocolVariation.findVariant(rmUri, wsauri);
                            if (protocol == null) {
View Full Code Here

Examples of org.apache.cxf.ws.rm.RMConfiguration

         * @param ctx message context for the unacked message
         */
        protected ResendCandidate(Message m) {
            message = m;
            retries = 0;
            RMConfiguration cfg = manager.getEffectiveConfiguration(message);
            long baseRetransmissionInterval =
                cfg.getBaseRetransmissionInterval().longValue();
            backoff = cfg.isExponentialBackoff()  ? RetransmissionQueue.DEFAULT_EXPONENTIAL_BACKOFF : 1;
            next = new Date(System.currentTimeMillis() + baseRetransmissionInterval);
            nextInterval = baseRetransmissionInterval * backoff;
            RetryPolicyType rmrp = null != manager.getSourcePolicy()
                ? manager.getSourcePolicy().getRetryPolicy() : null;
            maxRetries = null != rmrp ? rmrp.getMaxRetries() : -1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.