Package asia.stampy.common.gateway

Examples of asia.stampy.common.gateway.HostPort


  protected void ensureCleanup() {
    getGateway().addServiceListener(new MinaServiceAdapter() {

      @Override
      public void sessionDestroyed(IoSession session) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) session.getRemoteAddress());
        if (messages.containsKey(hostPort)) {
          log.debug("{} session terminated, cleaning up message interceptor", hostPort);
          messages.remove(hostPort);
        }
      }
View Full Code Here


  protected void ensureCleanup() {
    getGateway().addServiceListener(new MinaServiceAdapter() {

      @Override
      public void sessionDestroyed(IoSession session) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) session.getRemoteAddress());
        if (loggedInConnections.contains(hostPort)) {
          log.debug("{} session terminated before DISCONNECT message received, cleaning up", hostPort);
          loggedInConnections.remove(hostPort);
        }
      }
View Full Code Here

  protected void ensureCleanup() {
    getGateway().addServiceListener(new MinaServiceAdapter() {

      @Override
      public void sessionDestroyed(IoSession session) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) session.getRemoteAddress());
        if (activeTransactions.containsKey(hostPort)) {
          log.debug("{} session terminated with outstanding transaction, cleaning up", hostPort);
          activeTransactions.remove(hostPort);
        }
      }
View Full Code Here

   * org.apache.mina.core.service.IoHandlerAdapter#messageReceived(org.apache
   * .mina.core.session.IoSession, java.lang.Object)
   */
  @Override
  public void messageReceived(IoSession session, Object message) throws Exception {
    final HostPort hostPort = new HostPort((InetSocketAddress) session.getRemoteAddress());
    log.debug("Received raw message {} from {}", message, hostPort);

    helper.resetHeartbeat(hostPort);

    if (!helper.isValidObject(message)) {
View Full Code Here

   * @see
   * org.apache.mina.core.service.IoHandlerAdapter#exceptionCaught(org.apache
   * .mina.core.session.IoSession, java.lang.Throwable)
   */
  public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
    HostPort hostPort = new HostPort((InetSocketAddress) session.getRemoteAddress());

    log.error("Unexpected exception for " + hostPort, cause);
  }
View Full Code Here

   * org.apache.mina.core.service.IoServiceListener#sessionCreated(org.apache
   * .mina.core.session.IoSession)
   */
  @Override
  public void sessionCreated(IoSession session) throws Exception {
    HostPort hostPort = createHostPort(session);
    log.info("Stampy MINA session created for {}", hostPort);

    sessions.put(hostPort, session);
  }
View Full Code Here

   * org.apache.mina.core.service.IoServiceListener#sessionDestroyed(org.apache
   * .mina.core.session.IoSession)
   */
  @Override
  public void sessionDestroyed(IoSession session) throws Exception {
    HostPort hostPort = createHostPort(session);
    log.info("Stampy MINA session destroyed for {}", hostPort);

    sessions.remove(hostPort);

    if (sessions.isEmpty() && isAutoShutdown()) {
View Full Code Here

      session.close(false);
    }
  }

  private HostPort createHostPort(IoSession session) {
    return new HostPort((InetSocketAddress) session.getRemoteAddress());
  }
View Full Code Here

  protected void ensureCleanup() {
    getGateway().addServiceListener(new MinaServiceAdapter() {

      @Override
      public void sessionDestroyed(IoSession session) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) session.getRemoteAddress());
        if (connectedClients.contains(hostPort)) {
          log.debug("{} session terminated with outstanding connection, cleaning up", hostPort);
          connectedClients.remove(hostPort);
        }
      }
View Full Code Here

   * asia.stampy.common.mina.StampyMinaHandler#messageReceived(org.apache.mina
   * .core.session.IoSession, java.lang.Object)
   */
  @Override
  public void messageReceived(IoSession session, Object message) throws Exception {
    final HostPort hostPort = new HostPort((InetSocketAddress) session.getRemoteAddress());
    log.trace("Received raw message {} from {}", message, hostPort);

    helper.resetHeartbeat(hostPort);

    if (!helper.isValidObject(message)) {
View Full Code Here

TOP

Related Classes of asia.stampy.common.gateway.HostPort

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.