protected void clearIO() { // the storage manager could be null on the backup on certain components if (storageManager != null) { storageManager.clearContext(); } }
protected void blockOnIO() { // the storage manager could be null on the backup on certain components if (storageManager != null) { try { storageManager.waitOnOperations(); storageManager.clearContext(); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } } }
@Override public void clearContext() { manager.clearContext(); }
private void clearupOperationContext() { server.getStorageManager().clearContext(); }
@Override public void run() { storageManager.setContext(storageManager.newSingleThreadContext()); try { if (cleanupEnabled) { cleanup(); } } finally { storageManager.clearContext(); scheduledCleanup.decrementAndGet(); } } });
@Override public void handleBuffer(final RemotingConnection connection, final ActiveMQBuffer buffer) { StompConnection conn = (StompConnection) connection; conn.setDataReceived(); do { StompFrame request; try { request = conn.decode(buffer); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorDecodingPacket(e); return; } if (request == null) { break; } try { invokeInterceptors(this.incomingInterceptors, request, conn); conn.handleFrame(request); } finally { server.getStorageManager().clearContext(); } } while (conn.hasBytes()); }
@Override public void handleBuffer(final RemotingConnection connection, final ActiveMQBuffer buffer) { StompConnection conn = (StompConnection) connection; conn.setDataReceived(); do { StompFrame request; try { request = conn.decode(buffer); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorDecodingPacket(e); return; } if (request == null) { break; } try { invokeInterceptors(this.incomingInterceptors, request, conn); conn.logFrame(request, true); conn.handleFrame(request); } finally { server.getStorageManager().clearContext(); } } while (conn.hasBytes()); }
storageManager.clearContext();
private void onSessionRequestProducerCredits(Packet packet) { this.storageManager.setContext(session.getSessionContext()); try { Packet response = null; boolean requiresResponse = false; try { SessionRequestProducerCreditsMessage message = (SessionRequestProducerCreditsMessage) packet; session.requestProducerCredits(message.getAddress(), message.getCredits()); } catch (ActiveMQIOErrorException e) { response = onActiveMQIOErrorExceptionWhileHandlePacket(packet, e, requiresResponse, response, this.session); } catch (ActiveMQXAException e) { response = onActiveMQXAExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQQueueMaxConsumerLimitReached e) { response = onActiveMQQueueMaxConsumerLimitReachedWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQException e) { response = onActiveMQExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (Throwable t) { response = onCatchThrowableWhileHandlePacket(packet, t, requiresResponse, response, this.session); } sendResponse(packet, response, false, false); } finally { this.storageManager.clearContext(); } }
private void onSessionConsumerFlowCredit(Packet packet) { this.storageManager.setContext(session.getSessionContext()); try { Packet response = null; boolean requiresResponse = false; try { SessionConsumerFlowCreditMessage message = (SessionConsumerFlowCreditMessage) packet; session.receiveConsumerCredits(message.getConsumerID(), message.getCredits()); } catch (ActiveMQIOErrorException e) { response = onActiveMQIOErrorExceptionWhileHandlePacket(packet, e, requiresResponse, response, this.session); } catch (ActiveMQXAException e) { response = onActiveMQXAExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQQueueMaxConsumerLimitReached e) { response = onActiveMQQueueMaxConsumerLimitReachedWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQException e) { response = onActiveMQExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (Throwable t) { response = onCatchThrowableWhileHandlePacket(packet, t, requiresResponse, response, this.session); } sendResponse(packet, response, false, false); } finally { this.storageManager.clearContext(); } }
private void onSessionAcknowledge(Packet packet) { this.storageManager.setContext(session.getSessionContext()); try { Packet response = null; boolean requiresResponse = false; try { final SessionAcknowledgeMessage message = (SessionAcknowledgeMessage) packet; requiresResponse = message.isRequiresResponse(); this.session.acknowledge(message.getConsumerID(), message.getMessageID()); if (requiresResponse) { response = createNullResponseMessage(packet); } } catch (ActiveMQIOErrorException e) { response = onActiveMQIOErrorExceptionWhileHandlePacket(packet, e, requiresResponse, response, this.session); } catch (ActiveMQXAException e) { response = onActiveMQXAExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQQueueMaxConsumerLimitReached e) { response = onActiveMQQueueMaxConsumerLimitReachedWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQException e) { response = onActiveMQExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (Throwable t) { response = onCatchThrowableWhileHandlePacket(packet, t, requiresResponse, response, this.session); } sendResponse(packet, response, false, false); } finally { this.storageManager.clearContext(); } }
private void onSessionSend(Packet packet) { this.storageManager.setContext(session.getSessionContext()); try { Packet response = null; boolean requiresResponse = false; try { final SessionSendMessage message = (SessionSendMessage) packet; requiresResponse = message.isRequiresResponse(); this.session.send(EmbedMessageUtil.extractEmbedded(message.getMessage()), this.direct); if (requiresResponse) { response = createNullResponseMessage(packet); } } catch (ActiveMQIOErrorException e) { response = onActiveMQIOErrorExceptionWhileHandlePacket(packet, e, requiresResponse, response, this.session); } catch (ActiveMQXAException e) { response = onActiveMQXAExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQQueueMaxConsumerLimitReached e) { response = onActiveMQQueueMaxConsumerLimitReachedWhileHandlePacket(packet, e, requiresResponse, response); } catch (ActiveMQException e) { response = onActiveMQExceptionWhileHandlePacket(packet, e, requiresResponse, response); } catch (Throwable t) { response = onCatchThrowableWhileHandlePacket(packet, t, requiresResponse, response, this.session); } sendResponse(packet, response, false, false); } finally { this.storageManager.clearContext(); } }
storageManager.clearContext();