當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。