Examples of publish()


Examples of org.axonframework.eventhandling.ClusteringEventBus.publish()

        EventBus eventBus = new ClusteringEventBus(clusterSelector);
        eventBus.subscribe(new AnnotationEventListenerAdapter(new ThreadPrintingEventListener()));
        eventBus.subscribe(new AnnotationEventListenerAdapter(new AnotherThreadPrintingEventListener()));

        // publish an event
        eventBus.publish(asEventMessage(new ToDoItemCompletedEvent("todo1")));

        // we need to shutdown the executor we have created to prevent the JVM from hanging on shutdown
        // this also wait until all scheduled tasks for that thread have been executed
        executor.shutdown();
    }
View Full Code Here

Examples of org.axonframework.eventhandling.EventBus.publish()

        EventBus eventBus = new ClusteringEventBus(clusterSelector);
        eventBus.subscribe(new AnnotationEventListenerAdapter(new ThreadPrintingEventListener()));
        eventBus.subscribe(new AnnotationEventListenerAdapter(new AnotherThreadPrintingEventListener()));

        // publish an event
        eventBus.publish(asEventMessage(new ToDoItemCompletedEvent("todo1")));

        // we need to shutdown the executor we have created to prevent the JVM from hanging on shutdown
        // this also wait until all scheduled tasks for that thread have been executed
        executor.shutdown();
    }
View Full Code Here

Examples of org.axonframework.eventhandling.SimpleEventBus.publish()

        // That's the infrastructure we need...
        // Let's pretend a few things are happening

        // We create 2 items
        eventBus.publish(asEventMessage(new ToDoItemCreatedEvent("todo1", "Got something to do")));
        eventBus.publish(asEventMessage(new ToDoItemCreatedEvent("todo2", "Got something else to do")));
        // We mark the first completed, before the deadline expires. The Saga has a hard-coded deadline of 2 seconds
        eventBus.publish(asEventMessage(new ToDoItemCompletedEvent("todo1")));
        // we wait 3 seconds. Enough time for the deadline to expire
        Thread.sleep(3000);
View Full Code Here

Examples of org.cometd.Channel.publish()

                }
                else
                {
                    Channel channel = _oort._bayeux.getChannel(msg.getChannel(),false);
                    if (channel!=null)
                        channel.publish(_oort._oortClient,msg.getData(),msg.getId());
                }
            }
        }
    }
}
View Full Code Here

Examples of org.cometd.bayeux.client.ClientSessionChannel.publish()

                messageLatch.get().countDown();
            }
        });

        abort.set(true);
        channel.publish(new HashMap<String, Object>());
        Assert.assertTrue(publishLatch.get().await(10, TimeUnit.SECONDS));
        Assert.assertFalse(client.isConnected());

        // Message must not be received
        Assert.assertFalse(messageLatch.get().await(1, TimeUnit.SECONDS));
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel.publish()

  public void serverPut(OutputLine line) {
    this.log.add(line);
    ServerChannel channel = this.bayeux.getChannel("/outputlog");
    if (channel != null) {
      channel.publish(this.localSession, line, null);
    }
  }

  @Listener("/service/outputlog/put")
  public void processPut(ServerSession session, ServerMessage msg)
View Full Code Here

Examples of org.directwebremoting.Hub.publish()

        WebContext webContext = WebContextFactory.get();
        ConverterManager converterManager = webContext.getContainer().getBean(ConverterManager.class);
        Hub hub = HubFactory.get();

        MessageEvent event = new DefaultMessageEvent(hub, converterManager, data);
        hub.publish(topic, event);
    }

    /**
     * Ensure that the clients know about server publishes
     * @param topic The topic being subscribed to
View Full Code Here

Examples of org.docx4j.events.StartEvent.publish()

    if (twoPass) {
      //1st pass in 2 pass
      log.debug("1st pass in 2 pass");
     
      StartEvent startEvent = new StartEvent( settings.getWmlPackage(), WellKnownProcessSteps.FOP_RENDER_PASS1 );
      startEvent.publish();
     
      placeholderLookup = new FopPlaceholderLookup(pageNumberInformation);
      formattingResults = calcResults(fopFactory, apacheFopMime, foDocumentSrc, placeholderLookup);
      placeholderLookup.setResults(formattingResults);
      foDocumentSrc = new StreamSource(new StringReader(foDocument));
View Full Code Here

Examples of org.eclipse.paho.client.mqttv3.MqttClient.publish()

        Session s = activeMQConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageConsumer consumer = s.createConsumer(s.createTopic("test"));

        MqttClient client = new MqttClient("tcp://localhost:" + mqttConnector.getConnectUri().getPort(), "clientid", new MemoryPersistence());
        client.connect();
        client.publish("test", "hello".getBytes(), 1, false);

        Message msg = consumer.receive(100 * 5);
        assertNotNull(msg);

        client.disconnect();
View Full Code Here

Examples of org.eclipse.paho.client.mqttv3.MqttTopic.publish()

    private void publish(MqttClient client, String topicName, int qos, byte[] payload) throws MqttException {
      MqttTopic topic = client.getTopic(topicName);
       MqttMessage message = new MqttMessage(payload);
      message.setQos(qos);
      MqttDeliveryToken token = topic.publish(message);
      token.waitForCompletion();
    }

    public void connectionLost(Throwable cause) {
        if (!expectConnectionFailure)
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.