|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectElectoralSubserver.Run
@ThreadSafe public final class ElectoralSubserver.Run
A run of the electoral subserver.
| Field Summary | |
|---|---|
(package private) ReentrantLock |
singleServiceLock
|
| Constructor Summary | |
|---|---|
ElectoralSubserver.Run(boolean isSingleThreaded)
Constructs a Run. |
|
| Method Summary | |
|---|---|
District |
district(String name)
Returns an electoral district that is active in this run. |
List<RegionalElectionNode> |
districtRegionalChildren(String name)
Returns all regional children (election nodes) of a district. |
ElectoralService |
electoralService(String name)
Returns an electoral service provided in this run. |
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. |
void |
init_ensureAllElectoralServices()
Ensures all ElectoralServices of the subserver account (runtime user) are created and stored for later retrieval. |
District |
init_ensureDistrict(String districtConfigurationPath)
Returns an electoral district; creating it, if necessary, and storing it for later retrieval. |
Election |
init_ensureElection(String name)
Returns an election; creating it, if necessary, and storing it for later retrieval. |
ElectoralService |
init_ensureElectoralService(String name,
Class serviceClassExpected)
Returns an electoral service; creating it, if necessary, and storing it for later retrieval. |
RegionalScheme |
init_ensureRegionalScheme(String name)
Returns a regional scheme; creating it, if necessary, and storing it for later retrieval. |
void |
init_putElectoralService(ElectoralService service)
Stores an electoral 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. |
District[] |
newDistrictArray()
Returns all electoral districts that are active in this run. |
ElectoralService[] |
newElectoralServiceArray()
Returns all electoral services provided in this run. |
RegionalScheme |
regionalScheme(String name)
Returns a regional scheme that is active in this run. |
List<District> |
regionalSchemeChildren(String name)
Returns all children (districts) of a regional scheme. |
List<RegionalScheme> |
regionalSchemes()
Returns all regional schemes. |
Register |
register()
The electoral register for this subserver - a shared object (not thread safe). |
ReentrantLock |
singleServiceLock()
Returns the thread access lock shared by all services; or null if all services do not share the same lock. |
ElectoralSubserver |
subserver()
The subserver for this run. |
UserSettings.Table |
userTable()
The relational store of service preferences and other settings, for the users of this subserver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final ReentrantLock singleServiceLock
| Constructor Detail |
|---|
public ElectoralSubserver.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 void init_ensureAllElectoralServices()
throws IOException,
ScriptException,
SQLException
IOException
ScriptException
SQLExceptioninit_ensureElectoralService(String,Class)
@ThreadRestricted(value="constructor")
public District init_ensureDistrict(String districtConfigurationPath)
throws IOException,
ScriptException
districtConfigurationPath - per
District.configurationFile().getPath()
IOException
ScriptExceptiondistrict(String)
@ThreadRestricted(value="constructor")
public Election init_ensureElection(String name)
throws IOException,
ScriptException,
SQLException
IOException
ScriptException
SQLException
@ThreadRestricted(value="constructor")
public ElectoralService init_ensureElectoralService(String name,
Class serviceClassExpected)
throws IOException,
ScriptException,
SQLException
serviceClassExpected - class of service to ensure,
or null to ensure regardless of class
ElectoralSubserver.NoSuchServiceException - if name
does not identify an electoral service configured for the subserver
IOException
ScriptException
SQLExceptioninit_ensureAllElectoralServices(),
init_putElectoralService(ElectoralService),
electoralService(String)
@ThreadRestricted(value="constructor")
public RegionalScheme init_ensureRegionalScheme(String name)
throws IOException,
ScriptException
IOException
ScriptExceptionregionalScheme(String)@ThreadRestricted(value="constructor") public void init_putElectoralService(ElectoralService service)
IllegalStateException - if an instance
of the same service was already storedinit_ensureElectoralService(String,Class),
electoralService(String),
init_ensureAllElectoralServices()public District district(String name)
init_ensureDistrict(String),
newDistrictArray(),
regionalSchemeChildren(String)public List<RegionalElectionNode> districtRegionalChildren(String name)
name - the name of the district
IllegalStateException - if init_done() not already calledelectoralService(String)public ElectoralService electoralService(String name)
name - per ElectoralService.name()districtRegionalChildren(String),
init_ensureElectoralService(String,Class),
init_putElectoralService(ElectoralService),
newElectoralServiceArray()public Geocode.Table geocodeTable()
ElectoralSubserver.ConfigurationContext.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 District[] newDistrictArray()
district(String)public ElectoralService[] newElectoralServiceArray()
electoralService(String)public RegionalScheme regionalScheme(String name)
regionalSchemes(),
init_ensureRegionalScheme(String)public List<District> regionalSchemeChildren(String name)
name - the name of the scheme
IllegalStateException - if init_done() not already calleddistrict(String)public List<RegionalScheme> regionalSchemes()
IllegalStateException - if init_done() not already calledregionalScheme(String)public Register register()
public ReentrantLock singleServiceLock()
ElectoralService.lock()public ElectoralSubserver subserver()
public UserSettings.Table userTable()
ElectoralSubserver.ConfigurationContext.userDatabase()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||