本文整理汇总了Java中io.vertx.codegen.annotations.GenIgnore类的典型用法代码示例。如果您正苦于以下问题:Java GenIgnore类的具体用法?Java GenIgnore怎么用?Java GenIgnore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenIgnore类属于io.vertx.codegen.annotations包,在下文中一共展示了GenIgnore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProxy
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
/**
* Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).
* This is a convenient method to avoid explicit lookup and then retrieval of the service. A filter based on the
* request interface is used.
*
* @param discovery the service discovery instance
* @param itf the service interface
* @param resultHandler the result handler
* @param <T> the service interface
* @return {@code null}
*/
@GenIgnore // Java only
static <T> T getProxy(ServiceDiscovery discovery, Class<T> itf, Handler<AsyncResult<T>>
resultHandler) {
JsonObject filter = new JsonObject().put("service.interface", itf.getName());
discovery.getRecord(filter, ar -> {
if (ar.failed()) {
resultHandler.handle(Future.failedFuture(ar.cause()));
} else {
if (ar.result() == null) {
resultHandler.handle(Future.failedFuture("Cannot find service matching with " + filter));
} else {
ServiceReference service = discovery.getReference(ar.result());
resultHandler.handle(Future.succeededFuture(service.get()));
}
}
});
return null;
}
示例2: baseCommandClasses
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
/**
* @return the list of base command classes
*/
@GenIgnore
static List<Class<? extends AnnotatedCommand>> baseCommandClasses() {
List<Class<? extends AnnotatedCommand>> list = new ArrayList<>();
list.add(Echo.class);
list.add(Sleep.class);
list.add(Help.class);
list.add(FileSystemCd.class);
list.add(FileSystemPwd.class);
list.add(FileSystemLs.class);
list.add(NetCommandLs.class);
list.add(LocalMapGet.class);
list.add(LocalMapPut.class);
list.add(LocalMapRm.class);
list.add(BusPublish.class);
list.add(BusSend.class);
list.add(BusTail.class);
list.add(VerticleLs.class);
list.add(VerticleDeploy.class);
list.add(VerticleUndeploy.class);
list.add(VerticleFactories.class);
return list;
}
示例3: of
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
/**
* Create a tuple of an arbitrary number of elements.
*
* @param elements the elements
* @return the tuple
*/
@GenIgnore
static Tuple of(Object... elements) {
ArrayTuple tuple = new ArrayTuple(elements.length);
for (Object elt: elements) {
tuple.addValue(elt);
}
return tuple;
}
示例4: addProperty
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@Override
@GenIgnore
public void addProperty(String name, Object value) {
if (hasProperties()) {
this.properties.put(name, value);
} else {
properties(new JsonObject().put(name, value));
}
}
示例5: create
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@GenIgnore
static <T extends RequestFactory> T create(Vertx vertx, Class<T> factoryClass) {
T instance;
try {
Constructor<T> constructor = factoryClass.getConstructor(Vertx.class);
instance = constructor.newInstance(vertx);
} catch (Exception e) {
throw new RuntimeException(e);
}
return instance;
}
示例6: getBodyAsByteArray
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
/**
* @return the body of the frame as a byte array, {@code null} if none.
*/
@GenIgnore
public byte[] getBodyAsByteArray() {
if (body == null) {
return null;
}
return body.getBytes();
}
示例7: addDisabledMetricsType
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
/**
* Set metric that will not be registered. Schedulers will check the set {@code disabledMetricsTypes} when
* registering metrics suppliers
*
* @param metricsType the type of metrics
* @return the current {@link VertxHawkularOptions} instance
*/
@GenIgnore
public VertxHawkularOptions addDisabledMetricsType(MetricsType metricsType) {
if (disabledMetricsTypes == null) {
disabledMetricsTypes = EnumSet.noneOf(MetricsType.class);
}
this.disabledMetricsTypes.add(metricsType);
return this;
}
示例8: addMetricTagsMatch
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
/**
* Adds a {@link MetricTagsMatch}.
*/
@GenIgnore
public VertxHawkularOptions addMetricTagsMatch(MetricTagsMatch metricTagsMatch) {
if (metricTagsMatches == null) {
metricTagsMatches = new ArrayList<>();
}
metricTagsMatches.add(metricTagsMatch);
return this;
}
示例9: current
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
/**
* Get or create a secure non blocking random number generator using the provided vert.x context. This method will not
* throw an exception.
*
* @param context a Vert.x context.
* @return A secure non blocking random number generator.
*/
@GenIgnore
static VertxContextPRNG current(final Context context) {
final String contextKey = "__vertx.VertxContextPRNG";
// attempt to load a PRNG from the current context
PRNG random = context.get(contextKey);
if (random == null) {
synchronized (context) {
// attempt to reload to avoid double creation when we were
// waiting for the lock
random = context.get(contextKey);
if (random == null) {
// there was no PRNG in the context, create one
random = new PRNG(context.owner());
// need to make the random final
final PRNG rand = random;
// save to the context
context.put(contextKey, rand);
// add a close hook to shutdown the PRNG
context.addCloseHook(v -> rand.close());
}
}
}
return random;
}
示例10: create
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@GenIgnore
static WikiDatabaseService create(JDBCClient dbClient, HashMap<SqlQuery, String> sqlQueries, Handler<AsyncResult<WikiDatabaseService>> readyHandler) {
return new WikiDatabaseServiceImpl(dbClient, sqlQueries, readyHandler);
}
示例11: setAnnotators
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@GenIgnore
public RequestParameters setAnnotators(List<String> annotators) {
checkProperties();
properties.put("annotators", String.join(",", annotators));
return this;
}
示例12: addAnnotator
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@GenIgnore
public RequestParameters addAnnotator(String annotator) {
checkProperties();
properties.put("annotators", String.join(",", properties.getString("annotators", annotator).split(",")));
return this;
}
示例13: addProperty
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@GenIgnore
public RequestParameters addProperty(String key, Object value) {
checkProperties();
properties.put("key", key);
return this;
}
示例14: create
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@GenIgnore
static BookDatabaseService create(PgPool pgPool, Handler<AsyncResult<BookDatabaseService>> resultHandler) {
return new BookDatabaseServiceImpl(pgPool, resultHandler);
}
示例15: createProxy
import io.vertx.codegen.annotations.GenIgnore; //导入依赖的package包/类
@GenIgnore
static com.billyyccc.database.reactivex.BookDatabaseService createProxy(Vertx vertx, String address) {
return new com.billyyccc.database.reactivex.BookDatabaseService(new BookDatabaseServiceVertxEBProxy(vertx, address));
}