Commit daa8132d authored by Matt Tucker's avatar Matt Tucker Committed by matt

Minor tweaks.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3826 b35dd754-fafc-0310-a699-88a17e54d16e
parent bb05b9a0
...@@ -24,8 +24,8 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -24,8 +24,8 @@ import java.util.concurrent.ConcurrentHashMap;
/** /**
* Manages sequences of unique ID's that get stored in the database. Database support for sequences * Manages sequences of unique ID's that get stored in the database. Database support for sequences
* varies widely; some don't use them at all. Instead, we handle unique ID generation with a * varies widely; some don't use them at all. Instead, we handle unique ID generation with a
* combination VM/database solution.<p> * combination VM/database solution.<p/>
* <p/> *
* A special table in the database doles out blocks of unique ID's to each * A special table in the database doles out blocks of unique ID's to each
* virtual machine that interacts with Jive. This has the following consequences: * virtual machine that interacts with Jive. This has the following consequences:
* <ul> * <ul>
...@@ -34,8 +34,8 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -34,8 +34,8 @@ import java.util.concurrent.ConcurrentHashMap;
* <li>The order of unique id's may not correspond to the creation date of objects. * <li>The order of unique id's may not correspond to the creation date of objects.
* <li>There can be gaps in ID's after server restarts since blocks will get "lost" if the block * <li>There can be gaps in ID's after server restarts since blocks will get "lost" if the block
* size is greater than 1. * size is greater than 1.
* </ul><p> * </ul><p/>
* <p/> *
* Each sequence type that this class manages has a different block size value. Objects that aren't * Each sequence type that this class manages has a different block size value. Objects that aren't
* created often have a block size of 1, while frequently created objects such as entries and * created often have a block size of 1, while frequently created objects such as entries and
* comments have larger block sizes. * comments have larger block sizes.
...@@ -83,22 +83,19 @@ public class SequenceManager { ...@@ -83,22 +83,19 @@ public class SequenceManager {
/** /**
* Returns the next id for an object that has defined the annotation {@link JiveID}. * Returns the next id for an object that has defined the annotation {@link JiveID}.
* The JiveID annotation value is the synonymous for the type integer. * The JiveID annotation value is the synonymous for the type integer.<p/>
* <p/> *
* The annotation JiveID should contain the id type for the object (the same number you would * The annotation JiveID should contain the id type for the object (the same number you would
* use to call nextID(int type)) * use to call nextID(int type)). Example class definition:
* <p/>
* Example class definition:
* <p/>
* <code> * <code>
* \@JiveID(10) * \@JiveID(10)
* public class MyClass { * public class MyClass {
* <p/> *
* } * }
* </code> * </code>
* *
* @param o object that has annotation JiveID * @param o object that has annotation JiveID.
* @return the next int * @return the next unique ID.
* @throws IllegalArgumentException If the object passed in does not defined {@link JiveID} * @throws IllegalArgumentException If the object passed in does not defined {@link JiveID}
*/ */
public static long nextID(Object o) { public static long nextID(Object o) {
...@@ -114,11 +111,12 @@ public class SequenceManager { ...@@ -114,11 +111,12 @@ public class SequenceManager {
} }
/** /**
* Used to set the blocksize of a given SequenceManager. If no SequenceManager has been registered * Used to set the blocksize of a given SequenceManager. If no SequenceManager has
* for the type we will verify the type is valid and then create a new sequence manager for it. * been registered for the type, the type is verified as valid and then a new
* sequence manager is created.
* *
* @param type the type of unique id * @param type the type of unique id.
* @param blockSize how many blocks of ids we should * @param blockSize how many blocks of ids we should.
*/ */
public static void setBlockSize(int type, int blockSize) { public static void setBlockSize(int type, int blockSize) {
if (managers.containsKey(type)) { if (managers.containsKey(type)) {
...@@ -245,6 +243,7 @@ public class SequenceManager { ...@@ -245,6 +243,7 @@ public class SequenceManager {
Thread.sleep(75); Thread.sleep(75);
} }
catch (InterruptedException ie) { catch (InterruptedException ie) {
// Ignore.
} }
getNextBlock(count - 1); getNextBlock(count - 1);
} }
...@@ -265,5 +264,4 @@ public class SequenceManager { ...@@ -265,5 +264,4 @@ public class SequenceManager {
DbConnectionManager.closeConnection(pstmt, null); DbConnectionManager.closeConnection(pstmt, null);
} }
} }
} }
\ No newline at end of file
...@@ -173,7 +173,8 @@ public class Group implements Cacheable { ...@@ -173,7 +173,8 @@ public class Group implements Cacheable {
public void setDescription(String description) { public void setDescription(String description) {
if (description == this.description || if (description == this.description ||
(description != null && description.equals(this.description)) || (description != null && description.equals(this.description)) ||
provider.isReadOnly()) { provider.isReadOnly())
{
// Do nothing // Do nothing
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment