org.hd.d.pg2k.test.dev
Class SimpleCacheTest.RawDataAccessMonitor
java.lang.Object
org.hd.d.pg2k.svrCore.datasource.SimpleExhibitPipelineFilter
org.hd.d.pg2k.test.dev.SimpleCacheTest.RawDataAccessMonitor
- All Implemented Interfaces:
- SimpleExhibitPipelineIF, BasicVarMgrInterface, SimpleVariablePipelineIF
- Enclosing class:
- SimpleCacheTest
static final class SimpleCacheTest.RawDataAccessMonitor
- extends SimpleExhibitPipelineFilter
Thread-safe monitor of data-read activity.
An instance of this class can be inserted into a pipeline
to record data-read activity.
This filter stage does not generally impede normal operation,
but simply records the data access pattern for processing.
| Methods inherited from class org.hd.d.pg2k.svrCore.datasource.SimpleExhibitPipelineFilter |
destroy, getAllExhibitImmutableData, getAllExhibitProperties, getEventValue, getEventValues, getGenProps, getGenSecProps, getProperties, getStaticAttr, getThumbnails, getVariable, getVariables, poll, setVariable, setVariables, syncVariables |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
events
private final java.util.List<SimpleCacheTest.RawDataAccessMonitor.GetRawDataEvent> events
- A List of GetRawDataEvent values in the order they occurred.
A Vector is used for thread-safety.
SimpleCacheTest.RawDataAccessMonitor
SimpleCacheTest.RawDataAccessMonitor(SimpleExhibitPipelineIF upstream)
- Construct instance wrapped round upstream source.
- Parameters:
upstream - datasource; never null
getRawFile
public void getRawFile(java.nio.ByteBuffer buf,
Name.ExhibitFull exhibitName,
int position,
boolean dontCache)
throws java.io.IOException
- Read a chunk of the raw exhibit binary into the given buffer.
This passes the request upstream without modification,
but records it in a trace buffer before passing it upstream.
The trace is taken before in case the fulfillment of the request
happens to be vetoed by the data source; it is the requests that
we are interested in here.
- Specified by:
getRawFile in interface SimpleExhibitPipelineIF- Overrides:
getRawFile in class SimpleExhibitPipelineFilter
- Parameters:
buf - the buffer into which to read the data;
must be non-null, in put()able state,
and with remaining capacity of at least the requested number of bytesexhibitName - the full name of the exhibit to read from;
never null and must be syntactically validposition - position/index of first byte in exhibitFile to read;
non-negativedontCache - if true, this is a hint not to attempt to cache this
or displace anything from extant caches for this data
as it maqy for example be precaching or random activity;
by default callers should leave this false to allow cacheing
- Throws:
java.io.IOException - for requests that cannot be fulfilled because of
I/O restrictions or problems, such as link failure or
an upper bound on the length of a request
getEventList
public java.util.List<SimpleCacheTest.RawDataAccessMonitor.GetRawDataEvent> getEventList()
- Retrieve the List of events in order; never null though possibly empty.
This returns a private snapshot of the event list.
Copyright (c) 1996-2009, Damon Hart-Davis. All rights reserved.