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


Java Server类代码示例

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


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

示例1: testServerClose

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
@Test
public void testServerClose() throws Exception {
    for (int i = 0; i < 100; i++) {
        Server aServer = Exchangers.bind(URL.valueOf("exchange://localhost:" + (5000 + i) + "?client=netty"), new TelnetServerHandler());
        aServer.close();
    }
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:8,代码来源:NettyClientTest.java

示例2: join

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public Peer join(URL url, ChannelHandler handler) throws RemotingException {
    Server server = servers.get(url);
    if (server == null) { // TODO 有并发间隙
        server = Transporters.bind(url, handler);
        servers.put(url, server);
        dispatcher.addChannelHandler(handler);
    }
    return new ServerPeer(server, clients, this);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:10,代码来源:AbstractGroup.java

示例3: HeaderExchangeServer

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public HeaderExchangeServer(Server server) {
    if (server == null) {
        throw new IllegalArgumentException("server == null");
    }
    this.server = server;
    this.heartbeat = server.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0);
    this.heartbeatTimeout = server.getUrl().getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, heartbeat * 3);
    if (heartbeatTimeout < heartbeat * 2) {
        throw new IllegalStateException("heartbeatTimeout < heartbeatInterval * 2");
    }
    startHeatbeatTimer();
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:13,代码来源:HeaderExchangeServer.java

示例4: HeaderExchangeServer

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public HeaderExchangeServer(Server server) {
    if (server == null) {
        throw new IllegalArgumentException("server == null");
    }
    this.server = server;
    this.heartbeat = server.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0);
    //默认的心跳超时时间为3倍的心跳时间
    this.heartbeatTimeout = server.getUrl().getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, heartbeat * 3);
    if (heartbeatTimeout < heartbeat * 2) {
        throw new IllegalStateException("heartbeatTimeout < heartbeatInterval * 2");
    }
    //开启心跳 
    startHeatbeatTimer();
}
 
开发者ID:spccold,项目名称:dubbo-comments,代码行数:15,代码来源:HeaderExchangeServer.java

示例5: HeaderExchangeServer

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public HeaderExchangeServer(Server server) {
    if (server == null) {
        throw new IllegalArgumentException("server == null");
    }
    this.server = server;
    this.heartbeat = server.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0);
    this.heartbeatTimeout = server.getUrl().getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, heartbeat * 3);
    if (heartbeatTimeout < heartbeat * 2) {
        throw new IllegalStateException("heartbeatTimeout < heartbeatInterval * 2");
    }
    //打开心跳检测的定时器
    startHeatbeatTimer();
}
 
开发者ID:DoubleSmile,项目名称:dubbo-learning,代码行数:14,代码来源:HeaderExchangeServer.java

示例6: HeaderExchangeServer

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public HeaderExchangeServer(Server server) {
	if (server == null) {
		throw new IllegalArgumentException("server == null");
	}
	this.server = server;
	this.heartbeat = server.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0);
	this.heartbeatTimeout = server.getUrl().getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, heartbeat * 3);
	if (heartbeatTimeout < heartbeat * 2) {
		throw new IllegalStateException("heartbeatTimeout < heartbeatInterval * 2");
	}
	startHeatbeatTimer();
}
 
开发者ID:nince-wyj,项目名称:jahhan,代码行数:13,代码来源:HeaderExchangeServer.java

示例7: bind

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public Server bind(URL url, ChannelHandler listener) throws RemotingException {
    return new GrizzlyServer(url, listener);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:GrizzlyTransporter.java

示例8: bind

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public Server bind(URL url, ChannelHandler listener) throws RemotingException {
    return new NettyServer(url, listener);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:NettyTransporter.java

示例9: startServer

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public Server startServer(int port) throws RemotingException{
    final String url = "exchange://127.0.0.1:"+port +"/client.reconnect.test";
    return Exchangers.bind(url, new HandlerAdapter());
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:5,代码来源:ClientReconnectTest.java

示例10: leave

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public void leave(URL url) throws RemotingException {
    Server server = servers.remove(url);
    if (server != null) {
        server.close();
    }
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:7,代码来源:AbstractExchangeGroup.java

示例11: ServerPeer

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public ServerPeer(Server server, Map<URL, Client> clients, Group group){
    super(server);
    this.clients = clients;
    this.group = group;
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:6,代码来源:ServerPeer.java

示例12: getServer

import com.alibaba.dubbo.remoting.Server; //导入依赖的package包/类
public Server getServer() {
    return server;
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:HeaderExchangeServer.java


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