/** * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} * and any parameters needed. * * @param className The class name of the ConnectorFactory * @param params The parameters needed by the ConnectorFactory */ public TransportConfiguration(final String className, final Map<String, Object> params) { this(className, params, UUIDGenerator.getInstance().generateStringUUID()); }
/** * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} * * @param className The class name of the ConnectorFactory */ public TransportConfiguration(final String className) { this(className, new HashMap<String, Object>(), UUIDGenerator.getInstance().generateStringUUID()); }
public ActiveMQConnection(final ConnectionFactoryOptions options, final String username, final String password, final int connectionType, final String clientID, final int dupsOKBatchSize, final int transactionBatchSize, final boolean cacheDestinations, final boolean enable1xPrefixes, final ClientSessionFactory sessionFactory) { this.options = options; this.username = username; this.password = password; this.connectionType = connectionType; this.clientID = clientID; this.sessionFactory = sessionFactory; uid = UUIDGenerator.getInstance().generateSimpleStringUUID(); thisVersion = VersionLoader.getVersion(); this.dupsOKBatchSize = dupsOKBatchSize; this.transactionBatchSize = transactionBatchSize; this.cacheDestinations = cacheDestinations; this.enable1xPrefixes = enable1xPrefixes; creationStack = new Exception(); }
public ClientProducerImpl(final ClientSessionInternal session, final SimpleString address, final TokenBucketLimiter rateLimiter, final boolean blockOnNonDurableSend, final boolean blockOnDurableSend, final boolean autoGroup, final SimpleString groupID, final int minLargeMessageSize, final SessionContext sessionContext) { this.sessionContext = sessionContext; this.session = session; this.address = address; this.rateLimiter = rateLimiter; this.blockOnNonDurableSend = blockOnNonDurableSend; this.blockOnDurableSend = blockOnDurableSend; if (autoGroup) { this.groupID = UUIDGenerator.getInstance().generateSimpleStringUUID(); } else { this.groupID = groupID; } this.minLargeMessageSize = minLargeMessageSize; if (address != null) { producerCredits = session.getCredits(address, false); } else { producerCredits = null; } }
this.nodeID = UUIDGenerator.getInstance().generateStringUUID();
this.name = UUIDGenerator.getInstance().generateStringUUID();
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; }
UUID uid = UUIDGenerator.getInstance().generateUUID();
/** * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} * and any parameters needed. * * @param className The class name of the ConnectorFactory * @param params The parameters needed by the ConnectorFactory */ public TransportConfiguration(final String className, final Map<String, Object> params) { this(className, params, UUIDGenerator.getInstance().generateStringUUID()); }
/** * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} * * @param className The class name of the ConnectorFactory */ public TransportConfiguration(final String className) { this(className, new HashMap<String, Object>(), UUIDGenerator.getInstance().generateStringUUID()); }
/** * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} * and any parameters needed. * * @param className The class name of the ConnectorFactory * @param params The parameters needed by the ConnectorFactory */ public TransportConfiguration(final String className, final Map<String, Object> params) { this(className, params, UUIDGenerator.getInstance().generateStringUUID()); }
/** * @param routingName the routingName to set */ public DivertConfiguration setRoutingName(final String routingName) { if (routingName == null) { this.routingName = UUIDGenerator.getInstance().generateStringUUID(); } else { this.routingName = routingName; } return this; }
public InVMNodeManager(boolean replicatedBackup, File directory) { super(replicatedBackup, directory); liveLock = new Semaphore(1); backupLock = new Semaphore(1); setUUID(UUIDGenerator.getInstance().generateUUID()); }
@Override public synchronized SequentialFileFactory newFileFactory(final SimpleString address) throws Exception { String guid = UUIDGenerator.getInstance().generateStringUUID(); SequentialFileFactory factory = newFileFactory(guid); factory.createDirs(); File fileWithID = new File(directory, guid + File.separatorChar + PagingStoreFactoryNIO.ADDRESS_FILE); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileWithID)))) { writer.write(address.toString()); writer.newLine(); } return factory; }
public BroadcastGroupImpl(final NodeManager nodeManager, final String name, final long broadCastPeriod, final ScheduledExecutorService scheduledExecutor, final BroadcastEndpointFactory endpointFactory) throws Exception { this.nodeManager = nodeManager; this.name = name; this.scheduledExecutor = scheduledExecutor; this.broadCastPeriod = broadCastPeriod; this.endpoint = endpointFactory.createBroadcastEndpoint(); uniqueID = UUIDGenerator.getInstance().generateStringUUID(); }
protected TransportConfiguration generateTC(String debug) { String className = "org.foo.bar." + debug + "|" + UUIDGenerator.getInstance().generateStringUUID() + ""; String name = UUIDGenerator.getInstance().generateStringUUID(); Map<String, Object> params = new HashMap<>(); params.put(UUIDGenerator.getInstance().generateStringUUID(), 123); params.put(UUIDGenerator.getInstance().generateStringUUID(), UUIDGenerator.getInstance().generateStringUUID()); params.put(UUIDGenerator.getInstance().generateStringUUID(), true); TransportConfiguration tc = new TransportConfiguration(className, params, name); return tc; }
private Message createQueueInfoMessage(final NotificationType type, final SimpleString queueName) { Message message = new CoreMessage().initBuffer(50).setMessageID(storageManager.generateID()); message.setAddress(queueName); String uid = UUIDGenerator.getInstance().generateStringUUID(); message.putStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE, new SimpleString(type.toString())); message.putLongProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP, System.currentTimeMillis()); message.putStringProperty(new SimpleString("foobar"), new SimpleString(uid)); return message; }
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; }
protected final ServerLocator createInVMLocator(final int serverID) { TransportConfiguration tnspConfig = createInVMTransportConnectorConfig(serverID, UUIDGenerator.getInstance().generateStringUUID()); ServerLocator locator = ActiveMQClient.createServerLocatorWithHA(tnspConfig); return addServerLocator(locator); }
void prepare() throws Exception { session = sf.createSession(true, true, 0); queueName = UUIDGenerator.getInstance().generateStringUUID(); session.createQueue(dest, RoutingType.ANYCAST, queueName); consumer = session.createConsumer(queueName); consumer.setMessageHandler(this); }