private ClientSession createSessionInternal(final String username, final String password, final boolean xa, final boolean autoCommitSends, final boolean autoCommitAcks, final boolean preAcknowledge, final int ackBatchSize) throws ActiveMQException { String name = UUIDGenerator.getInstance().generateStringUUID(); SessionContext context = createSessionChannel(name, username, password, xa, autoCommitSends, autoCommitAcks, preAcknowledge); ClientSessionInternal session = new ClientSessionImpl(this, name, username, password, xa, autoCommitSends, autoCommitAcks, preAcknowledge, serverLocator.isBlockOnAcknowledge(), serverLocator.isAutoGroup(), ackBatchSize, serverLocator.getConsumerWindowSize(), serverLocator.getConsumerMaxRate(), serverLocator.getConfirmationWindowSize(), serverLocator.getProducerWindowSize(), serverLocator.getProducerMaxRate(), serverLocator.isBlockOnNonDurableSend(), serverLocator.isBlockOnDurableSend(), serverLocator.isCacheLargeMessagesClient(), serverLocator.getMinLargeMessageSize(), serverLocator.isCompressLargeMessage(), serverLocator.getInitialMessagePacketSize(), serverLocator.getGroupID(), context, orderedExecutorFactory.getExecutor(), orderedExecutorFactory.getExecutor(), orderedExecutorFactory.getExecutor()); synchronized (sessions) { if (closed || !clientProtocolManager.isAlive()) { session.close(); return null; } sessions.add(session); } return session; }
closeExecutor = orderedExecutorFactory.getExecutor();
public RemoteGroupingHandler(final ExecutorFactory executorFactory, final ManagementService managementService, final SimpleString name, final SimpleString address, final long timeout, final long groupTimeout) { super(executorFactory != null ? executorFactory.getExecutor() : null, managementService, address); this.name = name; this.timeout = timeout; this.groupTimeout = groupTimeout; }
public BackupManager(ActiveMQServer server, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutor, NodeManager nodeManager, Configuration configuration, ClusterManager clusterManager) { this.server = server; this.executor = executorFactory.getExecutor(); this.scheduledExecutor = scheduledExecutor; this.nodeManager = nodeManager; this.configuration = configuration; this.clusterManager = clusterManager; }
@Override public Executor newExecutor() { return executorFactory.getExecutor(); }
@Override public Executor newExecutor() { return executorFactory.getExecutor(); }
public LocalGroupingHandler(final ExecutorFactory executorFactory, final ScheduledExecutorService scheduledExecutor, final ManagementService managementService, final SimpleString name, final SimpleString address, final StorageManager storageManager, final long timeout, final long groupTimeout, long reaperPeriod) { super(executorFactory.getExecutor(), managementService, address); this.reaperPeriod = reaperPeriod; this.scheduledExecutor = scheduledExecutor; this.name = name; this.storageManager = storageManager; this.timeout = timeout; this.groupTimeout = groupTimeout; }
@Override public synchronized PagingStore newStore(final SimpleString address, final AddressSettings settings) { return new PagingStoreImpl(address, scheduledExecutor, syncTimeout, pagingManager, storageManager, null, this, address, settings, executorFactory.getExecutor(), executorFactory.getExecutor(), syncNonTransactional); }
StompProtocolManager(final StompProtocolManagerFactory factory, final ActiveMQServer server, final List<StompFrameInterceptor> incomingInterceptors, final List<StompFrameInterceptor> outgoingInterceptors) { this.factory = factory; this.server = server; this.executor = server.getExecutorFactory().getExecutor(); this.incomingInterceptors = incomingInterceptors; this.outgoingInterceptors = outgoingInterceptors; }
StompProtocolManager(final StompProtocolManagerFactory factory, final ActiveMQServer server, final List<StompFrameInterceptor> incomingInterceptors, final List<StompFrameInterceptor> outgoingInterceptors) { this.factory = factory; this.server = server; this.executor = server.getExecutorFactory().getExecutor(); this.incomingInterceptors = incomingInterceptors; this.outgoingInterceptors = outgoingInterceptors; }
public static OperationContext getContext(final ExecutorFactory executorFactory) { OperationContext token = OperationContextImpl.threadLocalContext.get(); if (token == null) { if (executorFactory == null) { return null; } else { token = new OperationContextImpl(executorFactory.getExecutor()); OperationContextImpl.threadLocalContext.set(token); } } return token; }
/** * @param remotingConnection */ public ReplicationManager(CoreRemotingConnection remotingConnection, final long timeout, final long initialReplicationSyncTimeout, final ExecutorFactory ioExecutorFactory) { this.ioExecutorFactory = ioExecutorFactory; this.initialReplicationSyncTimeout = initialReplicationSyncTimeout; this.replicatingChannel = remotingConnection.getChannel(CHANNEL_ID.REPLICATION.id, -1); this.remotingConnection = remotingConnection; this.replicationStream = ioExecutorFactory.getExecutor(); this.timeout = timeout; }
@Override public synchronized PagingStore newStore(final SimpleString address, final AddressSettings settings) { return new PagingStoreImpl(address, scheduledExecutor, syncTimeout, pagingManager, storageManager, null, this, address, settings, executorFactory.getExecutor(), syncNonTransactional); }
private void handleHeartBeat(String heartBeatHeader) throws ActiveMQStompException { String[] params = heartBeatHeader.split(","); if (params.length != 2) { throw new ActiveMQStompException(connection, "Incorrect heartbeat header " + heartBeatHeader); } //client ping long minPingInterval = Long.valueOf(params[0]); //client receive ping long minAcceptInterval = Long.valueOf(params[1]); if (heartBeater == null) { heartBeater = new HeartBeater(scheduledExecutorService, executorFactory.getExecutor(), minPingInterval, minAcceptInterval); } }
private void handleHeartBeat(String heartBeatHeader) throws ActiveMQStompException { String[] params = heartBeatHeader.split(","); if (params.length != 2) { throw new ActiveMQStompException(connection, "Incorrect heartbeat header " + heartBeatHeader); } //client ping long minPingInterval = Long.valueOf(params[0]); //client receive ping long minAcceptInterval = Long.valueOf(params[1]); if (heartBeater == null) { heartBeater = new HeartBeater(scheduledExecutorService, executorFactory.getExecutor(), minPingInterval, minAcceptInterval); } }
public ClusterController(ActiveMQServer server, ScheduledExecutorService scheduledExecutor) { this.server = server; executor = server.getExecutorFactory().getExecutor(); quorumManager = new QuorumManager(scheduledExecutor, this); }
@Override public synchronized void start() throws Exception { if (started) { return; } beforeStart(); singleThreadExecutor = ioExecutorFactory.getExecutor(); bindingsJournal.start(); messageJournal.start(); started = true; }
@Override public OperationContext newOperationContext() { return getStorageManager().newContext(getExecutorFactory().getExecutor()); }
public ClusterManager(final ExecutorFactory executorFactory, final ActiveMQServer server, final PostOffice postOffice, final ScheduledExecutorService scheduledExecutor, final ManagementService managementService, final Configuration configuration, final NodeManager nodeManager, final boolean backup) { this.executorFactory = executorFactory; executor = executorFactory.getExecutor(); this.server = server; this.postOffice = postOffice; this.scheduledExecutor = scheduledExecutor; this.managementService = managementService; this.configuration = configuration; this.nodeManager = nodeManager; clusterController = new ClusterController(server, scheduledExecutor); haManager = server.getActivation().getHAManager(); }
public ActiveMQProtonRemotingConnection createConnection(ProtonProtocolManager protocolManager, Connection connection, Optional<EventHandler> eventHandler, ClientSASLFactory clientSASLFactory) { AMQPConnectionCallback connectionCallback = new AMQPConnectionCallback(protocolManager, connection, server.getExecutorFactory().getExecutor(), server); Executor executor = server.getExecutorFactory().getExecutor(); AMQPConnectionContext amqpConnection = new AMQPConnectionContext(protocolManager, connectionCallback, containerId, ttl, protocolManager.getMaxFrameSize(), AMQPConstants.Connection.DEFAULT_CHANNEL_MAX, useCoreSubscriptionNaming, server.getScheduledPool(), false, clientSASLFactory, connectionProperties); eventHandler.ifPresent(amqpConnection::addEventHandler); ActiveMQProtonRemotingConnection delegate = new ActiveMQProtonRemotingConnection(protocolManager, amqpConnection, connection, executor); delegate.addFailureListener(connectionCallback); delegate.addCloseListener(connectionCallback); connectionCallback.setProtonConnectionDelegate(delegate); return delegate; } }