|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.datasource.SimpleExhibitPipelineFilter
org.hd.d.pg2k.test.dev.SystemVariablesTest.TestVarCacheStage
static final class SystemVariablesTest.TestVarCacheStage
Simple pipeline stage that caches variable values. This can be optionally write-through.
Note that all data operations return null; this class is for var testing purposes only (thus is not public).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hd.d.pg2k.svrCore.datasource.SimpleExhibitPipelineIF |
|---|
SimpleExhibitPipelineIF.PropsKey |
| Field Summary | |
|---|---|
private PipelineVarMgr |
vars
Variable manager. |
| Fields inherited from class org.hd.d.pg2k.svrCore.datasource.SimpleExhibitPipelineFilter |
|---|
source |
| Fields inherited from interface org.hd.d.pg2k.svrCore.datasource.SimpleExhibitPipelineIF |
|---|
MAX_USER_READ_SIZE |
| Constructor Summary | |
|---|---|
SystemVariablesTest.TestVarCacheStage(SimpleExhibitPipelineIF upstream,
boolean writeThrough)
Construct test variable-caching stage. |
|
| Method Summary | |
|---|---|
SimpleVariableValue |
getVariable(SimpleVariableDefinition var)
Get a single variable value; returns null if no such value or wrong type. |
SimpleVariableValue[] |
getVariables(long changedSince)
Get set of variable values altered on or after specified time, or get all values with -1; never null. |
void |
poll(GenProps gp)
Poll periodically (of the order of seconds) to do bg work. |
void |
setVariable(SimpleVariableValue newValue)
Set variable to the given value (the variable name and definition are implicit). |
int |
setVariables(SimpleVariableValue[] newValues)
Update a number of variables at once for efficiency; returns the number of variables set. |
void |
syncVariables(boolean force)
Synchronise variables with upstream values. |
| Methods inherited from class org.hd.d.pg2k.svrCore.datasource.SimpleExhibitPipelineFilter |
|---|
destroy, getAllExhibitImmutableData, getAllExhibitProperties, getEventValue, getEventValues, getGenProps, getGenSecProps, getProperties, getRawFile, getStaticAttr, getThumbnails |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final PipelineVarMgr vars
| Constructor Detail |
|---|
SystemVariablesTest.TestVarCacheStage(SimpleExhibitPipelineIF upstream,
boolean writeThrough)
upstream - upstream stage of pipeline; non-nullwriteThrough - if true, all set operations "write-through"
this cahce stage immediately...| Method Detail |
|---|
public void setVariable(SimpleVariableValue newValue)
throws java.io.IOException,
java.lang.UnsupportedOperationException
SimpleExhibitPipelineFilter
setVariable in interface BasicVarMgrInterfacesetVariable in class SimpleExhibitPipelineFilterjava.io.IOException - in case of I/O difficulty
java.lang.UnsupportedOperationException - if a variable is set that
we could never handle, eg a non-System-ID local variable at
the client end of a tunnel
public int setVariables(SimpleVariableValue[] newValues)
throws java.io.IOException
SimpleExhibitPipelineFilterAn implementation may "fail fast" on the first error/exception, or may attempt to continue and do as much as possible.
An implementation may throw an IllegalArgumentException on attempt to: set a variable with value of wrong type or incompatible definition, set a non-existent or read-only variable (or these may be ignored)
setVariables in interface BasicVarMgrInterfacesetVariables in class SimpleExhibitPipelineFilterjava.io.IOExceptionpublic SimpleVariableValue getVariable(SimpleVariableDefinition var)
SimpleExhibitPipelineFilter
getVariable in interface BasicVarMgrInterfacegetVariable in class SimpleExhibitPipelineFiltervar - definition of variable to fetch; never nullpublic SimpleVariableValue[] getVariables(long changedSince)
SimpleExhibitPipelineFilter
getVariables in interface BasicVarMgrInterfacegetVariables in class SimpleExhibitPipelineFilter
public void syncVariables(boolean force)
throws java.io.IOException
SimpleExhibitPipelineFilterWhen called with force==true, this acts like a full "memory barrier", flushing all write-cached items downstream immediately and afterwards getting the value of all upstream values with getVariables(-1), but may be expensive in terms of CPU or bandwidth, so use sparingly.
When called with force=false, this incrementally flushes outstanding writes and will then fetch all, or only new, values from upstream, so is potentally much less resource-intensive. In particular, this does not propagate the sync() upstream.
In any case, it is rarely the right thing for a casual user to vall this as it may be very expensive.
syncVariables in interface SimpleVariablePipelineIFsyncVariables in class SimpleExhibitPipelineFilterforce - if true, this will force a full write flush,
a full sync upstream,
then full read with getVariables(-1),
to get the effect of a full "barrier";
otherwise, in general, a more incremental and non-propagating
mode is used which still does a write flush but may chose
to do a partial read of "new" upstream values
java.io.IOException - if one is received from upstream
public void poll(GenProps gp)
throws java.io.IOException
SimpleExhibitPipelineFilter
poll in interface SimpleExhibitPipelineIFpoll in class SimpleExhibitPipelineFilterjava.io.IOException - in case of difficulty, but even if a sub-ordinate
call throws IOException the poll() call should make some effort
to do as much of its work as reasonably possible
|
DHD Multimedia Gallery V1.53.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||