Search in sources :

Example 16 with com.tvd12.ezyfoxserver.client.handler

use of com.tvd12.ezyfoxserver.client.handler in project ezyfox-server by youngmonkeys.

the class HelloEmbeddedServer2 method main.

public static void main(String[] args) throws Exception {
    EzySimpleSettings settings = new EzyEmbeddedSettingsBuilderPrototype().scan("com.tvd12.ezyfoxserver.embedded.test").build();
    EzyEmbeddedServer server = EzyEmbeddedServer.builder().settings(settings).build();
    server.start();
}
Also used : EzyEmbeddedServer(com.tvd12.ezyfoxserver.embedded.EzyEmbeddedServer) EzySimpleSettings(com.tvd12.ezyfoxserver.setting.EzySimpleSettings)

Example 17 with com.tvd12.ezyfoxserver.client.handler

use of com.tvd12.ezyfoxserver.client.handler in project java-examples by tvd12.

the class ApplicationContextExample method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    context.scan("com.tvd12.example.spring_core.config");
    context.scan("com.tvd12.example.spring_core.repo");
    context.scan("com.tvd12.example.spring_core.service");
    context.refresh();
    BookService bookService = context.getBean(BookService.class);
    System.out.println(bookService.getBookById(1));
    Environment environment = context.getEnvironment();
    String world = environment.getProperty("hello");
    System.out.println(world);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) BookService(com.tvd12.example.spring_core.service.BookService) Environment(org.springframework.core.env.Environment)

Example 18 with com.tvd12.ezyfoxserver.client.handler

use of com.tvd12.ezyfoxserver.client.handler in project java-examples by tvd12.

the class ReactiveExample method main.

public static void main(String[] args) {
    final EzyBeanContext beanContext = EzyBeanContext.builder().scan("com.tvd12.example.reactive").build();
    final RxHomeController rxHomeController = (RxHomeController) beanContext.getBean(RxHomeController.class);
    final HomeData rxHomeData = rxHomeController.getHomeData();
    System.out.println("rxHomeData: " + rxHomeData);
}
Also used : HomeData(com.tvd12.example.reactive.data.HomeData) EzyBeanContext(com.tvd12.ezyfox.bean.EzyBeanContext)

Example 19 with com.tvd12.ezyfoxserver.client.handler

use of com.tvd12.ezyfoxserver.client.handler in project java-examples by tvd12.

the class PerformanceCompareTest method main.

public static void main(String[] args) {
    final EzyBeanContext beanContext = EzyBeanContext.builder().scan("com.tvd12.example.reactive").build();
    final HomeController sequenceHomeController = (HomeController) beanContext.getBean(HomeController.class);
    final RxHomeController rxHomeController = (RxHomeController) beanContext.getBean(RxHomeController.class);
    // warm up
    sequenceHomeController.getHomeData();
    rxHomeController.getHomeData();
    long sequenceCallElapsedTime = Performance.create().loop(100000).test(sequenceHomeController::getHomeData).getTime();
    long rxCallElapsedTime = Performance.create().loop(100000).test(rxHomeController::getHomeData).getTime();
    System.out.printf("sequence call elapsed time: %d\nreactive call elapsed time: %d\n", sequenceCallElapsedTime, rxCallElapsedTime);
    Reactive.destroy();
}
Also used : RxHomeController(com.tvd12.example.reactive.RxHomeController) EzyBeanContext(com.tvd12.ezyfox.bean.EzyBeanContext) RxHomeController(com.tvd12.example.reactive.RxHomeController) HomeController(com.tvd12.example.reactive.HomeController)

Example 20 with com.tvd12.ezyfoxserver.client.handler

use of com.tvd12.ezyfoxserver.client.handler in project calabash by youngmonkeys.

the class LocalMapPersistExample method newEntityCodec.

protected EzyEntityCodec newEntityCodec() {
    EzyBindingContext bindingContext = EzyBindingContext.builder().scan("com.tvd12.calabash.server.core.test.localmappersit").build();
    EzyMessageSerializer messageSerializer = new MsgPackSimpleSerializer();
    EzyMessageDeserializer messageDeserializer = new MsgPackSimpleDeserializer();
    return EzyBindingEntityCodec.builder().marshaller(bindingContext.newMarshaller()).unmarshaller(bindingContext.newUnmarshaller()).messageSerializer(messageSerializer).messageDeserializer(messageDeserializer).build();
}
Also used : EzyBindingContext(com.tvd12.ezyfox.binding.EzyBindingContext)

Aggregations

Test (org.testng.annotations.Test)9 EzyBeanContext (com.tvd12.ezyfox.bean.EzyBeanContext)8 EzyBeanContextBuilder (com.tvd12.ezyfox.bean.EzyBeanContextBuilder)3 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)3 EzySimpleSettings (com.tvd12.ezyfoxserver.setting.EzySimpleSettings)3 MongoClient (com.mongodb.MongoClient)2 EzySingleton (com.tvd12.ezyfox.bean.annotation.EzySingleton)2 EzyBindingContext (com.tvd12.ezyfox.binding.EzyBindingContext)2 EzyXmlReader (com.tvd12.ezyfox.mapping.jaxb.EzyXmlReader)2 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)2 ResourceDownloadManager (com.tvd12.ezyhttp.core.resources.ResourceDownloadManager)2 ApplicationContext (com.tvd12.ezyhttp.server.core.ApplicationContext)2 ApplicationContextBuilder (com.tvd12.ezyhttp.server.core.ApplicationContextBuilder)2 ResourceResolver (com.tvd12.ezyhttp.server.core.resources.ResourceResolver)2 Map (java.util.Map)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 HomeController (com.tvd12.example.reactive.HomeController)1 RxHomeController (com.tvd12.example.reactive.RxHomeController)1 HomeData (com.tvd12.example.reactive.data.HomeData)1 BookService (com.tvd12.example.spring_core.service.BookService)1