class WatchersForTemplateClass extends Object
TemplateHandle
s who's templates
are all of exactly the same class. Unless otherwise noted all
methods are thread safe. This method provides the linkage between
TemplateHandle
s and TransitionWatchers
and for the most part is not visible to the clients of either.Modifier and Type | Field and Description |
---|---|
private FastList<TemplateHandle> |
contents
All the templates we know about
|
private TransitionWatchers |
owner
The object we are inside of
|
Constructor and Description |
---|
WatchersForTemplateClass(TransitionWatchers owner)
Create a new
WatchersForTemplateClass object
associated with the specified TransitionWatchers object. |
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) void |
collectInterested(Set set,
EntryTransition transition,
long ordinal)
Iterate over the watchers associated with
this object calling
isInterested on each
and if it returns true adding the watcher to the
passed set. |
(package private) OutriggerServerImpl |
getServer()
Return the
OutriggerServerImpl this
handle is part of. |
(package private) void |
reap(long now)
Visit each
TransitionWatcher and check to see if
it has expired, removing it if it has. |
private final FastList<TemplateHandle> contents
private final TransitionWatchers owner
WatchersForTemplateClass(TransitionWatchers owner)
WatchersForTemplateClass
object
associated with the specified TransitionWatchers
object.owner
- The TransitionWatchers
that
this object will be a part of.NullPointerException
- if owner
is
null
.void 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.watcher
- The TransitionWatcher
being added.template
- The EntryRep
that represents
the template of interest.NullPointerException
- if either argument is
null
.void collectInterested(Set set, EntryTransition transition, long ordinal)
isInterested
on each
and if it returns true
adding the watcher to the
passed set.set
- The set to accumulate interested watchers
into.transition
- The transition being processed.ordinal
- The ordinal associated with transition
.NullPointerException
- if either argument is null
.OutriggerServerImpl getServer()
OutriggerServerImpl
this
handle is part of.OutriggerServerImpl
this
handle is part of.void reap(long now)
TransitionWatcher
and check to see if
it has expired, removing it if it has. Also reaps the
FastList
associated with this object.now
- an estimate of the current time expressed as
milliseconds since the beginning of the epoch.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.