| Modifier and Type | Field and Description |
|---|---|
| private final List | adding
List of items in the process of being added. |
| pack-priv volatile boolean | closed
true if the tracked object is closed. |
| pack-priv static final boolean | |
| private final LinkedList | initial
Initial list of items for the tracker. |
| private final Map | tracked
Map of tracked items to customized objects. |
| private int | trackingCount
Modification count. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv < Type of M extends MapMap to hold the tracked items and associated
values. | Returns: The specified map.The map into which to copy the tracked items and associated
values. This map must not be a user provided map so that user code
is not executed while synchronized on this. map)Copy the tracked items and associated values into the specified map. |
| pack-priv S[] | Returns: The specified list if it is large enough to hold the tracked items or a new array large enough to hold the tracked items.An array to contain the tracked items. list)Copy the tracked items into an array. |
| pack-priv abstract T | Returns: Customized object for the tracked item ornull if the
item is not to be tracked.Item to be tracked. item, final R Action related object. related)Call the specific customizer adding method. |
| pack-priv abstract void | customizerModified(final S
Tracked item. item, final R Action related object. related, final T Customized object for the tracked item. object)Call the specific customizer modified method. |
| pack-priv abstract void | customizerRemoved(final S
Tracked item. item, final R Action related object. related, final T Customized object for the tracked item. object)Call the specific customizer removed method. |
| pack-priv T | Returns: The customized object for the specified item.The item to lookup in the map item)Return the customized object for the specified item |
| pack-priv int | Returns: The tracking count for this object.Returns the tracking count for this |
| pack-priv boolean | |
| pack-priv void | |
| pack-priv void | setInitial(S[]
The initial list of items to be tracked. list)null entries
in the list are ignored.Set initial list of items into tracker before events begin to be received. |
| pack-priv int | |
| pack-priv void | track(final S
Item to be tracked. item, final R Action related object. related)Begin to track an item. |
| private void | trackAdding(final S
Item to be tracked. item, final R Action related object. related)Common logic to add an item to the tracker used by track and trackInitial. |
| pack-priv void | |
| pack-priv void | untrack(final S
Item to be untracked. item, final R Action related object. related)Discontinue tracking the item. |
| adding | back to summary |
|---|---|
| private final List<S> adding List of items in the process of being added. This is used to deal with nesting of events. Since events may be synchronously delivered, events can be nested. For example, when processing the adding of a service and the customizer causes the service to be unregistered, notification to the nested call to untrack that the service was unregistered can be made to the track method. Since the ArrayList implementation is not synchronized, all access to this list must be protected by the same synchronized object for thread-safety. | |
| closed | back to summary |
|---|---|
| pack-priv volatile boolean closed true if the tracked object is closed. This field is volatile because it is set by one thread and read by another. | |
| DEBUG | back to summary |
|---|---|
| pack-priv static final boolean DEBUG | |
| initial | back to summary |
|---|---|
| private final LinkedList<S> initial Initial list of items for the tracker. This is used to correctly process the initial items which could be modified before they are tracked. This is necessary since the initial set of tracked items are not "announced" by events and therefore the event which makes the item untracked could be delivered before we track the item. An item must not be in both the initial and adding lists at the same time. An item must be moved from the initial list to the adding list "atomically" before we begin tracking it. Since the LinkedList implementation is not synchronized, all access to this list must be protected by the same synchronized object for thread-safety. | |
| tracked | back to summary |
|---|---|
| private final Map<S, T> tracked Map of tracked items to customized objects. | |
| trackingCount | back to summary |
|---|---|
| private int trackingCount Modification count. This field is initialized to zero and incremented by modified. | |
| AbstractTracked | back to summary |
|---|---|
| pack-priv AbstractTracked() AbstractTracked constructor. | |
| close | back to summary |
|---|---|
| pack-priv void close() Called by the owning Tracker object when it is closed. | |
| copyEntries | back to summary |
|---|---|
| pack-priv <M extends Map Copy the tracked items and associated values into the specified map.
| |
| copyKeys | back to summary |
|---|---|
| pack-priv S[] copyKeys(final S[] list) Copy the tracked items into an array.
| |
| customizerAdding | back to summary |
|---|---|
| pack-priv abstract T customizerAdding(final S item, final R related) Call the specific customizer adding method. This method must not be called while synchronized on this object.
| |
| customizerModified | back to summary |
|---|---|
| pack-priv abstract void customizerModified(final S item, final R related, final T object) Call the specific customizer modified method. This method must not be called while synchronized on this object.
| |
| customizerRemoved | back to summary |
|---|---|
| pack-priv abstract void customizerRemoved(final S item, final R related, final T object) Call the specific customizer removed method. This method must not be called while synchronized on this object.
| |
| getCustomizedObject | back to summary |
|---|---|
| pack-priv T getCustomizedObject(final S item) Return the customized object for the specified item
| |
| getTrackingCount | back to summary |
|---|---|
| pack-priv int getTrackingCount() Returns the tracking count for this
| |
| isEmpty | back to summary |
|---|---|
| pack-priv boolean isEmpty() Returns if the tracker is empty.
| |
| modified | back to summary |
|---|---|
| pack-priv void modified() Increment the modification count. If this method is overridden, the overriding method MUST call this method to increment the tracking count. | |
| setInitial | back to summary |
|---|---|
| pack-priv void setInitial(S[] list) Set initial list of items into tracker before events begin to be received. This method must be called from Tracker's open method while synchronized on this object in the same synchronized block as the add listener call.
| |
| size | back to summary |
|---|---|
| pack-priv int size() Returns the number of tracked items.
| |
| track | back to summary |
|---|---|
| pack-priv void track(final S item, final R related) Begin to track an item.
| |
| trackAdding | back to summary |
|---|---|
| private void trackAdding(final S item, final R related) Common logic to add an item to the tracker used by track and trackInitial. The specified item must have been placed in the adding list before calling this method.
| |
| trackInitial | back to summary |
|---|---|
| pack-priv void trackInitial() Track the initial list of items. This is called after events can begin to be received. This method must be called from Tracker's open method while not synchronized on this object after the add listener call. | |
| untrack | back to summary |
|---|---|
| pack-priv void untrack(final S item, final R related) Discontinue tracking the item.
| |