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


Java Type类代码示例

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


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

示例1: discoverService1wsEndpointOne

import org.jacpfx.common.Type; //导入依赖的package包/类
@Test

    public void discoverService1wsEndpointOne() throws InterruptedException {


        ServiceDiscovery.getInstance(this.getVertx()).service(SERVICE_REST_GET, (serviceResult) -> {
            assertEquals(true, serviceResult.succeeded());
            ServiceInfo si = serviceResult.getServiceInfo();
            assertEquals(true, si.getServiceName().equals(SERVICE_REST_GET));
            si.operation("/wsEndpointOne", operationOptional -> {
                assertEquals(true, operationOptional.succeeded());
                assertEquals(true, operationOptional.getOperation().getName().equalsIgnoreCase("/wsEndpointOne"));
                assertEquals(true, operationOptional.getOperation().getType().equals(Type.WEBSOCKET.name()));
                System.out.println("discoverService1wsEndpointOne finished");
                testComplete();
            });

        });


        await();

    }
 
开发者ID:amoAHCP,项目名称:vert.x-microservice,代码行数:24,代码来源:ServiceDiscoveryServiceTests.java

示例2: findAll

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/findAll")
@OperationType(Type.REST_GET)
public void findAll(final Message message) {
    dicovery.service("/userCommentsService",
            onSuccessService(si -> si.operation("/fetchByArticleIdREST/:articleId",
                            onSuccessOp(op ->
                                            getArticlesAndUpdateCommentURL(op, message),
                                    fail -> message.reply(gson.toJson(repository.getAllArticles())))),
                    fail -> message.reply(gson.toJson(repository.getAllArticles()))));

}
 
开发者ID:amoAHCP,项目名称:vertx-microservices-devoxx,代码行数:12,代码来源:ArticleService.java

示例3: findMax

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/findMAX/:amount")
@OperationType(Type.REST_GET)
public void findMax(@PathParam("amount") final String amount, final Message message) {
    dicovery.service("/userCommentsService",
            onSuccessService(si -> si.operation("/fetchByArticleIdWS",
                            onSuccessOp(op ->
                                            updateURL(message, op.getUrl(), repository.getAllArticles(Integer.valueOf(amount))),
                                    fail -> message.reply(gson.toJson(repository.getAllArticles(Integer.valueOf(amount)))))),
                    fail -> message.reply(gson.toJson(repository.getAllArticles(Integer.valueOf(amount))))));

}
 
开发者ID:amoAHCP,项目名称:vertx-microservices-devoxx,代码行数:12,代码来源:ArticleService.java

示例4: findComments

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/comments/:articleId")
@OperationType(Type.REST_GET)
public void findComments(@PathParam("articleId") final String articleId, Message message) {

    dicovery.service("/userCommentsService",
            onSuccessService(si -> operation(articleId, message, si),
                    fail -> message.reply("/userCommentsService not available: " + fail.getMessage())));

}
 
开发者ID:amoAHCP,项目名称:vertx-microservices-devoxx,代码行数:10,代码来源:ArticleService.java

示例5: findPage

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/findPage/:page")
@OperationType(Type.REST_GET)
public void findPage(@PathParam("page") final String page, final Message message) {
    dicovery.service("/userCommentsService",
            onSuccessService(si -> si.operation("/fetchByArticleIdWS",
                            onSuccessOp(op -> complexPageReply(page, message, op),
                                    fail -> simplePageReply(page, message))),
                    fail -> simplePageReply(page, message)));

}
 
开发者ID:amoAHCP,项目名称:vertx-microservices-devoxx,代码行数:11,代码来源:ArticleService.java

示例6: wsEndpointTwo

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/wsEndpintTwo")
@OperationType(Type.WEBSOCKET)
public void wsEndpointTwo(String name, WSMessageReply reply) {

    replyAsyncTwo(name + "-3", reply);
    replyAsyncTwo(name + "-4", reply);
    replyAsyncTwo(name + "-5", reply);
    replyAsyncTwo(name + "-6",reply);
    System.out.println("wsEndpointTwo-2: " + name + "   :::" + this);
}
 
开发者ID:amoAHCP,项目名称:vert.x-microservice,代码行数:11,代码来源:WSClusteredServiceTest.java

示例7: wsEndpointThreeReplyToAll

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/wsEndpintThree")
@OperationType(Type.WEBSOCKET)
public void wsEndpointThreeReplyToAll(String name, WSMessageReply reply) {
    replyToAllAsync(name + "-3", reply);
    replyToAllAsync(name + "-4", reply);
    replyToAllAsync(name + "-5", reply);
    replyToAllAsync(name + "-6", reply);

    System.out.println("wsEndpointThreeReplyToAll-2: " + name + "   :::" + this);
}
 
开发者ID:amoAHCP,项目名称:vert.x-microservice,代码行数:11,代码来源:WSClusteredServiceTest.java

示例8: wsEndpointHello

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/hello")
@OperationType(Type.WEBSOCKET)
public void wsEndpointHello(String name, WSMessageReply reply) {

    reply.reply(name + "-2");
    System.out.println("wsEndpointHello-1: " + name + "   :::" + this);
}
 
开发者ID:amoAHCP,项目名称:vert.x-microservice,代码行数:8,代码来源:WSClusteredServiceTest.java

示例9: wsEndpointAsyncReply

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/asyncReply")
@OperationType(Type.WEBSOCKET)
public void wsEndpointAsyncReply(String name, WSMessageReply reply) {

    reply.replyAsync(() -> name + "-2");
    System.out.println("wsEndpointAsyncReply-1: " + name + "   :::" + this);
}
 
开发者ID:amoAHCP,项目名称:vert.x-microservice,代码行数:8,代码来源:WSClusteredServiceTest.java

示例10: discoverService1And2OperationCount

import org.jacpfx.common.Type; //导入依赖的package包/类
@Test

    public void discoverService1And2OperationCount() throws InterruptedException {


        ServiceDiscovery.getInstance(this.getVertx()).service(SERVICE_REST_GET, (serviceResult) -> {
            assertEquals(true, serviceResult.succeeded());
            ServiceInfo si = serviceResult.getServiceInfo();
            assertEquals(true, si.getServiceName().equals(SERVICE_REST_GET));
            assertEquals(true, si.getOperationsByType(Type.WEBSOCKET).collect(Collectors.toList()).size() == 2);
            assertEquals(true, si.getOperationsByType(Type.REST_GET).collect(Collectors.toList()).size() == 1);
            ServiceDiscovery.getInstance(this.getVertx()).service(SERVICE_REST_GET2, (serviceResult2) -> {
                assertEquals(true, serviceResult2.succeeded());
                ServiceInfo si2 = serviceResult2.getServiceInfo();
                assertEquals(true, si2.getServiceName().equals(SERVICE_REST_GET2));
                assertEquals(true, si2.getOperationsByType(Type.WEBSOCKET).collect(Collectors.toList()).size() == 2);
                assertEquals(true, si2.getOperationsByType(Type.REST_GET).collect(Collectors.toList()).size() == 2);
                System.out.println("discoverService1And2OperationCount finished");
                testComplete();

            });
        });


        await();

    }
 
开发者ID:amoAHCP,项目名称:vert.x-microservice,代码行数:28,代码来源:ServiceDiscoveryServiceTests.java

示例11: testSimpleString

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/testSimpleTimerToAll")
@OperationType(Type.WEBSOCKET)
@Consumes("application/json")
public void testSimpleString(String name, WSMessageReply reply) {
    System.out.println("GOT MESSAGE");
    this.getVertx().setPeriodic(2000, (arg) -> {
        System.out.println("SEND MESSAGE");
        reply.replyToAllAsync(() -> "42");
    });
}
 
开发者ID:amoAHCP,项目名称:vert.x-microservice,代码行数:11,代码来源:WSTimerTest.java

示例12: updateForm

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/updateForm")
@OperationType(Type.REST_POST)
@Produces({"text/json","application/json"})
public void updateForm(@FormParam("id") String id,
                       @FormParam("summary") String summary,
                       @FormParam("description") String description, final Message message) {

    message.reply("{id: "+id+", summary:"+summary+", description:"+description+"}");
}
 
开发者ID:amoAHCP,项目名称:vert.x-microservice-demo,代码行数:10,代码来源:RESTPOSTVerticleServices.java

示例13: fetchAllUserCommentsWS

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/fetchAllWS")
@OperationType(Type.WEBSOCKET)
@Produces("application/json")
public void fetchAllUserCommentsWS(String message, WSMessageReply reply) {
    findAll((value)-> reply.reply(gson.toJson(value)));
}
 
开发者ID:amoAHCP,项目名称:vertx-microservices-devoxx,代码行数:7,代码来源:UserCommentsService.java

示例14: fetchAllUserCommentsREST

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/fetchAllREST")
@OperationType(Type.REST_GET)
public void fetchAllUserCommentsREST(Message message) {
    findAll((value)-> message.reply(gson.toJson(value)));
}
 
开发者ID:amoAHCP,项目名称:vertx-microservices-devoxx,代码行数:6,代码来源:UserCommentsService.java

示例15: fetchByArticleIdWS

import org.jacpfx.common.Type; //导入依赖的package包/类
@Path("/fetchByArticleIdWS")
@OperationType(Type.WEBSOCKET)
public void fetchByArticleIdWS(String articleId, WSMessageReply reply) {
    findById((value)-> reply.reply(gson.toJson(value)),articleId);
}
 
开发者ID:amoAHCP,项目名称:vertx-microservices-devoxx,代码行数:6,代码来源:UserCommentsService.java


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