Search in sources :

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

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

the class LocalBaseTest method newBeanContext.

protected EzyBeanContext newBeanContext() {
    MongoClient mongoClient = newMongoClient();
    EzyBeanContextBuilder builder = EzyBeanContext.builder().addSingleton("mongoClient", mongoClient).scan("com.tvd12.calabash.local.test.mappersist");
    addAutoImplMongoRepo(builder, mongoClient);
    return builder.build();
}
Also used : MongoClient(com.mongodb.MongoClient) EzyBeanContextBuilder(com.tvd12.ezyfox.bean.EzyBeanContextBuilder)

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

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

the class EzyFoxBeanExample method main.

public static void main(String[] args) {
    final EzyBeanContext beanContext = EzyBeanContext.builder().scan("com.tvd12.ezyfox.example.bean").build();
    final BookController bookController = (BookController) beanContext.getBean(BookController.class);
    bookController.saveBook(new Book(1L, "EzyFox in action"));
}
Also used : EzyBeanContext(com.tvd12.ezyfox.bean.EzyBeanContext) Book(com.tvd12.ezyfox.example.bean.entity.Book) BookController(com.tvd12.ezyfox.example.bean.controller.BookController)

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

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

the class MsgpackExample method main.

public static void main(String[] args) {
    final EzyBindingContext bindingContext = EzyBindingContext.builder().scan("com.tvd12.ezyfox.example.msgpack").build();
    final EzyEntityCodec codec = EzyBindingEntityCodec.builder().marshaller(bindingContext.newMarshaller()).unmarshaller(bindingContext.newUnmarshaller()).messageSerializer(new MsgPackSimpleSerializer()).messageDeserializer(new MsgPackSimpleDeserializer()).build();
    final Transfer transfer = new Transfer(300, 100);
    final byte[] serializedBytes = codec.serialize(transfer);
    System.out.println(serializedBytes.length);
    System.out.println(Arrays.toString(serializedBytes));
    System.out.println(EzyPrints.printHex(serializedBytes));
    final Transfer deserializedObj = codec.deserialize(serializedBytes, Transfer.class);
    System.out.println(deserializedObj);
}
Also used : EzyBindingContext(com.tvd12.ezyfox.binding.EzyBindingContext) MsgPackSimpleSerializer(com.tvd12.ezyfox.codec.MsgPackSimpleSerializer) MsgPackSimpleDeserializer(com.tvd12.ezyfox.codec.MsgPackSimpleDeserializer) EzyEntityCodec(com.tvd12.ezyfox.codec.EzyEntityCodec)

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

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

the class HellWorldRpcServerExample method main.

public static void main(String[] args) throws Exception {
    RpcRequestHandlerImplementer.setDebug(true);
    QuickRpcSettings settings = QuickRpcSettings.builder().username("admin").password("admin").build();
    QuickRpcServer server = new QuickRpcServer(settings).scan("com.tvd12.quick.rpc.examples.hello_world");
    server.start();
}
Also used : QuickRpcSettings(com.tvd12.quick.rpc.server.setting.QuickRpcSettings) QuickRpcServer(com.tvd12.quick.rpc.server.QuickRpcServer)

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