Package org.objectweb.celtix.ws.rm.policy

Examples of org.objectweb.celtix.ws.rm.policy.RMAssertionType


   
    public void testAcknowledgeLastMessageNumberExceeded() throws SequenceFault
       
        DestinationSequence seq = new DestinationSequence(id, ref, destination);
       
        RMAssertionType ra = EasyMock.createMock(RMAssertionType.class);

        destination.getRMAssertion();
        expectLastCall().andReturn(ra);
        rma.getAcknowledgementInterval();
        expectLastCall().andReturn(null);
View Full Code Here


        bus.getWSDLManager();
        EasyMock.expectLastCall().andReturn(wsdlManager).times(2);
        EasyMock.replay(bus);

        RMPolicyProvider provider = new RMPolicyProvider(bus, epr);
        RMAssertionType rma = (RMAssertionType)provider.getObject("rmAssertion");
        assertNotNull(rma);
        assertEquals(new BigInteger("600000"), rma.getInactivityTimeout().getMilliseconds());
        assertEquals(new BigInteger("200"), rma.getAcknowledgementInterval().getMilliseconds());
        assertNull(rma.getBaseRetransmissionInterval());    

        EasyMock.verify(bus);
    }
View Full Code Here

        EasyMock.replay(bus);

        RMPolicyProvider provider = new RMPolicyProvider(bus, epr);
        assertNotNull(EndpointReferenceUtils.getPort(wsdlManager, epr));
        assertNotNull(EndpointReferenceUtils.getPort(wsdlManager, epr).getBinding());
        RMAssertionType rma = (RMAssertionType)provider.getObject("rmAssertion");
        assertNotNull(rma);
        assertEquals(new BigInteger("600000"), rma.getInactivityTimeout().getMilliseconds());
        assertEquals(new BigInteger("200"), rma.getAcknowledgementInterval().getMilliseconds());
        assertNull(rma.getBaseRetransmissionInterval());    

        EasyMock.verify(bus);
    }
View Full Code Here

        EasyMock.replay(bus);

        RMPolicyProvider provider = new RMPolicyProvider(bus, epr);
        assertNotNull(EndpointReferenceUtils.getPort(wsdlManager, epr));
        assertNotNull(EndpointReferenceUtils.getPort(wsdlManager, epr).getBinding());
        RMAssertionType rma = (RMAssertionType)provider.getObject("rmAssertion");
        assertNotNull(rma);
        assertEquals(new BigInteger("900000"), rma.getInactivityTimeout().getMilliseconds());
        assertEquals(new BigInteger("400"), rma.getAcknowledgementInterval().getMilliseconds());
        assertNull(rma.getBaseRetransmissionInterval());    

        EasyMock.verify(bus);
    }
View Full Code Here

        EasyMock.replay(bus);

        RMPolicyProvider provider = new RMPolicyProvider(bus, epr);
        assertNotNull(EndpointReferenceUtils.getPort(wsdlManager, epr));
        assertNotNull(EndpointReferenceUtils.getPort(wsdlManager, epr).getBinding());
        RMAssertionType rma = (RMAssertionType)provider.getObject("rmAssertion");
        assertNull(rma);   

        EasyMock.verify(bus);
    }
View Full Code Here

    public void testAcknowledge() throws IOException, WSDLException, SequenceFault {
        TestSoapClientBinding binding = new TestSoapClientBinding(bus, epr);
        IMocksControl control = EasyMock.createNiceControl();
        RMHandler handler = control.createMock(RMHandler.class);
        RMDestination dest = control.createMock(RMDestination.class);
        RMAssertionType rma = control.createMock(RMAssertionType.class);

        dest.getRMAssertion();
        expectLastCall().andReturn(rma).times(2);
        rma.getAcknowledgementInterval();
        expectLastCall().andReturn(null).times(2);
        dest.getAcksPolicy();
        expectLastCall().andReturn(null).times(2);
       
        handler.getBinding();
View Full Code Here

        expectLastCall().andReturn(null);
        replay(handler);
        replay(c);
       
        RMEndpoint e = new RMEndpoint(handler);
        RMAssertionType rma = e.getRMAssertion();
        assertNotNull(rma);
       
        verify(handler);
        verify(c);
    }
View Full Code Here

    public RMHandler getHandler() {
        return handler;
    }
   
    public RMAssertionType getRMAssertion() {
        RMAssertionType a = getHandler().getConfiguration()
            .getObject(RMAssertionType.class, RMASSERTION_PROPERTY_NAME);       

        // the following should not be necessary as the rm handler configuration metadata
        // supplies a default value for the RMAssertion
       
        if (null == a) {
            a = RMUtils.getWSRMPolicyFactory().createRMAssertionType();
            RMUtils.getWSRMPolicyFactory().createRMAssertionType();
        }
       
        if (null == a.getBaseRetransmissionInterval()) {
            BaseRetransmissionInterval bri =
                RMUtils.getWSRMPolicyFactory().createRMAssertionTypeBaseRetransmissionInterval();
            bri.setMilliseconds(new BigInteger(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL));
            a.setBaseRetransmissionInterval(bri);
        }
       
        if (null == a.getExponentialBackoff()) {
            ExponentialBackoff eb  =
                RMUtils.getWSRMPolicyFactory().createRMAssertionTypeExponentialBackoff();
            a.setExponentialBackoff(eb);
        }
        Map<QName, String> otherAttributes = a.getExponentialBackoff().getOtherAttributes();
        String val = otherAttributes.get(RetransmissionQueue.EXPONENTIAL_BACKOFF_BASE_ATTR);
        if (null == val) {
            otherAttributes.put(RetransmissionQueue.EXPONENTIAL_BACKOFF_BASE_ATTR,
                                RetransmissionQueue.DEFAULT_EXPONENTIAL_BACKOFF);
       
View Full Code Here

        Message msg = new Message("UNKNOWN_SEQUENCE_EXC", LOG, sid.getValue());
        return new SequenceFault(msg.toString(), sf);
    }
  
    private void scheduleAcknowledgement() {
        RMAssertionType rma = destination.getRMAssertion();
        int delay = 0;
        if (null != rma.getAcknowledgementInterval()) {
            delay = rma.getAcknowledgementInterval().getMilliseconds().intValue();
        }
        AcksPolicyType ap = destination.getAcksPolicy();
        if (delay > 0 && getMonitor().getMPM() >= ap.getIntraMessageThreshold()) {
            scheduleDeferredAcknowledgement(delay);
        } else {
View Full Code Here

        }
        return null;
    }

    private RMAssertionType getRMAssertion(Element policyElement) {
        RMAssertionType rma = null;
        NodeList nl = policyElement.getElementsByTagNameNS(RMUtils.getRMConstants().getRMPolicyNamespaceURI(),
                                                           "RMAssertion");
        if (nl.getLength() > 0) {
            JAXBContext context = null;
            String packageName = RMUtils.getWSRMPolicyFactory().getClass().getPackage().getName();
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.ws.rm.policy.RMAssertionType

Copyright © 2018 www.massapicom. 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.