当前位置: 首页>>代码示例>>Java>>正文


Java VertxInternal类代码示例

本文整理汇总了Java中io.vertx.core.impl.VertxInternal的典型用法代码示例。如果您正苦于以下问题:Java VertxInternal类的具体用法?Java VertxInternal怎么用?Java VertxInternal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VertxInternal类属于io.vertx.core.impl包,在下文中一共展示了VertxInternal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
@Override
public Object execute() throws Exception {
    
    ShellTable table = new ShellTable();
    
    table.column("ID");
    table.column("Identifier");
    table.column("Options");
    
    getVertxService().deploymentIDs().forEach(id -> { 
            Deployment deployment = ((VertxInternal)getVertxService()).getDeployment(id);
            Row row = table.addRow();
            row.addContent(id, deployment.verticleIdentifier(), deployment.deploymentOptions().toJson());
        }
    );
    
    try {
        table.print(System.out);
    } catch (Throwable t)  {
        System.err.println("FAILED to write table");
    }
    
    return null;
}
 
开发者ID:ANierbeck,项目名称:Karaf-Vertx,代码行数:25,代码来源:VerticlesList.java

示例2: lookupHolder

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
private EmfProvidereHolder lookupHolder() {

    synchronized (vertx) {
      LocalMap<String, EmfProvidereHolder> map = vertx.sharedData().getLocalMap(DS_LOCAL_MAP_NAME);
      EmfProvidereHolder theHolder = map.get(datasourceName);
      if (theHolder == null) {
        theHolder = new EmfProvidereHolder((VertxInternal) vertx, config, map, datasourceName);
      } else {
        theHolder.incRefCount();
      }
      return theHolder;
    }

  }
 
开发者ID:pflima92,项目名称:vertx-jpa,代码行数:15,代码来源:EntityManagerProviderImpl.java

示例3: EmfProvidereHolder

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
public EmfProvidereHolder(VertxInternal vertx, JsonObject config, LocalMap<String, EmfProvidereHolder> map, String name) {
  this.name = name;
  this.config = config;
  this.vertx = vertx;
  this.map = map;
  this.emfProvider = initializeProvider().setConfig(config).setVertx(vertx);
}
 
开发者ID:pflima92,项目名称:vertx-jpa,代码行数:8,代码来源:EntityManagerProviderImpl.java

示例4: CircuitBreakerMetrics

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
CircuitBreakerMetrics(Vertx vertx, CircuitBreakerImpl circuitBreaker, CircuitBreakerOptions options) {
  this.circuitBreaker = circuitBreaker;
  this.circuitBreakerTimeout = circuitBreaker.options().getTimeout();
  this.circuitBreakerResetTimeout = circuitBreaker.options().getResetTimeout();
  this.node = vertx.isClustered() ? ((VertxInternal) vertx).getClusterManager().getNodeID() : "local";
  this.rollingWindow = new RollingWindow(options.getMetricsRollingWindow(), options.getMetricsRollingBuckets());
}
 
开发者ID:vert-x3,项目名称:vertx-circuit-breaker,代码行数:8,代码来源:CircuitBreakerMetrics.java

示例5: getNodeId

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
private String getNodeId(Vertx vertx) {
  if (vertx.isClustered()) {
    return ((VertxInternal) vertx).getNodeID();
  } else {
    return "localhost";
  }
}
 
开发者ID:vert-x3,项目名称:vertx-service-discovery,代码行数:8,代码来源:DiscoveryImpl.java

示例6: setUp

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
@Before
public void setUp() {
  Vertx.clusteredVertx(new VertxOptions(), ar -> {
    ((VertxInternal) ar.result()).getClusterManager().<String, String>getAsyncMap("some-name", x -> {
      map = x.result();
      vertx = ar.result();
    });
  });
  await().until(() -> vertx != null);
}
 
开发者ID:vert-x3,项目名称:vertx-service-discovery,代码行数:11,代码来源:ClusteredAsyncMapTest.java

示例7: registerReadinessChecks

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
/**
 * Registers a check which succeeds if a connection with the configured <em>Authentication</em> service can be established.
 *
 * @param readinessHandler The health check handler to register the checks with.
 */
@Override
public void registerReadinessChecks(final HealthCheckHandler readinessHandler) {

    if (dnsClient != null) {
        log.info("registering readiness check using DNS Client");
        readinessHandler.register("authentication-service-availability", status -> {
            log.trace("checking availability of Authentication service");
            dnsClient.lookup(getConfig().getHost(), lookupAttempt -> {
                if (lookupAttempt.succeeded()) {
                    status.tryComplete(Status.OK());
                } else {
                    log.debug("readiness check failed to resolve Authentication service address [{}]: ",
                            getConfig().getHost(), lookupAttempt.cause().getMessage());
                    status.tryComplete(Status.KO());
                }
            });
        });
    } else if (VertxInternal.class.isInstance(vertx)) {
        log.info("registering readiness check using vert.x Address Resolver");
        readinessHandler.register("authentication-service-availability", status -> {
            log.trace("checking availability of Authentication service");
            ((VertxInternal) vertx).resolveAddress(getConfig().getHost(), lookupAttempt -> {
                if (lookupAttempt.succeeded()) {
                    status.tryComplete(Status.OK());
                } else {
                    log.debug("readiness check failed to resolve Authentication service address [{}]: ",
                            getConfig().getHost(), lookupAttempt.cause().getMessage());
                    status.tryComplete(Status.KO());
                };
            });
        });
    } else {
        log.warn("cannot register readiness check, no DNS resolver available");
    }
}
 
开发者ID:eclipse,项目名称:hono,代码行数:41,代码来源:DelegatingAuthenticationService.java

示例8: getNodeId

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
private static String getNodeId(Vertx vertx) {
    if (vertx.isClustered()) {
        return ((VertxInternal) vertx).getNodeID();
    } else {
        return "localhost";
    }
}
 
开发者ID:engagingspaces,项目名称:vertx-graphql-service-discovery,代码行数:8,代码来源:AbstractRegistrar.java

示例9: AsyncMultiMapImpl

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param cache {@link IgniteCache} instance.
 * @param vertx {@link Vertx} instance.
 */
public AsyncMultiMapImpl(IgniteCache<K, Set<V>> cache, Vertx vertx) {
  cache.unwrap(Ignite.class).events().localListen((IgnitePredicate<Event>)event -> {
    if (!(event instanceof CacheEvent)) {
      throw new IllegalArgumentException("Unknown event received: " + event);
    }

    CacheEvent cacheEvent = (CacheEvent)event;

    if (Objects.equals(cacheEvent.cacheName(), cache.getName()) &&
        ((IgniteCacheProxy)cache).context().localNodeId().equals(cacheEvent.eventNode().id())) {
      K key = unmarshal(cacheEvent.key());

      switch (cacheEvent.type()) {
        case EVT_CACHE_OBJECT_REMOVED:
          subs.remove(key);
          break;

        default:
          throw new IllegalArgumentException("Unknown event received: " + event);
      }
    }

    return true;
  }, EVT_CACHE_OBJECT_REMOVED);

  this.cache = cache;
  this.vertx = (VertxInternal) vertx;
}
 
开发者ID:vert-x3,项目名称:vertx-ignite,代码行数:35,代码来源:AsyncMultiMapImpl.java

示例10: InfinispanAsyncMultiMap

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
public InfinispanAsyncMultiMap(Vertx vertx, Cache<MultiMapKey, Object> cache) {
  this.vertx = (VertxInternal) vertx;
  this.cache = cache;
  nearCache = new ConcurrentHashMap<>();
  cache.addListener(new EntryListener());
  taskQueue = new TaskQueue();
}
 
开发者ID:vert-x3,项目名称:vertx-infinispan,代码行数:8,代码来源:InfinispanAsyncMultiMap.java

示例11: sendUpdateOnEventBus

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
private void sendUpdateOnEventBus() {
  vertx.eventBus().publish("circuit-breaker[" + name + "]", new JsonObject()
      .put("name", name)
      .put("state", state)
      .put("failures", failures)
      .put("node", vertx.isClustered() ? ((VertxInternal) vertx).getClusterManager().getNodeID() : "local"));
}
 
开发者ID:cescoffier,项目名称:vertx-discovery-service,代码行数:8,代码来源:CircuitBreakerImpl.java

示例12: ExtendedAsyncMapImpl

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
public ExtendedAsyncMapImpl(Vertx vertx, String name) {
  this.vertx = vertx;
  ClusterManager clusterManager = ((VertxInternal) vertx).getClusterManager();
  if (clusterManager == null) {
    syncMap = new ConcurrentHashMap<>();
  } else {
    syncMap = clusterManager.getSyncMap(name);
  }
}
 
开发者ID:cescoffier,项目名称:vertx-discovery-service,代码行数:10,代码来源:ExtendedAsyncMapImpl.java

示例13: getCounter

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
/**
 * Get a local counter. The counter will be passed to the handler.
 *
 * @param name the name of the counter.
 * @param resultHandler the handler
 */
public void getCounter(String name, Handler<AsyncResult<Counter>> resultHandler) {
  Objects.requireNonNull(name, "name");
  Objects.requireNonNull(resultHandler, "resultHandler");
  Counter counter = this.localCounters
      .computeIfAbsent(name, (n) -> new AsynchronousCounter((VertxInternal) this.vertx));
  Context context = this.vertx.getOrCreateContext();
  context.runOnContext((v) -> resultHandler.handle(Future.succeededFuture(counter)));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:15,代码来源:LocalData.java

示例14: CommandRegistryImpl

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
public CommandRegistryImpl(VertxInternal vertx) {
  this.vertx = vertx;
  hook = completionHandler -> {
    try {
      doClose();
      registries.remove(vertx);
    } catch (Exception e) {
      completionHandler.handle(Future.failedFuture(e));
      return;
    }
    completionHandler.handle(Future.succeededFuture());
  };
  vertx.addCloseHook(hook);
}
 
开发者ID:vert-x3,项目名称:vertx-shell,代码行数:15,代码来源:CommandRegistryImpl.java

示例15: kill

import io.vertx.core.impl.VertxInternal; //导入依赖的package包/类
protected void kill(int pos) {
  VertxInternal v = (VertxInternal) vertices[pos];
  v.executeBlocking(fut -> {
    v.simulateKill();
    fut.complete();
  }, ar -> {
    assertTrue(ar.succeeded());
  });
}
 
开发者ID:vert-x3,项目名称:vertx-jgroups,代码行数:10,代码来源:JGroupsClusteredEventbusTest.java


注:本文中的io.vertx.core.impl.VertxInternal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。