use of io.vertx.core.impl.VertxInternal in project java-chassis by ServiceComb.
the class TcpClientVerticle method start.
@Override
public void start() throws Exception {
super.start();
clientConfig = (TcpClientConfig) config().getValue(CLIENT_OPTIONS);
// vertx.createNetClient()创建出来的netClient不支持跨线程调用
netClient = new NetClientImpl((VertxInternal) vertx, clientConfig, false);
}
use of io.vertx.core.impl.VertxInternal in project vertx-openshift-it by cescoffier.
the class EventBusReceiverVerticle method createHealthChecks.
private HealthChecks createHealthChecks() {
return HealthChecks.create(vertx).register("ispn-cluster-status", future -> {
VertxInternal vertxInternal = (VertxInternal) vertx;
InfinispanClusterManager clusterManager = (InfinispanClusterManager) vertxInternal.getClusterManager();
EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) clusterManager.getCacheContainer();
Health health = cacheManager.getHealth();
HealthStatus healthStatus = health.getClusterHealth().getHealthStatus();
Status status = new Status().setOk(healthStatus == HealthStatus.HEALTHY).setData(JsonObject.mapFrom(health));
future.complete(status);
});
}
use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class RunCommand method run.
/**
* Starts vert.x and deploy the verticle.
*/
@Override
public void run() {
if (redeploy == null || redeploy.isEmpty()) {
JsonObject conf = getConfiguration();
if (conf == null) {
conf = new JsonObject();
}
afterConfigParsed(conf);
super.run(this::afterStoppingVertx);
if (vertx == null) {
// Already logged.
ExecUtils.exitBecauseOfVertxInitializationIssue();
}
if (vertx instanceof VertxInternal) {
((VertxInternal) vertx).addCloseHook(this);
}
deploymentOptions = new DeploymentOptions();
configureFromSystemProperties(deploymentOptions, DEPLOYMENT_OPTIONS_PROP_PREFIX);
deploymentOptions.setConfig(conf).setWorker(worker).setHa(ha).setInstances(instances);
beforeDeployingVerticle(deploymentOptions);
deploy();
} else {
// redeploy is set, start the redeployment infrastructure (watcher).
initializeRedeployment();
}
}
use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class ComplexHATest method takeDeploymentSnapshot.
protected Set<Deployment> takeDeploymentSnapshot(int pos) {
Set<Deployment> snapshot = new ConcurrentHashSet<>();
VertxInternal v = (VertxInternal) vertices[pos];
for (String depID : v.deploymentIDs()) {
snapshot.add(v.getDeployment(depID));
}
return snapshot;
}
use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class ComplexHATest method kill.
protected void kill(int pos) {
// Save the deploymentIDs first
takeDeploymentSnapshots();
VertxInternal v = (VertxInternal) vertices[pos];
killedNode = pos;
v.executeBlocking(fut -> {
v.simulateKill();
fut.complete();
}, false, ar -> {
assertTrue(ar.succeeded());
});
}
Aggregations