Package net.solosky.maplefetion.client

Examples of net.solosky.maplefetion.client.RegistrationException


      Element event = XMLHelper.find(root, "/events/event");
      String eventType = event.getAttributeValue("type");
     
      //用户在其他地方登陆
      if(eventType!=null && eventType.equals("deregistered")) {
        this.context.handleException(new RegistrationException(RegistrationException.DEREGISTERED));
      }else if(eventType.equals("disconnect")){
        this.context.handleException(new RegistrationException(RegistrationException.DISCONNECTED));
      }else{
        logger.warn("Unknown registration event type:"+eventType);
      }
    }
View Full Code Here


      //根据不同的异常类型,来设置客户端的状态
      if(exception instanceof TransferException) {        //网络错误
        logger.fatal("Connection error. Please try to login again after several time.");
        this.state = ClientState.CONNECTION_ERROR;
      }else if(exception instanceof RegistrationException) {  //注册异常
        RegistrationException re = (RegistrationException) exception;
        if(re.getRegistrationType()==RegistrationException.DEREGISTERED) {
          logger.fatal("You have logined by other client.");
          this.state = ClientState.OTHER_LOGIN;    //用户其他地方登陆
        }else if(re.getRegistrationType()==RegistrationException.DISCONNECTED) {
          logger.fatal("Server has closed connection. Please try to login again after several time.");
          this.state = ClientState.DISCONNECTED;    //服务器关闭了连接
        }else {
          logger.fatal("Unknown registration exception", exception);
        }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.client.RegistrationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.