Java 类io.vertx.core.impl.VertxFactoryImpl 实例源码

项目:ipf-oht-atna    文件:AuditorIntegrationTest.java   
@Before
public void setup(TestContext context){
    p = System.getProperties();
    port = freePort();
    CONTEXT = AuditorModuleContext.getContext();
    CONFIG = CONTEXT.getConfig();
    CONFIG.setAuditRepositoryPort(port);
    CONFIG.setAuditRepositoryHost(host);
    CONFIG.setAuditRepositoryTransport("TLS");
    auditor = PIXConsumerAuditor.getAuditor();
    auditor.setContext(CONTEXT);
    auditor.setConfig(CONFIG);
    vertx = new VertxFactoryImpl().vertx();
}
项目:udidb    文件:ServerModule.java   
@Override
protected void configure()
{
    // JSON configuration
    SimpleModule simpleModule = new SimpleModule();
    simpleModule.addSerializer(ExpressionValue.class, new ExpressionValueSerializer());

    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.addMixInAnnotations(VoidResult.class, VoidResultMixIn.class);
    objectMapper.addMixInAnnotations(DeferredResult.class, DeferredResultMixIn.class);
    objectMapper.addMixInAnnotations(TableResult.class, TableResultMixIn.class);
    objectMapper.addMixInAnnotations(ValueResult.class, ValueResultMixIn.class);
    objectMapper.addMixInAnnotations(TableRow.class, TableRowMixIn.class);
    objectMapper.registerModule(simpleModule);
    bind(ObjectMapper.class).toInstance(objectMapper);

    // REST API configuration
    Vertx vertx = new VertxFactoryImpl().vertx();
    bind(Vertx.class).toInstance(vertx);

    // Engine configuration
    bind(String[].class).annotatedWith(Names.named("OP_PACKAGES")).toInstance(
            new String[] {
                    "net.udidb.engine.ops.impls"
            });

    bind(DebuggeeContextManager.class).to(DebuggeeContextManagerImpl.class);

    bind(HelpMessageProvider.class).asEagerSingleton();

    bind(UdiProcessManager.class).toInstance(new UdiProcessManagerImpl());

    bind(BinaryReader.class).toInstance(new CrossPlatformBinaryReader());

    bind(ExpressionCompiler.class).toInstance(new ExpressionCompilerDelegate());

    bind(SourceLineRowFactory.class).toInstance(new InMemorySourceLineRowFactory());

    bind(ServerEngine.class).to(ServerEngineImpl.class);

    bind(OperationResultVisitor.class).to(OperationEngine.class);

    bind(ServerEventDispatcher.class).asEagerSingleton();

    bind(EventPump.class).asEagerSingleton();

    bind(EventSink.class).to(ServerEventDispatcher.class);

    WampRouter wampRouter = configureWampRouter();
    bind(WampRouter.class).toInstance(wampRouter);

    bind(WampClient.class).toInstance(configureWampClient(wampRouter));

}