当前位置: 代码迷 >> Web前端 >> 清算Consumer中强行关闭浏览器的Client
  详细解决方案

清算Consumer中强行关闭浏览器的Client

热度:103   发布时间:2012-10-19 16:53:36.0
清理Consumer中强行关闭浏览器的Client

MessageBroker msgBroker = MessageBroker.getMessageBroker(null);   
MessageService service = (MessageService) msgBroker.getService( SERVICE );  
MessageDestination msgDest = (MessageDestination)service.getDestination( DESTINATION );  
MessageClient msgClient = msgDest.getSubscriptionManager().getSubscriber(clientId);
if (msgClient != null) {
msgDest.getSubscriptionManager().removeSubscriber(msgClient);
System.out.println("删除Flex客户端[" + clientId + "]" );
} else {
System.out.println("Flex客户端[" + clientId + "]已经注销!");
}
?在别的地方看到的,还没测试,先留下。
  相关解决方案