Package org.servicemix.ws.xmlbeans.addressing.v2003_03.impl

Examples of org.servicemix.ws.xmlbeans.addressing.v2003_03.impl.ToDocumentImpl


        SubscribeDocument.Subscribe subscribe = doc.getSubscribe();


        // lets get the endpoint reference
        EndpointReferenceType endpointReference = subscribe.getConsumerReference();
        AttributedURI address = endpointReference.getAddress();
        System.out.println("EndpointReference address is: " + address.getStringValue());

        ReferencePropertiesType referenceProperties = endpointReference.getReferenceProperties();
        System.out.println("Reference properties: " + referenceProperties);

View Full Code Here


        XMLStreamHelper.writeEndElement(WS_ADDRESSING_QNAME, contentHandler);
        contentHandler.endDocument();

        XmlObject object = buffer.getObject();
        if (object instanceof EndpointReferenceType) {
            EndpointReferenceType endpointReference = (EndpointReferenceType) object;
            System.out.println("Parsed endpoint reference: " + endpointReference);
            AddressingContext.setCurrentContext(null);
        }
        else {
            AddressingContext.setCurrentContext(null);
View Full Code Here

        SubscribeDocument doc = (SubscribeDocument) xmlObject;
        SubscribeDocument.Subscribe subscribe = doc.getSubscribe();


        // lets get the endpoint reference
        EndpointReferenceType endpointReference = subscribe.getConsumerReference();
        AttributedURI address = endpointReference.getAddress();
        System.out.println("EndpointReference address is: " + address.getStringValue());

        ReferencePropertiesType referenceProperties = endpointReference.getReferenceProperties();
        System.out.println("Reference properties: " + referenceProperties);


        // lets get the selector
        QueryExpressionType selector = subscribe.getSelector();
View Full Code Here

        final NormalizedMessage message = exchange.getMessage("in");
        if (message == null) {
            log.warn("Ignoring message exchange with no 'in' message");
        }
        else {
            final EndpointReferenceType endpointReference = extractPublisherReference(exchange, message);
            Topic topic = extractTopic(exchange, message);
            if (topic == null) {
                throw new MissingTopicException();
            }
            ActiveMQPublisherRegistration publisher = getPublisher(endpointReference);
View Full Code Here

            protected org.servicemix.ws.notification.NotificationConsumer createNotificationConsumer(EndpointReferenceType consumerReference) {
                return new StubNotificationConsumer(result);
            }
        };

        EndpointReferenceType subRef = addSubscription(broker);
       
        // The sub should be running and we should be getting notifed now.
        sendNotification(broker);
        NotifyDocument subNotifyDoc = (NotifyDocument) result.poll(2000);
        assertNotNull(subNotifyDoc);
View Full Code Here

        else {
            // We could default a sensible timeout here.
        }
       
        // Create publisher and assoicate an EndpointReference with it.
        EndpointReferenceType registrationEndpointReference;
        try {

            ActiveMQPublisherRegistration publisher = new ActiveMQPublisherRegistration(connection);
            registrationEndpointReference = publisherManager.register(publisher);
            publisher.setEndpointReference(registrationEndpointReference);
View Full Code Here

            Notify notify = requestDoc.getNotify();
            NotificationMessageHolderType[] messageHolders = notify.getNotificationMessageArray();
            for (int i = 0; i < messageHolders.length; i++) {
                NotificationMessageHolderType messageHolder = messageHolders[i];
                Topic topic = TopicExpressionConverter.toActiveMQTopic(messageHolder.getTopic());
                EndpointReferenceType producerReference = messageHolder.getProducerReference();
                ActiveMQPublisherRegistration publisher = getPublisher(producerReference);
                publisher.notify(topic, messageHolder.getMessage());
            }
        }
        catch (IOException e) {
View Full Code Here

        }
        catch (JMSException e) {
            throw new NotificationException(e);
        }

        EndpointReferenceType endpointReference = subscriptionManager.register(subscription);
        subscription.setEndpointReference(endpointReference);
       
        // Send response.
        SubscribeResponseDocument responseDoc = SubscribeResponseDocument.Factory.newInstance();
        responseDoc.addNewSubscribeResponse().setSubscriptionReference(endpointReference);
View Full Code Here

    public ActiveMQSubscription removeSubscription(EndpointReferenceType subscriptionReference) {
        return (ActiveMQSubscription) subscriptions.remove(toReferenceId(subscriptionReference));
    }
   
    private EndpointReferenceType toEndpointReference(String ref) {
        EndpointReferenceType rc = EndpointReferenceType.Factory.newInstance();
        rc.addNewAddress().setStringValue(address);
        ReferencePropertiesType props = rc.addNewReferenceProperties();
        XmlCursor cursor = props.newCursor();
        cursor.setTextValue(ref);
        return rc;
    }
View Full Code Here

    private void dispatch(TopicExpressionType topic, XmlObject xml) {
        NotifyDocument request = NotifyDocument.Factory.newInstance();
        Notify notify = request.addNewNotify();
        NotificationMessageHolderType messageHolder = notify.addNewNotificationMessage();

        EndpointReferenceType producerReference = getProducerReference();
        if (producerReference != null) {
            messageHolder.setProducerReference((EndpointReferenceType) producerReference.copy());
        }
        messageHolder.setTopic(topic);
        messageHolder.setMessage(xml);

        notificationConsumer.notify(request);
View Full Code Here

TOP

Related Classes of org.servicemix.ws.xmlbeans.addressing.v2003_03.impl.ToDocumentImpl

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.