From 9ace610ca5bb156aa7a9d004eab3774829cf1cdc Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Fri, 24 Oct 2014 11:48:51 +0100 Subject: [PATCH] Fixed Javadoc errors for Java 8 --- .../chronicle/common/ChronicleHash.java | 2 +- .../common/ChronicleHashBuilder.java | 1 + .../common/serialization/BytesInterop.java | 2 +- .../chronicle/map/ChannelProvider.java | 1 + .../chronicle/map/ChronicleMapBuilder.java | 52 +++++++++---------- .../net/openhft/chronicle/map/Replica.java | 4 +- .../chronicle/map/ReplicatedChronicleMap.java | 33 +++++++----- .../openhft/chronicle/map/TcpReplicator.java | 2 +- .../chronicle/map/ThrottlingConfig.java | 2 +- .../chronicle/map/VanillaChronicleMap.java | 10 ++-- .../chronicle/map/jrs166/JSR166TestCase.java | 30 +++++------ .../map/utility/ProcessInstanceLimiter.java | 18 +++---- 12 files changed, 84 insertions(+), 73 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/common/ChronicleHash.java b/src/main/java/net/openhft/chronicle/common/ChronicleHash.java index d28cf798f..c582f9e30 100644 --- a/src/main/java/net/openhft/chronicle/common/ChronicleHash.java +++ b/src/main/java/net/openhft/chronicle/common/ChronicleHash.java @@ -37,7 +37,7 @@ public interface ChronicleHash extends Closeable { * * @return the file this {@link ChronicleMap} or {@link ChronicleSet} is mapped to, * or {@code null} if it is not mapped to any file - * @see ChronicleHashBuilder#create(File) + * @see ChronicleHashBuilder#file(java.io.File) * @see ChronicleHashBuilder#create() */ File file(); diff --git a/src/main/java/net/openhft/chronicle/common/ChronicleHashBuilder.java b/src/main/java/net/openhft/chronicle/common/ChronicleHashBuilder.java index 0d9519491..8632672c4 100644 --- a/src/main/java/net/openhft/chronicle/common/ChronicleHashBuilder.java +++ b/src/main/java/net/openhft/chronicle/common/ChronicleHashBuilder.java @@ -390,6 +390,7 @@ public interface ChronicleHashBuilder type of marshalled objects */ diff --git a/src/main/java/net/openhft/chronicle/map/ChannelProvider.java b/src/main/java/net/openhft/chronicle/map/ChannelProvider.java index 9114bd353..d6f2a61e2 100644 --- a/src/main/java/net/openhft/chronicle/map/ChannelProvider.java +++ b/src/main/java/net/openhft/chronicle/map/ChannelProvider.java @@ -211,6 +211,7 @@ public final class ChannelProvider implements Closeable { * per channel could be obtained from a single {@code ReplicatingChannel}. The returned replicator could * be applied to a map at most once. * + * @param channel number to create * @return a replicator, dedicated to the specified channel */ public ChronicleChannel createChannel(short channel) { diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java index ed40a3ad5..2d1518502 100644 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java @@ -63,21 +63,21 @@ import static net.openhft.chronicle.map.Objects.builderEquals; * ChronicleMap map1 = builder.create(); * ChronicleMap map2 = builder.create();} * i. e. created {@code ChronicleMap} instances don't depend on the builder. - *

+ * *

Use static {@link #of(Class, Class)} method to obtain a {@code ChronicleMapBuilder} instance. - *

+ * *

{@code ChronicleMapBuilder} is mutable, see a note in {@link net.openhft.chronicle.common.ChronicleHashBuilder} * interface documentation. - *

+ * *

Later in this documentation, "ChronicleMap" means "ChronicleMaps, created by {@code * ChronicleMapBuilder}", unless specified different, because theoretically someone might provide * {@code ChronicleMap} implementations with completely different properties. - *

+ * *

{@code ChronicleMap} ("ChronicleMaps, created by {@code ChronicleMapBuilder}") currently * doesn't support resizing. That is why you should always configure {@linkplain * #entries(long) number of entries} you are going to insert into the created map at most. * See {@link #entries(long)} method documentation for more information on this. - *

+ * *

{@code ChronicleMap} allocates memory by equally sized chunks. This size is called {@linkplain * #entrySize(int) entry size}, you are strongly recommended to configure it to achieve least memory * consumption and best speed. See {@link #entrySize(int)} method documentation for more information @@ -187,7 +187,7 @@ public class ChronicleMapBuilder implements Cloneable, /** * {@inheritDoc} - *

+ * *

Example: if keys in your map(s) are English words in {@link String} form, keys size 10 * (a bit more than average English word length) would be a good choice:

{@code
      * ChronicleMap wordFrequencies = ChronicleMapBuilder
@@ -214,7 +214,7 @@ public class ChronicleMapBuilder implements Cloneable,
 
     /**
      * {@inheritDoc}
-     * 

+ * *

For example, if your keys are Git commit hashes:

{@code
      * Map gitCommitMessagesByHash =
      *     ChronicleMapBuilder.of(byte[].class, String.class)
@@ -238,10 +238,10 @@ public class ChronicleMapBuilder implements Cloneable,
      * Configures the optimal number of bytes, taken by serialized form of values, put into maps,
      * created by this builder. If value size is always the same, call {@link
      * #constantValueSizeBySample(Object)} method instead of this one.
-     * 

+ * *

If value is a boxed primitive type or {@link Byteable} subclass, i. e. if value size is * known statically, it is automatically accounted and shouldn't be specified by user. - *

+ * *

If value size varies moderately, specify the size higher than average, but lower than the * maximum possible, to minimize average memory overuse. If value size varies in a wide range, * it's better to use {@linkplain #entrySize(int) entry size} in "chunk" mode and configure it @@ -263,10 +263,10 @@ public class ChronicleMapBuilder implements Cloneable, * Configures the constant number of bytes, taken by serialized form of values, put into maps, * created by this builder. This is done by providing the {@code sampleValue}, all values should * take the same number of bytes in serialized form, as this sample object. - *

+ * *

If values are of boxed primitive type or {@link Byteable} subclass, i. e. if value size is * known statically, it is automatically accounted and this method shouldn't be called. - *

+ * *

If value size varies, method {@link #valueSize(int)} or {@link #entrySize(int)} should be * called instead of this one. * @@ -295,16 +295,16 @@ public class ChronicleMapBuilder implements Cloneable, /** * {@inheritDoc} - *

+ * *

In fully default case you can expect entry size to be about 256 bytes. But it is strongly * recommended always to configure {@linkplain #keySize(int) key size} and {@linkplain * #valueSize(int) value size}, if they couldn't be derived statically. - *

+ * *

If entry size is not configured explicitly by calling this method, it is computed based on * {@linkplain #metaDataBytes(int) meta data bytes}, plus {@linkplain #keySize(int) key size}, * plus {@linkplain #valueSize(int) value size}, plus a few bytes required by implementations, * with respect to {@linkplain #entryAndValueAlignment(Alignment) alignment}. - *

+ * *

Note that the actual entrySize will be aligned to 4 (default {@linkplain * #entryAndValueAlignment(Alignment) entry alignment}). I. e. if you set entry size to 30, the * actual entry size will be 32 (30 aligned to 4 bytes). If you don't want entry size to be @@ -352,15 +352,15 @@ public class ChronicleMapBuilder implements Cloneable, /** * Configures alignment strategy of address in memory of entries and independently of address in * memory of values within entries in ChronicleMaps, created by this builder. - *

+ * *

Useful when values of the map are updated intensively, particularly fields with volatile * access, because it doesn't work well if the value crosses cache lines. Also, on some * (nowadays rare) architectures any misaligned memory access is more expensive than aligned. - *

+ * *

Note that {@linkplain #entrySize(int) entry size} will be aligned according to this * alignment. I. e. if you set {@code entrySize(20)} and {@link Alignment#OF_8_BYTES}, actual * entry size will be 24 (20 aligned to 8 bytes). - *

+ * *

Default is {@link Alignment#OF_4_BYTES}. * * @param alignment the new alignment of the maps constructed by this builder @@ -449,12 +449,12 @@ public class ChronicleMapBuilder implements Cloneable, * Configures if the maps created by this builder should return {@code null} instead of previous * mapped values on {@link ChronicleMap#put(Object, Object) ChornicleMap.put(key, value)} * calls. - *

+ * *

{@link Map#put(Object, Object) Map.put()} returns the previous value, functionality which * is rarely used but fairly cheap for {@link HashMap}. In the case, for an off heap collection, * it has to create a new object and deserialize the data from off-heap memory. It's expensive * for something you probably don't use. - *

+ * *

By default, of cause, {@code ChronicleMap} conforms the general {@code Map} contract and * returns the previous mapped value on {@code put()} calls. * @@ -476,7 +476,7 @@ public class ChronicleMapBuilder implements Cloneable, /** * Configures if the maps created by this builder should return {@code null} instead of the last * mapped value on {@link ChronicleMap#remove(Object) ChronicleMap.remove(key)} calls. - *

+ * *

{@link Map#remove(Object) Map.remove()} returns the previous value, functionality which is * rarely used but fairly cheap for {@link HashMap}. In the case, for an off heap collection, it * has to create a new object and deserialize the data from off-heap memory. It's expensive for @@ -637,7 +637,7 @@ public class ChronicleMapBuilder implements Cloneable, /** * {@inheritDoc} - *

+ * *

Example:

{@code Map map =
      *     ChronicleMapBuilder.of(Key.class, Value.class)
      *     .entries(1_000_000)
@@ -645,7 +645,7 @@ public class ChronicleMapBuilder implements Cloneable,
      *     // this class hasn't implemented yet, just for example
      *     .objectSerializer(new KryoObjectSerializer())
      *     .create();}
- *

+ * *

This serializer is used to serialize both keys and values, if they both require this: * loosely typed, nullable, and custom {@linkplain #keyMarshaller(BytesMarshaller) key} and * {@linkplain #valueMarshallerAndFactory(BytesMarshaller, ObjectFactory) value} marshallers are @@ -660,7 +660,7 @@ public class ChronicleMapBuilder implements Cloneable, /** * {@inheritDoc} - *

+ * *

Example: */ @Override @@ -719,10 +719,10 @@ public class ChronicleMapBuilder implements Cloneable, * Specifies the value to be put for each key queried in {@link ChronicleMap#get get()} and * {@link ChronicleMap#getUsing(Object, Object) getUsing()} methods, if the key is absent in the * map. Then this default value is returned from query method. - *

+ * *

Setting default value to {@code null} is interpreted as map shouldn't put any default * value for absent keys. This is by default. - *

+ * *

This configuration overrides any previous {@link #defaultValueProvider(DefaultValueProvider)} * configuration to this {@code ChronicleMapBuilder}. * @@ -741,7 +741,7 @@ public class ChronicleMapBuilder implements Cloneable, * and {@link ChronicleMap#getUsing(Object, Object) getUsing()} calls, if the key is absent in * the map. If the obtained value is non-null, it is put for the key in the map and then * returned from current {@code get()} or {@code getUsing()} call. - *

+ * *

This configuration overrides any previous {@link #defaultValue(Object)} configuration to * this {@code ChronicleMapBuilder}. * diff --git a/src/main/java/net/openhft/chronicle/map/Replica.java b/src/main/java/net/openhft/chronicle/map/Replica.java index d118ead99..b4664a1c5 100644 --- a/src/main/java/net/openhft/chronicle/map/Replica.java +++ b/src/main/java/net/openhft/chronicle/map/Replica.java @@ -58,7 +58,7 @@ public interface Replica extends Closeable { /** * Returns the timestamp of the last change from the specified remote node, already replicated to this - * Replica.

Used in conjunction with replication, to back fill data from a remote node. This node + * Replica.

Used in conjunction with replication, to back fill data from a remote node. This node * may have missed updates while it was not been running or connected via TCP. * * @param remoteIdentifier the identifier of the remote node to check last replicated update time from @@ -110,7 +110,7 @@ public interface Replica extends Closeable { /** * Dirties all entries with a modification time equal to {@code fromTimeStamp} or newer. It means all * these entries will be considered as "new" by this ModificationIterator and iterated once again no - * matter if they have already been.

This functionality is used to publish recently modified + * matter if they have already been.

This functionality is used to publish recently modified * entries to a new remote node as it connects. * * @param fromTimeStamp the timestamp from which all entries should be dirty diff --git a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java index a26724629..24e3a811c 100644 --- a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java @@ -44,7 +44,8 @@ import static net.openhft.chronicle.common.serialization.Hasher.hash; import static net.openhft.lang.collection.DirectBitSet.NOT_FOUND; /** - * A Replicating Multi Master HashMap

Each remote hash map, mirrors its changes over to + *

A Replicating Multi Master HashMap

+ *

Each remote hash map, mirrors its changes over to * another remote hash map, neither hash map is considered the master store of data, each hash map * uses timestamps to reconcile changes. We refer to an instance of a remote hash-map as a node. A * node will be connected to any number of other nodes, for the first implementation the maximum @@ -56,8 +57,10 @@ import static net.openhft.lang.collection.DirectBitSet.NOT_FOUND; * nature of this multi master implementation, this return value will only be the old value on the * nodes local data store. In other words the nodes are only concurrent locally. Its worth realising * that another node performing exactly the same operation may return a different value. However - * reconciliation will ensure the maps themselves become eventually consistent.

- *

Reconciliation

If two ( or more nodes ) were to receive a change to their maps for the + * reconciliation will ensure the maps themselves become eventually consistent. + *

+ *

Reconciliation

+ *

If two ( or more nodes ) were to receive a change to their maps for the * same key but different values, say by a user of the maps, calling the put(key, value). Then, * initially each node will update its local store and each local store will hold a different value, * but the aim of multi master replication is to provide eventual consistency across the nodes. So, @@ -67,7 +70,8 @@ import static net.openhft.lang.collection.DirectBitSet.NOT_FOUND; * and value. Eventual consistency is achieved by looking at the timestamp from the remote node, if * for a given key, the remote nodes timestamp is newer than the local nodes timestamp, then the * event from the remote node will be applied to the local node, otherwise the event will be - * ignored.

However there is an edge case that we have to concern ourselves with, If two + * ignored.

+ *

However there is an edge case that we have to concern ourselves with, If two * nodes update their map at the same time with different values, we have to deterministically * resolve which update wins, because of eventual consistency both nodes should end up locally * holding the same data. Although it is rare two remote nodes could receive an update to their maps @@ -77,6 +81,7 @@ import static net.openhft.lang.collection.DirectBitSet.NOT_FOUND; * made to one node should be identical to the decision made to the other. We resolve this simple * dilemma by using a node identifier, each node will have a unique identifier, the update from the * node with the smallest identifier wins. + *

* * @param the entries key type * @param the entries value type @@ -865,7 +870,7 @@ class ReplicatedChronicleMap, /** * Used only with replication, its sometimes possible to receive an old ( or stale update ) * from a remote map. This method is used to determine if we should ignore such updates. - *

We can reject put() and removes() when comparing times stamps with remote + *

We can reject put() and removes() when comparing times stamps with remote * systems * * @param entry the maps entry @@ -1339,15 +1344,18 @@ class ReplicatedChronicleMap, } /** - * Once a change occurs to a map, map replication requires that these changes are picked up by - * another thread, this class provides an iterator like interface to poll for such changes.

+ *

Once a change occurs to a map, map replication requires that these changes are picked up by + * another thread, this class provides an iterator like interface to poll for such changes. + *

*

In most cases the thread that adds data to the node is unlikely to be the same thread that * replicates the data over to the other nodes, so data will have to be marshaled between the - * main thread storing data to the map, and the thread running the replication.

One way - * to perform this marshalling, would be to pipe the data into a queue. However, This class + * main thread storing data to the map, and the thread running the replication. + *

+ *

One way to perform this marshalling, would be to pipe the data into a queue. However, This class * takes another approach. It uses a bit set, and marks bits which correspond to the indexes of * the entries that have changed. It then provides an iterator like interface to poll for such * changes. + *

* * @author Rob Austin. */ @@ -1543,7 +1551,7 @@ abstract class Replicator { /** * Applies the replicator to the map instance and returns a Closeable token to manage resources, - * associated with the replication.

This method isn't intended to be called from the + * associated with the replication.

This method isn't intended to be called from the * client code. * * @param builder the builder from which the map was constructed. The replicator may @@ -1552,7 +1560,7 @@ abstract class Replicator { * @param map a replicated map instance. Provides basic tools for replication * implementation. * @param entryExternalizable the callback for ser/deser implementation in the replicator - * @param chronicleMap + * @param chronicleMap to wrap. * @return a {@code Closeable} token to control replication resources. It should be closed on * closing the replicated map. * @throws java.io.IOException if an io error occurred during the replicator setup @@ -1562,7 +1570,8 @@ abstract class Replicator { * maps) */ protected abstract Closeable applyTo(ChronicleMapBuilder builder, - Replica map, Replica.EntryExternalizable entryExternalizable, final ChronicleMap chronicleMap) + Replica map, Replica.EntryExternalizable entryExternalizable, + final ChronicleMap chronicleMap) throws IOException; } diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index b19c9765e..6b9982367 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -41,7 +41,7 @@ import static net.openhft.chronicle.map.StatelessChronicleMap.EventId.HEARTBEAT; /** * Used with a {@see net.openhft.map.ReplicatedSharedHashMap} to send data between the maps using a - * socket connection

{@see net.openhft.map.OutSocketReplicator} + * socket connection {@see net.openhft.map.OutSocketReplicator} * * @author Rob Austin. */ diff --git a/src/main/java/net/openhft/chronicle/map/ThrottlingConfig.java b/src/main/java/net/openhft/chronicle/map/ThrottlingConfig.java index 103b46356..c11658266 100644 --- a/src/main/java/net/openhft/chronicle/map/ThrottlingConfig.java +++ b/src/main/java/net/openhft/chronicle/map/ThrottlingConfig.java @@ -108,7 +108,7 @@ public class ThrottlingConfig { /** - * Returns the throttle bucketing interval in the given time units.

Default throttle bucketing + * Returns the throttle bucketing interval in the given time units.

Default throttle bucketing * interval is 100 millis. * * @param unit the time unit of the interval diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 650b84b6a..60db05846 100644 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -715,10 +715,10 @@ class VanillaChronicleMap, } /** - * Used to acquire an object of type V from the Segment.

{@code usingValue} is reused to read the - * value if key is present in this Segment, if key is absent in this Segment:

  1. If {@code + * Used to acquire an object of type V from the Segment. {@code usingValue} is reused to read the + * value if key is present in this Segment, if key is absent in this Segment:
    1. If {@code * create == false}, just {@code null} is returned (except when event listener provides a value "on - * get missing" - then it is put into this Segment for the key).
    2. If {@code create == + * get missing" - then it is put into this Segment for the key).
    3. If {@code create == * true}, {@code usingValue} or a newly created instance of value class, if {@code usingValue == * null}, is put into this Segment for the key.
    * @@ -999,7 +999,7 @@ class VanillaChronicleMap, /** * Removes a key (or key-value pair) from the Segment. - *

    + * *

    The entry will only be removed if {@code expectedValue} equals to {@code null} * or the value previously corresponding to the specified key. * @@ -1061,7 +1061,7 @@ class VanillaChronicleMap, } /** - * Replaces the specified value for the key with the given value.

    {@code newValue} is set only if + * Replaces the specified value for the key with the given value. {@code newValue} is set only if * the existing value corresponding to the specified key is equal to {@code expectedValue} or {@code * expectedValue == null}. * diff --git a/src/test/java/net/openhft/chronicle/map/jrs166/JSR166TestCase.java b/src/test/java/net/openhft/chronicle/map/jrs166/JSR166TestCase.java index 6b6b9519f..0f0f9445e 100644 --- a/src/test/java/net/openhft/chronicle/map/jrs166/JSR166TestCase.java +++ b/src/test/java/net/openhft/chronicle/map/jrs166/JSR166TestCase.java @@ -42,9 +42,9 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; * cause the associated test that generated them to itself Assert.fail (which * JUnit does not otherwise arrange). The rules for creating such * tests are: - *

    + * *

      - *

      + * *

    1. All assertions in code running in generated threads must use * the forms {@link #threadFail}, {@link #threadAssertTrue}, {@link * #threadAssertEquals}, or {@link #threadAssertNull}, (not @@ -52,12 +52,12 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; * particularly recommended) for other code to use these forms too. * Only the most typically used JUnit assertion methods are defined * this way, but enough to live with.
    2. - *

      + * *

    3. If you override {@link #setUp} or {@link #tearDown}, make sure * to invoke {@code super.setUp} and {@code super.tearDown} within * them. These methods are used to clear and check for thread * assertion Assert.failures.
    4. - *

      + * *

    5. All delays and timeouts must use one of the constants {@code * SHORT_DELAY_MS}, {@code SMALL_DELAY_MS}, {@code MEDIUM_DELAY_MS}, * {@code LONG_DELAY_MS}. The idea here is that a SHORT is always @@ -68,17 +68,17 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; * MEDIUM. And so on. These constants are set to conservative values, * but even so, if there is ever any doubt, they can all be increased * in one spot to rerun tests on slower platforms.
    6. - *

      + * *

    7. All threads generated must be joined inside each test case * method (or {@code Assert.fail} to do so) before returning from the * method. The {@code joinPool} method can be used to do this when * using Executors.
    8. - *

      + * *

    - *

    + * *

    Other notes *

      - *

      + * *

    • Usually, there is one testcase method per JSR166 method * covering "normal" operation, and then as many exception-testing * methods as there are exceptions the method can throw. Sometimes @@ -86,26 +86,26 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; * "normal" behaviors differ significantly. And sometimes testcases * cover multiple methods when they cannot be tested in * isolation.
    • - *

      + * *

    • The documentation style for testcases is to provide as javadoc * a simple sentence or two describing the property that the testcase * method purports to test. The javadocs do not say anything about how * the property is tested. To find out, read the code.
    • - *

      + * *

    • These tests are "conformance tests", and do not attempt to * test throughput, latency, scalability or other performance factors * (see the separate "jtreg" tests for a set intended to check these * for the most central aspects of functionality.) So, most tests use * the smallest sensible numbers of threads, collection sizes, etc * needed to check basic conformance.
    • - *

      + * *

    • The test classes currently do not declare inclusion in * any particular package to simplify things for people integrating * them in TCK test suites.
    • - *

      + * *

    • As a convenience, the {@code main} of this class (JSR166TestCase) * runs all JSR166 unit tests.
    • - *

      + * *

    */ public class JSR166TestCase { @@ -255,11 +255,11 @@ public class JSR166TestCase { /** * Extra checks that get done for all test cases. - *

    + * * Triggers test case Assert.failure if any thread assertions have Assert.failed, * by rethrowing, in the test harness thread, any exception recorded * earlier by threadRecordFailure. - *

    + * * Triggers test case Assert.failure if interrupt status is set in the main thread. */ @After diff --git a/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java b/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java index f9b927cf8..4997e3c36 100644 --- a/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java +++ b/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java @@ -38,13 +38,13 @@ import java.util.concurrent.ConcurrentHashMap; * shared map (using ChronicleMap) to maintain shared data across any processes * which use a ProcessInstanceLimiter, and checking on startup and regularly * after whether it is allowed to run. - *

    + * * Typically, you need to specify two things to create an instance of * ProcessInstanceLimiter: a path to a file that will hold the shared map; and a * callback object (an instance implementing ProcessInstanceLimiter.Callback) to * handle the various possible callback messages that the ProcessInstanceLimiter * can generate. - *

    + * * Once you have a ProcessInstanceLimiter instance, you specify a type of * process (any string) which will be limited to up to N processes running at * the same time by calling the setMaxNumberOfProcessesOfType() method. Finally @@ -52,18 +52,18 @@ import java.util.concurrent.ConcurrentHashMap; * startingProcessOfType(X). This last is deliberately not done automatically as * you may wish for one type of process to define limitations on other types of * processes. - *

    + * * The are some convenience methods which allow you to quickly specify a limit * without consideration of the above. For example, if during your application * startup you call ProcessInstanceLimiter.limitTo(2), then you need not call * anything else and you have limited your application to running at most 2 JVM * instances of your application. Under the covers, this call is identical to * the sequence: - *

    + * * ProcessInstanceLimiter limiter = new ProcessInstanceLimiter(); * limiter.setMaxNumberOfProcessesOfType(processType,numProcesses); * limiter.startingProcessOfType(processType); - *

    + * * This: * 1. Creates a shared file called ProcessInstanceLimiter_DEFAULT_SHARED_MAP_ in * the temp directory to hold an instance of ChronicleMap @@ -152,7 +152,7 @@ public class ProcessInstanceLimiter implements Runnable { /** * Convenience method. - *

    + * * Create a ProcessInstanceLimiter instance which is limited to one OS * process instance of the DEFAULT type. This will enforce that any JVM on * the same box which runs the code @@ -168,7 +168,7 @@ public class ProcessInstanceLimiter implements Runnable { /** * Convenience method. - *

    + * * Create a ProcessInstanceLimiter instance which is limited to * "numProcesses" OS process instances of the DEFAULT type. This will * enforce that any JVM on the same box which runs the code @@ -187,7 +187,7 @@ public class ProcessInstanceLimiter implements Runnable { /** * Convenience method. - *

    + * * Create a ProcessInstanceLimiter instance which is limited to * "numProcesses" OS process instances of the "processType" type. This will * enforce that any JVM on the same box which runs the code @@ -519,7 +519,7 @@ public class ProcessInstanceLimiter implements Runnable { /** * The Data object holds an array of timestamps and a maximum number of * processes allowed to be running concurrently - *

    + * * The Timelock field is just for locking the time field */ public static interface Data {