use of org.apache.activemq.artemis.utils.UUID in project activemq-artemis by apache.
the class FileLockNodeManager method readNodeId.
@Override
public final SimpleString readNodeId() throws ActiveMQIllegalStateException, IOException {
ByteBuffer id = ByteBuffer.allocateDirect(16);
int read = channel.read(id, 3);
if (read != 16) {
throw new ActiveMQIllegalStateException("live server did not write id to file");
}
byte[] bytes = new byte[16];
id.position(0);
id.get(bytes);
setUUID(new UUID(UUID.TYPE_TIME_BASED, bytes));
return getNodeId();
}
Aggregations