public synchronized TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
@Override 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; }
@Override public Response processRemoveProducer(ProducerId id) throws Exception { SessionId sessionId = id.getParentId(); ConnectionId connectionId = sessionId.getParentId(); TransportConnectionState cs = lookupConnectionState(connectionId); SessionState ss = cs.getSessionState(sessionId); if (ss == null) { throw new IllegalStateException("Cannot remove a producer from a session that had not been registered: " + sessionId); } ProducerState ps = ss.removeProducer(id); if (ps == null) { throw new IllegalStateException("Cannot remove a producer that had not been registered: " + id); } removeProducerBrokerExchange(id); broker.removeProducer(cs.getContext(), ps.getInfo()); return null; }
@Override public Response processMessage(Message send) throws Exception { if (send != null) { if (trackTransactions && send.getTransactionId() != null) { ProducerId producerId = send.getProducerId(); ConnectionId connectionId = producerId.getParentId().getParentId(); if (connectionId != null) { ConnectionState cs = connectionStates.get(connectionId); if (cs != null) { TransactionState transactionState = cs.getTransactionState(send.getTransactionId()); if (transactionState != null) { transactionState.addCommand(send); if (trackTransactionProducers) { // for jmstemplate, track the producer in case it is closed before commit // and needs to be replayed SessionState ss = cs.getSessionState(producerId.getParentId()); ProducerState producerState = ss.getProducerState(producerId); producerState.setTransactionState(transactionState); } } } } return TRACKED_RESPONSE_MARKER; }else if (trackMessages) { messageCache.put(send.getMessageId(), send); } } return null; }
@Override 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); if (info.isResponseRequired()) { return new Tracked(new ExceptionResponseCheckAction(info)); } } } } } } return TRACKED_RESPONSE_MARKER; }
@Override public Response processAddProducer(ProducerInfo info) throws Exception { SessionId sessionId = info.getProducerId().getParentId(); ConnectionId connectionId = sessionId.getParentId(); TransportConnectionState cs = lookupConnectionState(connectionId);
private ProducerBrokerExchange getProducerBrokerExchange(ProducerId id) throws IOException { ProducerBrokerExchange result = producerExchanges.get(id); if (result == null) { synchronized (producerExchanges) { result = new ProducerBrokerExchange(); TransportConnectionState state = lookupConnectionState(id); context = state.getContext(); result.setConnectionContext(context); if (context.isReconnect() || (context.isNetworkConnection() && connector.isAuditNetworkProducers())) { result.setLastStoredSequenceId(brokerService.getPersistenceAdapter().getLastProducerSequenceId(id)); } SessionState ss = state.getSessionState(id.getParentId()); if (ss != null) { result.setProducerState(ss.getProducerState(id)); ProducerState producerState = ss.getProducerState(id); if (producerState != null && producerState.getInfo() != null) { ProducerInfo info = producerState.getInfo(); result.setMutable(info.getDestination() == null || info.getDestination().isComposite()); } } producerExchanges.put(id, result); } } else { context = result.getConnectionContext(); } return result; }
public synchronized TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public synchronized TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public synchronized TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public synchronized TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ProducerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public ProducerState removeProducer(ProducerId producerId) { ProducerState result = null; if (producerId != null && producerId.getConnectionId() != null && producerId.getParentId() != null) { TransportConnectionState cs = lookupConnectionState(producerId.getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(producerId.getParentId()); if (sessionState != null) { result = sessionState.removeProducer(producerId); } } } return result; }
public ProducerState removeProducer(ProducerId producerId) { ProducerState result = null; if (producerId != null && producerId.getConnectionId() != null && producerId.getParentId() != null) { TransportConnectionState cs = lookupConnectionState(producerId.getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(producerId.getParentId()); if (sessionState != null) { result = sessionState.removeProducer(producerId); } } } return result; }
public void addProducer(ProducerInfo info) { if (info != null && info.getProducerId() != null && info.getProducerId().getParentId() != null && info.getProducerId().getConnectionId() != null) { TransportConnectionState cs = lookupConnectionState(info.getProducerId().getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(info.getProducerId().getParentId()); if (sessionState != null) { sessionState.addProducer(info); } } } }
public void addProducer(ProducerInfo info) { if (info != null && info.getProducerId() != null && info.getProducerId().getParentId() != null && info.getProducerId().getConnectionId() != null) { TransportConnectionState cs = lookupConnectionState(info.getProducerId().getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(info.getProducerId().getParentId()); if (sessionState != null) { sessionState.addProducer(info); } } } }