/** * 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 SimpleString generateSimpleStringUUID() { return new SimpleString(generateStringUUID()); }
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; }
/** * 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()); }
/** * 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; }
/** * 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()); }
@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(); }
@Test public void testManyUUIDs() throws Exception { Set<String> uuidsSet = new HashSet<>(); UUIDGenerator gen = UUIDGenerator.getInstance(); for (int i = 0; i < getTimes(); i++) { uuidsSet.add(gen.generateStringUUID()); } // we put them in a set to check duplicates Assert.assertEquals(getTimes(), uuidsSet.size()); }
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); }