org.apache.activemq.broker.Broker.addSession()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.apache.activemq.broker.Broker.addSession()方法的一些代码示例,展示了Broker.addSession()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Broker.addSession()方法的具体详情如下:
包路径:org.apache.activemq.broker.Broker
类名称:Broker
方法名:addSession

Broker.addSession介绍

[英]Adds a session.
[中]添加一个会话。

代码示例

代码示例来源:origin: apache/activemq

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  next.addSession(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addSession(context, info);
  }
}

代码示例来源:origin: apache/activemq

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  getNext().addSession(context, info);
}

代码示例来源:origin: apache/activemq

@Override
public Response processAddSession(SessionInfo info) throws Exception {
  ConnectionId connectionId = info.getSessionId().getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  // Avoid replaying dup commands
  if (cs != null && !cs.getSessionIds().contains(info.getSessionId())) {
    broker.addSession(cs.getContext(), info);
    try {
      cs.addSession(info);
    } catch (IllegalStateException e) {
      LOG.warn("Failed to add session: {}", info.getSessionId(), e);
      broker.removeSession(cs.getContext(), info);
    }
  }
  return null;
}

代码示例来源:origin: pierre/meteo

public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  next.addSession(context, info);
}

代码示例来源:origin: org.apache.activemq/activemq-broker

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  next.addSession(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addSession(context, info);
  }
}

代码示例来源:origin: pierre/meteo

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  next.addSession(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addSession(context, info);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  next.addSession(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addSession(context, info);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  next.addSession(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addSession(context, info);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  getNext().addSession(context, info);
}

代码示例来源:origin: org.apache.activemq/activemq-broker

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  getNext().addSession(context, info);
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  getNext().addSession(context, info);
}

代码示例来源:origin: pierre/meteo

public void addSession(ConnectionContext context, SessionInfo info) throws Exception {
  getNext().addSession(context, info);
}

代码示例来源:origin: pierre/meteo

public Response processAddSession(SessionInfo info) throws Exception {
  ConnectionId connectionId = info.getSessionId().getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  // Avoid replaying dup commands
  if (cs != null && !cs.getSessionIds().contains(info.getSessionId())) {
    broker.addSession(cs.getContext(), info);
    try {
      cs.addSession(info);
    } catch (IllegalStateException e) {
      e.printStackTrace();
      broker.removeSession(cs.getContext(), info);
    }
  }
  return null;
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public Response processAddSession(SessionInfo info) throws Exception {
  ConnectionId connectionId = info.getSessionId().getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  // Avoid replaying dup commands
  if (cs != null && !cs.getSessionIds().contains(info.getSessionId())) {
    broker.addSession(cs.getContext(), info);
    try {
      cs.addSession(info);
    } catch (IllegalStateException e) {
      LOG.warn("Failed to add session: {}", info.getSessionId(), e);
      broker.removeSession(cs.getContext(), info);
    }
  }
  return null;
}

代码示例来源:origin: org.apache.activemq/activemq-broker

@Override
public Response processAddSession(SessionInfo info) throws Exception {
  ConnectionId connectionId = info.getSessionId().getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  // Avoid replaying dup commands
  if (cs != null && !cs.getSessionIds().contains(info.getSessionId())) {
    broker.addSession(cs.getContext(), info);
    try {
      cs.addSession(info);
    } catch (IllegalStateException e) {
      LOG.warn("Failed to add session: {}", info.getSessionId(), e);
      broker.removeSession(cs.getContext(), info);
    }
  }
  return null;
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public Response processAddSession(SessionInfo info) throws Exception {
  ConnectionId connectionId = info.getSessionId().getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  // Avoid replaying dup commands
  if (cs != null && !cs.getSessionIds().contains(info.getSessionId())) {
    broker.addSession(cs.getContext(), info);
    try {
      cs.addSession(info);
    } catch (IllegalStateException e) {
      LOG.warn("Failed to add session: {}", info.getSessionId(), e);
      broker.removeSession(cs.getContext(), info);
    }
  }
  return null;
}

相关文章

微信公众号

最新文章

更多

Broker类方法