Codota Logo
MsgManager.dispatchMsg
Code IndexAdd Codota to your IDE (free)

How to use
dispatchMsg
method
in
org.grain.msg.MsgManager

Best Java code snippets using org.grain.msg.MsgManager.dispatchMsg (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: dianbaer/grain

@Override
public void sessionCreated(IoSession session) throws Exception {
  super.sessionCreated(session);
  if (MinaConfig.log != null) {
    MinaConfig.log.info("minaserver sessionCreated");
  }
  MsgManager.dispatchMsg(TcpMsg.MINA_CLIENT_CREATE_CONNECT, null, session);
}
origin: dianbaer/grain

@Override
public void sessionCreated(IoSession session) throws Exception {
  super.sessionCreated(session);
  if (MinaConfig.log != null) {
    MinaConfig.log.info("minaclient sessionCreated");
  }
  // 发布与服务器链接成功的消息
  MsgManager.dispatchMsg(TcpMsg.MINA_SERVER_CONNECTED, this.name, session);
}
origin: dianbaer/grain

@OnOpen
public void onOpen(Session session) {
  try {
    MsgManager.dispatchMsg(WSMsg.WEBSOCKET_CLIENT_CREATE_CONNECT, null, session);
  } catch (Exception e) {
    if (WSManager.log != null) {
      WSManager.log.error("MsgManager.dispatchMsg error", e);
    }
  }
}
origin: dianbaer/grain

@Override
public void sessionClosed(IoSession session) throws Exception {
  super.sessionClosed(session);
  if (MinaConfig.log != null) {
    MinaConfig.log.warn("minaserver sessionClosed");
  }
  MsgManager.dispatchMsg(TcpMsg.MINA_CLIENT_DISCONNECT, null, session);
}
origin: dianbaer/grain

  @OnClose
  public void onClose(Session session, CloseReason closeReason) {
    try {
      MsgManager.dispatchMsg(WSMsg.WEBSOCKET_CLIENT_DISCONNECT, null, session);
    } catch (Exception e) {
      if (WSManager.log != null) {
        WSManager.log.error("MsgManager.dispatchMsg error", e);
      }
    }
  }
}
origin: dianbaer/grain

@Override
public void sessionClosed(IoSession session) throws Exception {
  super.sessionClosed(session);
  if (MinaConfig.log != null) {
    MinaConfig.log.warn("minaclient sessionClosed");
  }
  // 设置链接已断开,断线过会儿会断线重连
  MinaClient.getInstance().ioConnectorStateMap.put(ioConnector, false);
  // 发布与服务器断开的消息
  MsgManager.dispatchMsg(TcpMsg.MINA_SERVER_DISCONNECT, this.name, session);
}
org.grain.msgMsgManagerdispatchMsg

Javadoc

执行消息在当前线程,当不使用异步线程时,这个可以用来解耦

Popular methods of MsgManager

  • init
    初始化
  • addMsgListener
    添加消息监听
  • handleMsg
    处理消息

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now