public void resetContext(OperationContext oldContext) { storageManager.setContext(oldContext); }
public void resetContext(OperationContext oldContext) { storageManager.setContext(oldContext); }
@Override public void setContext(OperationContext context) { manager.setContext(context); }
private void recoverOperationContext() { server.getStorageManager().setContext(this.operationContext); }
@Override public void run() { storageManager.setContext(storageManager.newSingleThreadContext()); try { if (cleanupEnabled) { cleanup(); } } finally { storageManager.clearContext(); scheduledCleanup.decrementAndGet(); } } });
public OperationContext recoverContext() { OperationContext oldContext = storageManager.getContext(); manager.getServer().getStorageManager().setContext(serverSession.getSessionContext()); return oldContext; }
public OperationContext recoverContext() { OperationContext oldContext = storageManager.getContext(); manager.getServer().getStorageManager().setContext(serverSession.getSessionContext()); return oldContext; }
public StompSession getTransactedSession(StompConnection connection, String txID) throws Exception { StompSession stompSession = transactedSessions.get(txID); if (stompSession == null) { stompSession = new StompSession(connection, this, server.getStorageManager().newContext(executor)); String name = UUIDGenerator.getInstance().generateStringUUID(); ServerSession session = server.createSession(name, connection.getLogin(), connection.getPasscode(), ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, connection, false, false, false, false, null, stompSession, true, server.newOperationContext(), getPrefixes()); stompSession.setServerSession(session); transactedSessions.put(txID, stompSession); } server.getStorageManager().setContext(stompSession.getContext()); return stompSession; }
private StompSession internalGetSession(StompConnection connection, Map<Object, StompSession> sessions, Object id, boolean transacted) throws Exception { StompSession stompSession = sessions.get(id); if (stompSession == null) { stompSession = new StompSession(connection, this, server.getStorageManager().newContext(server.getExecutorFactory().getExecutor())); String name = UUIDGenerator.getInstance().generateStringUUID(); ServerSession session = server.createSession(name, connection.getLogin(), connection.getPasscode(), ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, connection, !transacted, false, false, false, null, stompSession, true, server.newOperationContext(), getPrefixes()); stompSession.setServerSession(session); sessions.put(id, stompSession); } server.getStorageManager().setContext(stompSession.getContext()); return stompSession; }
storageManager.setContext(storageManager.newSingleThreadContext()); storageManager.setContext(originalCtx);
public StompSession getSession(StompConnection connection) throws Exception { StompSession stompSession = sessions.get(connection.getID()); if (stompSession == null) { stompSession = new StompSession(connection, this, server.getStorageManager().newContext(server.getExecutorFactory().getExecutor())); String name = UUIDGenerator.getInstance().generateStringUUID(); ServerSession session = server.createSession(name, connection.getLogin(), connection.getPasscode(), ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, connection, true, false, false, false, null, stompSession, true, server.newOperationContext(), getPrefixes()); stompSession.setServerSession(session); sessions.put(connection.getID(), stompSession); } server.getStorageManager().setContext(stompSession.getContext()); return stompSession; }
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(); } }
private void slowPacketHandler(final Packet packet) { final byte type = packet.getType(); storageManager.setContext(session.getSessionContext());