All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.core.eventbus.FilteringInterceptor Maven / Gradle / Ivy

There is a newer version: 4.5.10
Show newest version
package io.vertx.core.eventbus;

import io.vertx.core.Handler;

/**
 * @author Tim Fox
 */
public abstract class FilteringInterceptor implements Handler {

  private final String startsWith;

  public FilteringInterceptor(String startsWith) {
    this.startsWith = startsWith;
  }

  // TODO regex

  @Override
  public void handle(SendContext sendContext) {
    if (sendContext.message().address().startsWith(startsWith)) {
      handleContext(sendContext);
    } else {
      sendContext.next();
    }
  }

  protected abstract void handleContext(SendContext sendContext);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy