class TransitionWatchers extends Object
EntryHandle who's entry is making a
visibility transition this class will find all the
TransitionWatchers who are interested in that
transition. The TransitionWatchers are organized
into groups using TemplateHandle. Each
TemplateHandle aggregates a number of watchers
all interested in the same template.TransitionWatcher| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.ConcurrentMap<String,WatchersForTemplateClass> |
holders
A map from class names to
WatchersForTemplateClass
objects |
private OutriggerServerImpl |
server
The server we are working for
|
| Modifier | Constructor and Description |
|---|---|
private |
TransitionWatchers(boolean checked,
OutriggerServerImpl server) |
(package private) |
TransitionWatchers(OutriggerServerImpl server)
Create a new
TransitionWatchers object
for the specified server. |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
add(TransitionWatcher watcher,
EntryRep template)
Add a
TransitionWatcher to the list
of watchers looking for visibility transitions in
entries that match the specified template. |
(package private) SortedSet<TransitionWatcher> |
allMatches(EntryTransition transition,
long ordinal)
Return a
SortedSet of all the
TransitionWatcher who's isInterested
methods return true when asked about the specified
visibility transition. |
private static boolean |
check(OutriggerServerImpl server) |
(package private) OutriggerServerImpl |
getServer()
Return the
OutriggerServerImpl this
TransitionWatchers object is part of. |
(package private) void |
reap()
Visit each
TransitionWatcher and check to see if
it has expired, removing it if it has. |
private final java.util.concurrent.ConcurrentMap<String,WatchersForTemplateClass> holders
WatchersForTemplateClass
objectsprivate final OutriggerServerImpl server
TransitionWatchers(OutriggerServerImpl server)
TransitionWatchers object
for the specified server.server - The server the new TransitionWatchers
object is working for.NullPointerException - if server is
nullprivate TransitionWatchers(boolean checked,
OutriggerServerImpl server)
private static boolean check(OutriggerServerImpl server) throws NullPointerException
NullPointerExceptionvoid add(TransitionWatcher watcher, EntryRep template)
TransitionWatcher to the list
of watchers looking for visibility transitions in
entries that match the specified template. Associates
a TemplateHandle using
TransitionWatcher.setTemplateHandle method.
This method is thread safe. The watcher added in this call is
guaranteed to be consulted by the next call to
allMatches that starts after this call completes even
if that call is made from another thread. Also, all of
of the assigned values in the calling thread's working
memory will be copied out to main memory as part of the
process of making the passed watcher visible to future
allMatches and findTransitionWatcher calls.
watcher - The TransitionWatcher being added.template - The EntryRep that represents
the template of interest.NullPointerException - if either argument is
null.SortedSet<TransitionWatcher> allMatches(EntryTransition transition, long ordinal)
SortedSet of all the
TransitionWatcher who's isInterested
methods return true when asked about the specified
visibility transition.
This method is thread safe. This call is guaranteed to check unremoved
watchers that were added by add calls that completed
before this call started, even if the calls were made from
different threads. Before the isInterested method
of the first watcher is called the working memory of this thread
will be flushed so any changes made to main memory before
this call started will be visible.
transition - A EntryTransition that
describes the transition and what
entry is transitioning. This method
will assume that transition.getHandle
returns a non-null value.ordinal - The ordinal associated with transition.SortedSet of all the
TransitionWatchers interested in the specified
visibility transition. If none are interested an empty
map will be returned.NullPointerException - if transition is
null.void reap()
TransitionWatcher and check to see if
it has expired, removing it if it has.OutriggerServerImpl getServer()
OutriggerServerImpl this
TransitionWatchers object is part of.OutriggerServerImpl this
TransitionWatchers is part of.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.