@Override public String getJMSMessageID() { if (msgID == null) { UUID uid = (UUID)message.getUserID(); msgID = uid == null ? null : "ID:" + uid.toString(); } return msgID; }
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
private boolean rawInitializeNodeId(UUID nodeId) throws SQLException { final PreparedStatement preparedStatement = this.initializeNodeId; preparedStatement.setString(1, nodeId.toString()); final int rows = preparedStatement.executeUpdate(); assert rows <= 1; return rows > 0; }
private void rawWriteNodeId(UUID nodeId) throws SQLException { final PreparedStatement preparedStatement = this.writeNodeId; preparedStatement.setString(1, nodeId.toString()); if (preparedStatement.executeUpdate() != 1) { throw new IllegalStateException("can't write NodeId on the JDBC Node Manager Store!"); } }
@Override public String getJMSMessageID() { if (msgID == null) { UUID uid = (UUID)message.getUserID(); msgID = uid == null ? null : "ID:" + uid.toString(); } return msgID; }
@Override public String getJMSMessageID() { if (msgID == null) { UUID uid = (UUID)message.getUserID(); msgID = uid == null ? null : "ID:" + uid.toString(); } return msgID; }
/** * @param generateUUID */ protected void setUUID(UUID generateUUID) { synchronized (nodeIDGuard) { uuid = generateUUID; nodeID = new SimpleString(uuid.toString()); } }
@Override public String getJMSMessageID() { if (msgID == null) { UUID uid = (UUID)message.getUserID(); msgID = uid == null ? null : "ID:" + uid.toString(); } return msgID; }
@Override public String getJMSMessageID() { if (msgID == null) { UUID uid = (UUID)message.getUserID(); msgID = uid == null ? null : "ID:" + uid.toString(); } return msgID; }
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
bridgeRepresentation = "nodeUUID=" + uuid.toString() + " messageID=" + id; } catch (Throwable ignored) { bridgeRepresentation = null;
@Override public void stop() throws Exception { if (stopping) { return; } stopping = true; if (logger.isDebugEnabled()) { logger.debug("Bridge " + this.name + " being stopped"); } if (futureScheduledReconnection != null) { futureScheduledReconnection.cancel(true); } executor.execute(new StopRunnable()); if (notificationService != null) { TypedProperties props = new TypedProperties(); props.putSimpleStringProperty(new SimpleString("name"), name); Notification notification = new Notification(nodeUUID.toString(), CoreNotificationType.BRIDGE_STOPPED, props); try { notificationService.sendNotification(notification); } catch (Exception e) { ActiveMQServerLogger.LOGGER.broadcastBridgeStoppedError(e); } } }
@Override public void pause() throws Exception { if (logger.isDebugEnabled()) { logger.debug("Bridge " + this.name + " being paused"); } executor.execute(new PauseRunnable()); if (notificationService != null) { TypedProperties props = new TypedProperties(); props.putSimpleStringProperty(new SimpleString("name"), name); Notification notification = new Notification(nodeUUID.toString(), CoreNotificationType.BRIDGE_STOPPED, props); try { notificationService.sendNotification(notification); } catch (Exception e) { ActiveMQServerLogger.LOGGER.notificationBridgeStoppedError(e); } } }
@Override public synchronized void start() throws Exception { if (started) { return; } started = true; stopping = false; activate(); if (notificationService != null) { TypedProperties props = new TypedProperties(); props.putSimpleStringProperty(new SimpleString("name"), name); Notification notification = new Notification(nodeUUID.toString(), CoreNotificationType.BRIDGE_STARTED, props); notificationService.sendNotification(notification); } }
@Test public void testStringToUuidConversion() { UUIDGenerator gen = UUIDGenerator.getInstance(); for (int i = 0; i < MANY_TIMES; i++) { final UUID uuid = gen.generateUUID(); final String uuidString = uuid.toString(); byte[] data2 = UUID.stringToBytes(uuidString); final UUID uuid2 = new UUID(UUID.TYPE_TIME_BASED, data2); assertEqualsByteArrays(uuid.asBytes(), data2); assertEquals(uuidString, uuid, uuid2); assertEquals(uuidString, uuidString, uuid2.toString()); } } }