|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPollserver.Run
@ThreadSafe public final class Pollserver.Run
A run of the pollserver.
| Field Summary | |
|---|---|
AtomicReference<Thread> |
constructionThreadA
|
(package private) ReentrantLock |
singleServiceLock
|
| Constructor Summary | |
|---|---|
Pollserver.Run(boolean isSingleThreaded)
Constructs a Run. |
|
| Method Summary | ||
|---|---|---|
Geocode.Table |
geocodeTable()
The relational cache of geocoded residential addresses. |
|
Database |
getOrInitializeDatabase(Database keyDatabase)
Returns an already-initialized instance of the specified keyDatabase. |
|
void |
init_done()
Records that initialization is complete - that no further calls will be made to init_ methods. |
|
|
init_ensureVoterService(File startupConfigurationFile,
Class<S> serviceClass)
Returns a voter service, creating it if necessary and storing it for later retrieval. |
|
void |
init_putVoterService(VoterService service)
Stores a voter service in this run, for later retrieval. |
|
boolean |
isSingleThreaded()
Returns true if this run is restricted to a single client thread; false if multiple client threads are allowed. |
|
VoterService[] |
newVoterServiceArray()
Returns all non-poll voter services provided in this run. |
|
Database |
outputDatabase()
The database for storing the relational parts of the output store, such as mounted voter lists and poll counts. |
|
Pollserver |
pollserver()
The pollserver for this run. |
|
Poll.PollserverScope.Run |
scopePoll()
API for all polls within the scope of this pollserver run. |
|
ReentrantLock |
singleServiceLock()
Returns the thread access lock shared by all services; or null if all services do not share the same lock. |
|
Trustserver |
trustserver()
The trustserver for this pollserver. |
|
UserSettings.Table |
userTable()
The relational store of service preferences and other settings, for the users of this pollserver. |
|
Database |
voterInputDatabase()
The database of voter input for all voter services. |
|
VoterService |
voterService(String name)
Returns a non-poll voter service provided in this run; or null if the name designates no provided non-poll service. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Warning(value="non-API") public final AtomicReference<Thread> constructionThreadA
final ReentrantLock singleServiceLock
| Constructor Detail |
|---|
public Pollserver.Run(boolean isSingleThreaded)
throws IOException,
ScriptException,
SQLException
isSingleThreaded - per isSingleThreaded() -
if false (multi-threaded), the client should call
init_done() after initialization is complete.
IOException
ScriptException
SQLException| Method Detail |
|---|
public void init_done()
@ThreadRestricted(value="constructor")
public <S extends VoterService> S init_ensureVoterService(File startupConfigurationFile,
Class<S> serviceClass)
throws IOException,
ScriptException,
SQLException
startupConfigurationFile - the startup configuration file for the service.serviceClass - the class of the service.
VoterService.NoSuchServiceException - if startupConfigurationFile
does not exist.
IOException
ScriptException
SQLExceptioninit_putVoterService(VoterService),
voterService(String)@ThreadRestricted(value="constructor") public void init_putVoterService(VoterService service)
IllegalStateException - if an instance
of the same service was already stored.voterService(String)@Warning(value="thread restricted object") public Geocode.Table geocodeTable()
Pollserver.ConstructionContext.geocodeDatabase()
public Database getOrInitializeDatabase(Database keyDatabase)
throws ScriptException,
SQLException
keyDatabase - a database (typically uninitialized),
to use as a key in searching for an already
initialized instance of the same database in the cache.
ScriptException
SQLExceptionpublic boolean isSingleThreaded()
public VoterService[] newVoterServiceArray()
voterService(String)@Warning(value="thread restricted object") public Database outputDatabase()
Pollserver.ConstructionContext.outputDatabase()public Pollserver pollserver()
public Poll.PollserverScope.Run scopePoll()
public ReentrantLock singleServiceLock()
VoterService.lock()@Warning(value="thread restricted object") public Trustserver trustserver()
@Warning(value="thread restricted object") public UserSettings.Table userTable()
Pollserver.ConstructionContext.userDatabase()@Warning(value="thread restricted object") public Database voterInputDatabase()
VoterInputTable,
Pollserver.ConstructionContext.voterInputDatabase()
public VoterService voterService(String name)
throws IOException,
ScriptException,
SQLException
name - per VoterService.name().
IOException
ScriptException
SQLExceptionVoterService.isNonPoll(String),
init_ensureVoterService(File,Class),
newVoterServiceArray(),
Poll.PollserverScope.Run.ensurePoll(String)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||