本文整理汇总了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;
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例5: InMemoryConnectorProvider
import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
public InMemoryConnectorProvider(WampRouter wampRouter)
{
this.wampRouter = wampRouter;
}
示例6: InMemoryConnector
import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
public InMemoryConnector(WampRouter wampRouter)
{
this.wampRouter = wampRouter;
}
示例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));
}
示例8: EventsSocket
import ws.wamp.jawampa.WampRouter; //导入依赖的package包/类
@Inject
public EventsSocket(WampRouter wampRouter, ObjectMapper objectMapper)
{
this.objectMapper = objectMapper;
this.wampRouter = wampRouter;
}