Examples of NotificationProducer


Examples of org.activemq.ws.notification.NotificationProducer

            advisor.start();
        }
    }
   
    protected void fireDemandChangeEvent(boolean inDemand) {
        NotificationProducer p = createPublisherNotificationProducer();
        if( inDemand ) {
            SubscribeDocument requestDoc = SubscribeDocument.Factory.newInstance();
            Subscribe subscribe = requestDoc.addNewSubscribe();
            subscribe.setTopicExpression( TopicExpressionConverter.toTopicExpression(topic) );
            subscribe.setUseNotify(true);
            subscribe.setConsumerReference(endpointReference);
            SubscribeResponseDocument reponse = p.Subscribe(requestDoc);
        } else {
            UnsubscribeDocument requestDoc = UnsubscribeDocument.Factory.newInstance();
            Unsubscribe unsubscribe = requestDoc.addNewUnsubscribe();           
        }
    }
View Full Code Here

Examples of org.activemq.ws.notification.NotificationProducer

            Unsubscribe unsubscribe = requestDoc.addNewUnsubscribe();           
        }
    }

    protected NotificationProducer createPublisherNotificationProducer() {
        return new NotificationProducer() {
            public SubscribeResponseDocument Subscribe(SubscribeDocument request) {
                throw new RuntimeException("Not implemented");
            }
            public GetCurrentMessageResponseDocument getCurrentMessage(GetCurrentMessageDocument request) {
                throw new RuntimeException("Not implemented");
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

        manager.addListener(this);
               
        //
        // initialize the advertisement topics
        //
        NotificationProducer wsn =
            (NotificationProducer)resource.getCapability(WsnConstants.PRODUCER_URI);
       
        wsn.addTopic(MuwsConstants.ADV_ME_CREATION_TOPIC);
        wsn.addTopic(MuwsConstants.ADV_ME_DESTRUCTION_TOPIC);
       
        //
        // create subscriptions for all event consumer that are going to
        // receive notifications from the above topics
        //
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

       
        Situation situation = factory.createSituation();
        situation.setCategoryType(situationCategory);
        event.setSituation(situation);

        NotificationProducer wsn = (NotificationProducer)advertiser.getCapability(WsnConstants.PRODUCER_URI);
        wsn.publish(topicName, event.toXML());
    }
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

            Document eprDoc = env.getDocument(fileName);
            Element eprXML = XmlUtils.getFirstElement(eprDoc);
           
            EndpointReference epr = new EndpointReference(eprXML);
           
            NotificationProducer wsn =
                (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);
           
            wsn.subscribe(epr, new TopicFilter(MuwsConstants.ADV_ME_CREATION_TOPIC), null, null);
            wsn.subscribe(epr, new TopicFilter(MuwsConstants.ADV_ME_DESTRUCTION_TOPIC), null, null);
        }
    }
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

        Filter filter = pullPointCap.getFilter();
       
        //
        // create subscription that will send messages to the pullpoint
        //
        NotificationProducer wsn = (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);
        WsResource sub = null;
       
        try
        {
            sub = wsn.subscribe(epr, filter, null, null);
        }
       
        catch (BaseFault error)
        {
            throw new UnableToCreatePullPointFault(error);
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

     * @return An instance of ChangeNotificationListener.
     *
     */
    public PropertyChangeListener newInstance(QName property, WsResource resource)
    {
        NotificationProducer wsn = (NotificationProducer)resource.getCapability(WsnConstants.PRODUCER_URI);
        return new ChangeNotificationListener(property, wsn);
    }
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

     * @return An instance of ChangeNotificationListener.
     *
     */
    public PropertyChangeListener newInstance(QName property, WsResource resource)
    {
        NotificationProducer wsn = (NotificationProducer)resource.getCapability(WsnConstants.PRODUCER_URI);
        return new ChangeNotificationListener(property, wsn);
    }
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

        manager.addListener(this);
               
        //
        // initialize the advertisement topics
        //
        NotificationProducer wsn =
            (NotificationProducer)resource.getCapability(WsnConstants.PRODUCER_URI);
       
        wsn.addTopic(MuwsConstants.ADV_ME_CREATION_TOPIC);
        wsn.addTopic(MuwsConstants.ADV_ME_DESTRUCTION_TOPIC);
       
        //
        // create subscriptions for all event consumer that are going to
        // receive notifications from the above topics
        //
View Full Code Here

Examples of org.apache.muse.ws.notification.NotificationProducer

       
        Situation situation = factory.createSituation();
        situation.setCategoryType(situationCategory);
        event.setSituation(situation);

        NotificationProducer wsn = (NotificationProducer)advertiser.getCapability(WsnConstants.PRODUCER_URI);
        wsn.publish(topicName, event.toXML());
    }
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.