Examples of registerHandler()


Examples of edu.stanford.bmir.protege.web.shared.event.EventBusManager.registerHandler()

        handlerRegistrations.add(reg);
    }

    public <T> void addApplicationEventHandler(Event.Type<T> type, T handler) {
        EventBusManager manager = EventBusManager.getManager();
        HandlerRegistration reg = manager.registerHandler(checkNotNull(type), checkNotNull(handler));
        handlerRegistrations.add(reg);
    }


    public boolean isEventForThisProject(Event<?> event) {
View Full Code Here

Examples of io.crate.rest.CrateRestMainAction.registerHandler()

            encounter.register(new InjectionListener<I>() {
                @Override
                public void afterInjection(I injectee) {
                    try {
                        CrateRestMainAction crateRestMainAction = instanceFuture.get(10, TimeUnit.SECONDS);
                        crateRestMainAction.registerHandler();
                    } catch (Exception e) {
                        logger.error("Could not register CrateRestMainAction handler", e);
                    }
                }
            });
View Full Code Here

Examples of io.vertx.rxcore.java.eventbus.RxEventBus.registerHandler()

public class EventBusIntegrationTest extends TestVerticle {

  @Test
  public void testSimpleSubscribeReply() {
    RxEventBus rxEventBus = new RxEventBus(vertx.eventBus());
    rxEventBus.<String>registerHandler("foo").subscribe(new Action1<RxMessage<String>>() {
      @Override
      public void call(RxMessage<String> message) {
        message.reply("pong!");
      }
    });
View Full Code Here

Examples of io.vertx.rxcore.java.eventbus.RxEventBus.registerHandler()

  public void testSimpleSerial() {
    final RxEventBus rxEventBus = new RxEventBus(vertx.eventBus());
    final AtomicInteger totalReqs = new AtomicInteger(3);
    final AtomicInteger activeReqs = new AtomicInteger(0);
   
    rxEventBus.<String>registerHandler("foo").subscribe(new Action1<RxMessage<String>>() {
      @Override
      public void call(RxMessage<String> message) {
        System.out.println("serial-foo["+message.body()+"]");
        message.reply("pong!");
        activeReqs.incrementAndGet();
View Full Code Here

Examples of io.vertx.rxcore.java.eventbus.RxEventBus.registerHandler()

  @Test
  // Send some messages in series where next message sent is function of reply from previous message
  public void testSerial() {
    final RxEventBus rxEventBus = new RxEventBus(vertx.eventBus());

    rxEventBus.<String>registerHandler("foo").subscribe(new Action1<RxMessage<String>>() {
      @Override
      public void call(RxMessage<String> message) {
        message.reply(message.body());
      }
    });
View Full Code Here

Examples of io.vertx.rxcore.java.eventbus.RxEventBus.registerHandler()

  // Send some messages in parallel and wait for all replies before doing something
  public void testGather() {

    final RxEventBus rxEventBus = new RxEventBus(vertx.eventBus());

    rxEventBus.<String>registerHandler("foo").subscribe(new Action1<RxMessage<String>>() {
      @Override
      public void call(RxMessage<String> msg) {
        msg.reply("pong"+msg.body());
      }
    });
View Full Code Here

Examples of io.vertx.rxcore.java.eventbus.RxEventBus.registerHandler()

  @Test
  // Send some messages in parallel and return result of concatenating all the messages
  public void testConcatResults() {
    final RxEventBus rxEventBus = new RxEventBus(vertx.eventBus());

    rxEventBus.<String>registerHandler("foo").subscribe(new Action1<RxMessage<String>>() {
      @Override
      public void call(RxMessage<String> msg) {
        msg.reply("pong"+msg.body());
      }
    });
View Full Code Here

Examples of io.vertx.rxcore.java.eventbus.RxEventBus.registerHandler()

  @Test
  public void testSimpleRegisterHandler() {
    final RxEventBus rxEventBus = new RxEventBus(vertx.eventBus());

    Observable<RxMessage<String>> obs = rxEventBus.registerHandler("foo");

    assertMessageThenComplete(obs.take(1),"hello");

    // Send using core EventBus
    vertx.eventBus().send("foo", "hello");
View Full Code Here

Examples of io.vertx.rxcore.java.eventbus.RxEventBus.registerHandler()

  @Test
  public void testReplyToReply() {
    final RxEventBus rxEventBus = new RxEventBus(vertx.eventBus());

    Observable<RxMessage<String>> obsReply1 = rxEventBus.registerHandler("foo");

    Observable<RxMessage<String>> obsReply2 = obsReply1.flatMap(new Func1<RxMessage<String>, Observable<RxMessage<String>>>() {
      @Override
      public Observable<RxMessage<String>> call(RxMessage<String> stringRxMessage) {
        // Reply to the message
View Full Code Here

Examples of logisticspipes.modules.abstractmodules.LogisticsModule.registerHandler()

        if(currentModule != null) {
          if (module.getILogisticsModuleClass().equals(currentModule.getClass())) return currentModule;
        }
        LogisticsModule newmodule = module.getILogisticsModule();
        if(newmodule == null) return null;
        newmodule.registerHandler(world, service);
        return newmodule;
      }
    }
    return null;
  }
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.