当前位置: 首页>>代码示例>>Java>>正文


Java SessionId.getParentId方法代码示例

本文整理汇总了Java中org.apache.activemq.command.SessionId.getParentId方法的典型用法代码示例。如果您正苦于以下问题:Java SessionId.getParentId方法的具体用法?Java SessionId.getParentId怎么用?Java SessionId.getParentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.command.SessionId的用法示例。


在下文中一共展示了SessionId.getParentId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processAddProducer

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public Response processAddProducer(ProducerInfo info) {
    if (info != null && info.getProducerId() != null) {
        SessionId sessionId = info.getProducerId().getParentId();
        if (sessionId != null) {
            ConnectionId connectionId = sessionId.getParentId();
            if (connectionId != null) {
                ConnectionState cs = connectionStates.get(connectionId);
                if (cs != null) {
                    SessionState ss = cs.getSessionState(sessionId);
                    if (ss != null) {
                        ss.addProducer(info);
                    }
                }
            }
        }
    }
    return TRACKED_RESPONSE_MARKER;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:ConnectionStateTracker.java

示例2: processRemoveProducer

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public Response processRemoveProducer(ProducerId id) {
    if (id != null) {
        SessionId sessionId = id.getParentId();
        if (sessionId != null) {
            ConnectionId connectionId = sessionId.getParentId();
            if (connectionId != null) {
                ConnectionState cs = connectionStates.get(connectionId);
                if (cs != null) {
                    SessionState ss = cs.getSessionState(sessionId);
                    if (ss != null) {
                        ss.removeProducer(id);
                    }
                }
            }
        }
    }
    return TRACKED_RESPONSE_MARKER;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:ConnectionStateTracker.java

示例3: processAddConsumer

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public Response processAddConsumer(ConsumerInfo info) {
    if (info != null) {
        SessionId sessionId = info.getConsumerId().getParentId();
        if (sessionId != null) {
            ConnectionId connectionId = sessionId.getParentId();
            if (connectionId != null) {
                ConnectionState cs = connectionStates.get(connectionId);
                if (cs != null) {
                    SessionState ss = cs.getSessionState(sessionId);
                    if (ss != null) {
                        ss.addConsumer(info);
                    }
                }
            }
        }
    }
    return TRACKED_RESPONSE_MARKER;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:ConnectionStateTracker.java

示例4: processRemoveConsumer

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) {
    if (id != null) {
        SessionId sessionId = id.getParentId();
        if (sessionId != null) {
            ConnectionId connectionId = sessionId.getParentId();
            if (connectionId != null) {
                ConnectionState cs = connectionStates.get(connectionId);
                if (cs != null) {
                    SessionState ss = cs.getSessionState(sessionId);
                    if (ss != null) {
                        ss.removeConsumer(id);
                    }
                    cs.getRecoveringPullConsumers().remove(id);
                }
            }
        }
    }
    return TRACKED_RESPONSE_MARKER;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:20,代码来源:ConnectionStateTracker.java

示例5: processRemoveSession

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public Response processRemoveSession(SessionId id, long lastDeliveredSequenceId) {
    if (id != null) {
        ConnectionId connectionId = id.getParentId();
        if (connectionId != null) {
            ConnectionState cs = connectionStates.get(connectionId);
            if (cs != null) {
                cs.removeSession(id);
            }
        }
    }
    return TRACKED_RESPONSE_MARKER;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:ConnectionStateTracker.java

示例6: lookupConnectionState

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public TransportConnectionState lookupConnectionState(SessionId id) {
	 TransportConnectionState cs = lookupConnectionState(id.getConnectionId());
    if (cs == null) {
        throw new IllegalStateException(
                                        "Cannot lookup a session from a connection that had not been registered: "
                                            + id.getParentId());
    }
    return cs;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:10,代码来源:MapTransportConnectionStateRegister.java

示例7: lookupConnectionState

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public synchronized TransportConnectionState lookupConnectionState(SessionId id) {
    TransportConnectionState cs = connectionState;
    if (cs == null) {
        throw new IllegalStateException(
                                        "Cannot lookup a session from a connection that had not been registered: "
                                            + id.getParentId());
    }
    return cs;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:10,代码来源:SingleTransportConnectionStateRegister.java

示例8: processAddProducer

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
@Override
public Response processAddProducer(ProducerInfo info) throws Exception {
   SessionId sessionId = info.getProducerId().getParentId();
   ConnectionState cs = getState();

   if (cs == null) {
      throw new IllegalStateException("Cannot add a producer to a connection that had not been registered: " + sessionId.getParentId());
   }

   SessionState ss = cs.getSessionState(sessionId);
   if (ss == null) {
      throw new IllegalStateException("Cannot add a producer to a session that had not been registered: " + sessionId);
   }

   // Avoid replaying dup commands
   if (!ss.getProducerIds().contains(info.getProducerId())) {
      ActiveMQDestination destination = info.getDestination();

      if (destination != null && !AdvisorySupport.isAdvisoryTopic(destination)) {
         if (destination.isQueue()) {
            OpenWireConnection.this.validateDestination(destination);
         }
         DestinationInfo destInfo = new DestinationInfo(getContext().getConnectionId(), DestinationInfo.ADD_OPERATION_TYPE, destination);
         OpenWireConnection.this.addDestination(destInfo);
      }

      ss.addProducer(info);

   }
   return null;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:32,代码来源:OpenWireConnection.java

示例9: addConsumer

import org.apache.activemq.command.SessionId; //导入方法依赖的package包/类
public void addConsumer(ConsumerInfo info) throws Exception {
   // Todo: add a destination interceptors holder here (amq supports this)
   SessionId sessionId = info.getConsumerId().getParentId();
   ConnectionId connectionId = sessionId.getParentId();
   ConnectionState cs = getState();
   if (cs == null) {
      throw new IllegalStateException("Cannot add a consumer to a connection that had not been registered: " + connectionId);
   }
   SessionState ss = cs.getSessionState(sessionId);
   if (ss == null) {
      throw new IllegalStateException(server + " Cannot add a consumer to a session that had not been registered: " + sessionId);
   }
   // Avoid replaying dup commands
   if (!ss.getConsumerIds().contains(info.getConsumerId())) {

      AMQSession amqSession = sessions.get(sessionId);
      if (amqSession == null) {
         throw new IllegalStateException("Session not exist! : " + sessionId);
      }

      List<AMQConsumer> consumersList = amqSession.createConsumer(info, new SlowConsumerDetection());
      if (consumersList.size() == 0) {
         return;
      }

      this.addConsumerBrokerExchange(info.getConsumerId(), amqSession, consumersList);
      ss.addConsumer(info);
      amqSession.start();

      if (AdvisorySupport.isAdvisoryTopic(info.getDestination())) {
         //advisory for temp destinations
         if (AdvisorySupport.isTempDestinationAdvisoryTopic(info.getDestination())) {
            // Replay the temporary destinations.
            List<DestinationInfo> tmpDests = this.protocolManager.getTemporaryDestinations();
            for (DestinationInfo di : tmpDests) {
               ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(di.getDestination());
               String originalConnectionId = di.getConnectionId().getValue();
               protocolManager.fireAdvisory(context, topic, di, info.getConsumerId(), originalConnectionId);
            }
         }
      }
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:44,代码来源:OpenWireConnection.java


注:本文中的org.apache.activemq.command.SessionId.getParentId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。