Package org.objectweb.celtix.ws.rm

Examples of org.objectweb.celtix.ws.rm.SequenceType


            header.addNamespaceDeclaration(Names.WSRM_NAMESPACE_PREFIX,
                                           Names.WSRM_NAMESPACE_NAME);
            Marshaller marshaller = getJAXBContext().createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
          
            SequenceType seq = rmps.getSequence();
            if (null != seq) {
                encodeProperty(seq,
                               Names.WSRM_SEQUENCE_QNAME,
                               SequenceType.class,
                               header,
View Full Code Here


                    Name headerName = headerElement.getElementName();
                    String localName = headerName.getLocalName();
                    if (Names.WSRM_NAMESPACE_NAME.equals(headerName.getURI())) {
                        LOG.log(Level.INFO, "decoding RM header {0}", localName);
                        if (Names.WSRM_SEQUENCE_NAME.equals(localName)) {
                            SequenceType s = decodeProperty(SequenceType.class,
                                                            headerElement,
                                                            unmarshaller);
                           
                            rmps.setSequence(s);
                        } else if (Names.WSRM_SEQUENCE_ACK_NAME.equals(localName)) {
View Full Code Here

       
        control.replay();
        rmps.setSequence(seq);
        control.verify();
       
        SequenceType s = rmps.getSequence();
        assertNotNull(s);
        assertSame(s.getIdentifier(), sid);
        assertEquals(s.getMessageNumber(), BigInteger.TEN);
        assertNull(s.getLastMessage());
       
        control.reset();
       
        seq.getIdentifier();
        expectLastCall().andReturn(sid);
        seq.getCurrentMessageNr();
        expectLastCall().andReturn(BigInteger.TEN);
        seq.isLastMessage();
        expectLastCall().andReturn(true);
       
        control.replay();
        rmps.setSequence(seq);
        control.verify();
       
        s = rmps.getSequence();
        assertNotNull(s);
        assertSame(s.getIdentifier(), sid);
        assertEquals(s.getMessageNumber(), BigInteger.TEN);
        assertNotNull(s.getLastMessage());
    }
View Full Code Here

        control.replay();
        RMDestination d = new RMDestination(handler);
        Identifier sid = d.generateSequenceIdentifier();
        DestinationSequence seq = new DestinationSequence(sid, address, d);
        d.addSequence(seq);
        SequenceType st = RMUtils.getWSRMFactory().createSequenceType();
        st.setIdentifier(sid);
        BigInteger m = new BigInteger("3");
        st.setMessageNumber(m);
        d.acknowledge(st, RMUtils.getAddressingConstants().getNoneURI());
       
        Identifier unknown = d.generateSequenceIdentifier();
        st.setIdentifier(unknown);
        try {
            d.acknowledge(st, RMUtils.getAddressingConstants().getNoneURI());
            fail("Expected sequenceFault not thrown.");
        } catch (SequenceFault sf) {
            assertEquals("UnknownSequence", sf.getFaultInfo().getFaultCode().getLocalPart());
View Full Code Here

        if (context != null) {
            context.get(RM_PROPERTIES_OUTBOUND);
            EasyMock.expectLastCall().andReturn(rmps);
        }
        properties.add(rmps);
        SequenceType sequence = control.createMock(SequenceType.class);
        if (context != null) {
            rmps.getSequence();
            EasyMock.expectLastCall().andReturn(sequence);
        }
        if (messageNumber != null) {
            sequence.getMessageNumber();
            EasyMock.expectLastCall().andReturn(messageNumber);
        } else {
            Identifier id = control.createMock(Identifier.class);
            sequence.getIdentifier();
            EasyMock.expectLastCall().andReturn(id);
            id.getValue();
            EasyMock.expectLastCall().andReturn(sid);
            identifiers.add(id);
        }
View Full Code Here

    public void testAddUnacknowledged() {
        ObjectMessageContext ctx = new ObjectMessageContextImpl();
        AddressingProperties maps = new AddressingPropertiesImpl();
        ctx.put(CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, maps);
        RMPropertiesImpl rmps = new RMPropertiesImpl();
        SequenceType seq = control.createMock(SequenceType.class);
        Identifier sid = control.createMock(Identifier.class);
        rmps.setSequence(seq);
        RMContextUtils.storeRMProperties(ctx, rmps, true);  
        SourceSequence ss = control.createMock(SourceSequence.class);
        RMMessage msg = control.createMock(RMMessage.class);
        AbstractClientBinding binding = control.createMock(AbstractClientBinding.class);
        handler.getBinding();
        expectLastCall().andReturn(binding);
        ObjectMessageContext clonedCtx =  new ObjectMessageContextImpl();
        binding.createObjectContext();
        expectLastCall().andReturn(clonedCtx);
        msg.getContext();       
        expectLastCall().andReturn(ctx);
        seq.getIdentifier();
        expectLastCall().andReturn(sid);
        RMStore store = control.createMock(RMStore.class);
        handler.getStore();
        expectLastCall().andReturn(store);
        store.persistOutgoing(ss, msg);
View Full Code Here

        ObjectMessageContext objectCtx = new ObjectMessageContextImpl();
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);
        sb.read(istreamCtx, context);
        assertTrue(codec.handleMessage(context));
        RMProperties rmps = RMContextUtils.retrieveRMProperties(context, false);
        SequenceType st = rmps.getSequence();
        assertNotNull(st);
        assertEquals(st.getIdentifier().getValue(), SEQ_IDENTIFIER);
        assertEquals(st.getMessageNumber(), MSG1_MESSAGE_NUMBER);
       
        assertNull(rmps.getAcks());
        assertNull(rmps.getAcksRequested());

    }
View Full Code Here

        assertEquals(1, requested.size());
        AckRequestedType ar = requested.iterator().next();
        assertNotNull(ar);
        assertEquals(ar.getIdentifier().getValue(), SEQ_IDENTIFIER);

        SequenceType s = rmps.getSequence();
        assertNotNull(s);
        assertEquals(s.getIdentifier().getValue(), SEQ_IDENTIFIER);
        assertEquals(s.getMessageNumber(), MSG2_MESSAGE_NUMBER);

        assertNull(rmps.getAcks());
    }
View Full Code Here

        return new Resender() {
            public void resend(ObjectMessageContext context,
                               boolean requestAcknowledge) {
                RMProperties properties =
                    RMContextUtils.retrieveRMProperties(context, true);
                SequenceType st = properties.getSequence();
                if (st != null) {
                    LOG.log(Level.INFO, "RESEND_MSG", st.getMessageNumber());
                }
                try {
                    refreshMAPs(context);
                    refreshRMProperties(context, requestAcknowledge);
                    if (ContextUtils.isRequestor(context)) {
View Full Code Here

            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
       
        SequenceType st = rmps.getSequence();
        Identifier sid = st.getIdentifier();
        synchronized (this) {
            String key = sid.getValue();
            List<ResendCandidate> sequenceCandidates =
                getSequenceCandidates(key);
            if (null == sequenceCandidates) {
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.ws.rm.SequenceType

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.