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


Java WampRouter类代码示例

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


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

示例1: SimpleWampWebsocketListener

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
public SimpleWampWebsocketListener(WampRouter router, URI uri, SslContext sslContext,
                                   List<WampSerialization> serializations) throws ApplicationError {
    this.router = router;
    this.uri = uri;
    this.serializations = serializations;
    
    if (serializations == null || serializations.size() == 0 || serializations.contains(WampSerialization.Invalid))
        throw new ApplicationError(ApplicationError.INVALID_SERIALIZATIONS);

    this.bossGroup = new NioEventLoopGroup(1, new ThreadFactory(){
        @Override
        public Thread newThread(Runnable r){
            return new Thread(r, "WampRouterBossLoop");
        }
    });
    this.clientGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors(), new ThreadFactory(){
        private AtomicInteger counter = new AtomicInteger();
        @Override
        public Thread newThread(Runnable r){
            return new Thread(r, "WampRouterClientLoop-"+counter.incrementAndGet());
        }
    });

    // Copy the ssl context only when we really want ssl
    if (uri.getScheme().equalsIgnoreCase("wss")) {
        this.sslCtx = sslContext;
    }
}
 
开发者ID:Matthias247,项目名称:jawampa,代码行数:29,代码来源:SimpleWampWebsocketListener.java

示例2: WampServerWebsocketHandler

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
public WampServerWebsocketHandler(String websocketPath, WampRouter router,
                                  List<WampSerialization> supportedSerializations) {
    this.websocketPath = websocketPath;
    this.router = router;
    this.connectionAcceptor = router.connectionAcceptor();
    this.supportedSerializations = supportedSerializations;
}
 
开发者ID:Matthias247,项目名称:jawampa,代码行数:8,代码来源:WampServerWebsocketHandler.java

示例3: configureWampRouter

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
private WampRouter configureWampRouter()
{
    try {
        return new WampRouterBuilder()
                .addRealm(WAMP_REALM)
                .build();
    }catch (ApplicationError e) {
        // TODO there might be a better way to communicate this error
        throw new RuntimeException(e);
    }
}
 
开发者ID:udidb,项目名称:udidb,代码行数:12,代码来源:ServerModule.java

示例4: configureWampClient

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
private WampClient configureWampClient(WampRouter wampRouter)
{
    try {
        WampClient wampClient = new WampClientBuilder()
                .withRealm(WAMP_REALM)
                .withUri(INTERNAL_CLIENT_URI)
                .withConnectorProvider(new InMemoryConnectorProvider(wampRouter))
                .build();
        wampClient.open();
        return wampClient;
    }catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:udidb,项目名称:udidb,代码行数:15,代码来源:ServerModule.java

示例5: InMemoryConnectorProvider

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
public InMemoryConnectorProvider(WampRouter wampRouter)
{
    this.wampRouter = wampRouter;
}
 
开发者ID:udidb,项目名称:udidb,代码行数:5,代码来源:InMemoryConnectorProvider.java

示例6: InMemoryConnector

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
public InMemoryConnector(WampRouter wampRouter)
{
    this.wampRouter = wampRouter;
}
 
开发者ID:udidb,项目名称:udidb,代码行数:5,代码来源:InMemoryConnector.java

示例7: configure

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
@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));

}
 
开发者ID:udidb,项目名称:udidb,代码行数:55,代码来源:ServerModule.java

示例8: EventsSocket

import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
@Inject
public EventsSocket(WampRouter wampRouter, ObjectMapper objectMapper)
{
    this.objectMapper = objectMapper;
    this.wampRouter = wampRouter;
}
 
开发者ID:udidb,项目名称:udidb,代码行数:7,代码来源:EventsSocket.java


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