Examples of Subscription


Examples of net.engio.mbassy.subscription.Subscription

            Collection<Subscription> subscriptions = manager.getSubscriptionsByMessageType(messageType);
            ensureOrdering(subscriptions);
            Collection<ValidationEntry> validationEntries = getEntries(EntriesByMessageType(messageType));
            assertEquals(subscriptions.size(), validationEntries.size());
            for(ValidationEntry validationValidationEntry : validationEntries){
                Subscription matchingSub = null;
                // one of the subscriptions must belong to the subscriber type
                for(Subscription sub : subscriptions){
                    if(sub.belongsTo(validationValidationEntry.subscriber)){
                        matchingSub = sub;
                        break;
                    }
                }
                assertNotNull(matchingSub);
                assertEquals(subscribedListener.getNumberOfListeners(validationValidationEntry.subscriber), matchingSub.size());
            }
        }
    }
View Full Code Here

Examples of org.activemq.service.Subscription

        // unless via the deleteSubscription() method
       
//        subscriptionContainer.removeSubscription(info.getConsumerId());
//        subscription.clear();
       
        Subscription sub = (Subscription) activeSubscriptions.remove(info.getConsumerId());
        if (sub != null) {
            sub.setActive(false);
            dispatcher.removeActiveSubscription(client, sub);
        }
    }
View Full Code Here

Examples of org.apache.activemq.broker.region.Subscription

     * @return the assocated subscription
     * @throws Exception
     */
    public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
        sendAsyncToSlave(info);
        Subscription answer = super.addConsumer(context, info);
        return answer;
    }
View Full Code Here

Examples of org.apache.airavata.workflow.tracking.client.Subscription

    }

    private boolean wait = true;

    public void testMessagePulling() throws Exception {
        Subscription subscription = null;

        Callback testCallback1 = new Callback() {
            public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
                System.out.println("Notification Received, notification of type:" + type);
                // assertEquals(type, NotificationType.WorkflowInitialized);
                wait = false;
            }
        };

        subscription = LeadNotificationManager.createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TEST_TOPIC,
                null, testCallback1);

        System.out.println(subscription.getMessageBoxEPR());
        System.out.println(subscription.getSubscriptionID());

        WseMsgBrokerClient client = new WseMsgBrokerClient();
        client.init(BROKER_URL);

        OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));

        client.publish(TEST_TOPIC, msg);

        EndpointReference MSG_BOX_EPR = subscription.getMessageBoxEPR();
        System.out.println(MSG_BOX_EPR);
        String subscriptionID = subscription.getSubscriptionID();
        Callback testCallback2 = new Callback() {

            public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {

                System.out.println("Notification Received, notification of type:" + type);
                // This assertion is wrong because type and NotificationType.WorkflowInitialized are two different types
                // assertEquals(type, NotificationType.WorkflowInitialized);
                wait = false;

            }
        };
        subscription = LeadNotificationManager.startListeningToSavedSubscription(BROKER_URL, MSG_BOX_EPR,
                subscriptionID, TEST_TOPIC, null, testCallback2, true);

        System.out.println(subscription.getMessageBoxEPR());

        while (wait) {

            Thread.sleep(1000);

        }

        System.out.println("MessagePuller test completed");
        subscription.destroy();
    }
View Full Code Here

Examples of org.apache.cxf.management.web.browser.client.service.settings.Subscription

            String urlValue = url.getValue();

            if (id == null) {
                settingsFacade.addSubscription(nameValue, urlValue);
            } else {
                settingsFacade.updateSubscription(new Subscription(id, nameValue, urlValue));
            }

            updateSubscriptions();
            subscriptionDialog.hide();
        } else {
View Full Code Here

Examples of org.apache.cxf.wsn.client.Subscription

    public void testBroker() throws Exception {
        TestConsumer callback = new TestConsumer();
        Consumer consumer = new Consumer(callback, "http://localhost:" + port2 + "/test/consumer");

        Subscription subscription = notificationBroker.subscribe(consumer, "myTopic");

        synchronized (callback.notifications) {
            notificationBroker.notify("myTopic",
                                      new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                          String.class, "bar"));
            callback.notifications.wait(1000000);
        }
        assertEquals(1, callback.notifications.size());
        NotificationMessageHolderType message = callback.notifications.get(0);
        assertEquals(WSNHelper.getWSAAddress(subscription.getEpr()),
                     WSNHelper.getWSAAddress(message.getSubscriptionReference()));

        subscription.unsubscribe();
        consumer.stop();
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.Subscription

        public void run() {
            while (!Thread.interrupted() && !disposeChangeFeed) {
                try {
                    InternalEventListener[] iel;
                    Subscription subscr;
                    synchronized (listeners) {
                        while (subscription == null) {
                            listeners.wait();
                        }
                        iel = listeners.toArray(new InternalEventListener[0]);
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.Subscription

        SubscriptionInfo info = request.getSubscriptionInfo();
        if (info == null) {
            response.sendError(DavServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
            return;
        }
        Subscription subs = ((ObservationResource) resource).subscribe(info, request.getSubscriptionId());
        response.sendSubscriptionResponse(subs);
    }
View Full Code Here

Examples of org.apache.james.mailbox.store.user.model.Subscription

        final SubscriptionMapper mapper = mapperFactory.getSubscriptionMapper(session);
        try {
            mapper.execute(new Mapper.VoidTransaction() {

                public void runVoid() throws MailboxException {
                    final Subscription subscription = mapper.findMailboxSubscriptionForUser(session.getUser().getUserName(), mailbox);
                    if (subscription == null) {
                        final Subscription newSubscription = createSubscription(session, mailbox);
                        mapper.save(newSubscription);
                    }
                }
               
            });
View Full Code Here

Examples of org.apache.juddi.datatype.subscription.Subscription

  public RegistryObject unmarshal(Element element)
  {
    // TODO (UDDI v3) Fill out SubscriptoinHandler.unmarshal()
     
    Subscription obj = new Subscription();

    // Attributes
    obj.setSubscriptionKey(element.getAttribute("subscriptionKey"));

    // Text Node Value
    // [none]

    // Child Elements
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.