|
Oracle® OLAP Java API Reference 10g Release 2 (10.2) B14348-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for an object that manages the buffering of data for the Cursor
objects it creates. To create a CursorManager
, call the createCursorManager
method of the DataProvider
you are using and pass it a CursorManagerSpecification
. If the Source
that you used to create the CursorManagerSpecification
has an input, then you must add to an array of Source
objects a Source
that represents that input. Add one Source
to the array for each input Source
and pass that array as the inputSources
parameter of the createCursorManager
method.
For example, in the following code unitCost
is the Source
for an MdmMeasure
, and prodRollup
and calRollup
are Source
objects for the default MdmLevelHierarchy
objects for the products and times dimensions, which are the dimensions of the measure. The dp
object is the DataProvider
. The unitCost
Source
has prodRollup
and calRollup
as inputs. The join
method in the first line produces unitCostByProducts
, which is a Source
that has prodRollup
as an output and still has calRollup
as an input. The second line creates a Source
array that has calRollup
has its only element. The next line creates a CursorManagerSpecification
for unitCostByProducts
, and the last line creates a SpecifiedCursorManager
.
Source unitCostByProducts = unitCost.join(prodRollup); Source[] inputSources = new Source[] {calRollup}; CursorManagerSpecification cmSpec = dp.createCursorManagerSpecification(unitCostByProducts); SpecifiedCursorManager cursorManager = dp.createCursorManager(cmSpec, inputSources);
With the methods of a CursorManager
, you can create a Cursor
, add or remove CursorManagerUpdateListener
objects, or discover whether the CursorManagerSpecification
for the CursorManager
needs to be updated.
A CursorManager
notifies its CursorManagerUpdateListener
objects when a change occurs to its Source
. The Source
for a CursorManager
is the Source
that was passed to the createCursorManagerSpecification
method of the DataProvider
, the result of which was passed to the createCursorManager
method of the DataProvider
that created the CursorManager
.
The only Source
that can change is one returned by the getSource
method of a DynamicDefinition
for a Template
. If the state of the Template
changes, then the Source
that the Template
produces is different than the Source
previously produced. If the Transaction
in which the change occurred is prepared and committed, then the CursorManager
becomes aware that the Source
has changed. The CursorManager
notifies its CursorManagerUpdateListener
objects of the change. An application at any time can also call the isSpecificationUpdateNeeded
method to determine if it needs to update the CursorManagerSpecification
for the CursorManager
in response to changes in the Source
.
You can create more than one Cursor
from the same CursorManager
. Those Cursor
objects share the same data cache. You might want to create two different Cursor
objects if, for example, you want to display different views of the same data, such as a table view and a graph view.
CursorManagerSpecification
Method Summary | |
void |
addCursorManagerUpdateListener(CursorManagerUpdateListener l) Adds a CursorManagerUpdateListener to the CursorManager . |
void |
close() Closes the CursorManager and releases the resources associated with it. |
Cursor |
createCursor() Creates a Cursor whose structure is specified by the CursorManagerSpecification that was used to create the CursorManager . |
Cursor |
createCursor(CursorInput[] cursorInputs) Creates a Cursor whose structure is specified by the CursorManagerSpecification that was used to create the CursorManager . |
int |
getFetchSize() Gets the fetch size for a Cursor created by this CursorManager . |
Source |
getSource() Gets the Source for this CursorManager . |
boolean |
isSpecificationUpdateNeeded() Indicates whether the structure has changed of the Source that was used to create the CursorManagerSpecification for the CursorManager . |
void |
removeCursorManagerUpdateListener(CursorManagerUpdateListener l) Removes a CursorManagerUpdateListener from the list of listeners for the CursorManager . |
void |
setFetchSize(int fetchSize) Specifies the fetch size for Cursor objects created by this CursorManager . |
void |
updateSpecification(CursorInfoSpecification cursorInfoSpec) Replaces the CursorInfoSpecification for this CursorManager with the specified CursorInfoSpecification . |
Method Detail |
public void close()
CursorManager
and releases the resources associated with it. Any Cursor
objects created by the CursorManager
become unusable.public Cursor createCursor()
Cursor
whose structure is specified by the CursorManagerSpecification
that was used to create the CursorManager
.Cursor
.public Cursor createCursor(CursorInput[] cursorInputs)
Cursor
whose structure is specified by the CursorManagerSpecification
that was used to create the CursorManager
. Use this method if the Source
that you used to create the CursorManagerSpecification
has an unmatched input. For each Source
in the inputSources
array that you used to create this CursorManager
, add a CursorInput
that provides a value for that Source
to an array of CursorInput
objects and use that array as the cursorInputs
parameter.cursorInputs
- An array of CursorInput
objects that supply values for the input Source
objects specified in the creation of this CursorManager
.Cursor
.public boolean isSpecificationUpdateNeeded()
Source
that was used to create the CursorManagerSpecification
for the CursorManager
. If the structure of the Source
has changed, then you need to create a new CursorManagerSpecification
for the changed Source
. You can use the new CursorManagerSpecification
to update the specification for the existing CursorManager
or use it to create a new CursorManager
.true
if the structure of the Source
for the CursorManager
has changed or false
if it has not changed.SpecifiedCursorManager
public void addCursorManagerUpdateListener(CursorManagerUpdateListener l)
CursorManagerUpdateListener
to the CursorManager
.l
- The CursorManagerUpdateListener
to add to this CursorManager
.CursorManagerUpdateListener
public void removeCursorManagerUpdateListener(CursorManagerUpdateListener l)
CursorManagerUpdateListener
from the list of listeners for the CursorManager
.l
- The CursorManagerUpdateListener
to remove from the list of listeners.CursorManagerUpdateListener
public Source getSource()
Source
for this CursorManager
.Source
for this CursorManager
.public void updateSpecification(CursorInfoSpecification cursorInfoSpec)
CursorInfoSpecification
for this CursorManager
with the specified CursorInfoSpecification
. When you change the structure of the Source
for a CursorManager
, the CursorInfoSpecification
becomes outdated.
To continue to use this CursorManager
, you must create a new CursorInfoSpecification
, and call this method and pass in the new CursorInfoSpecification
. You can then create new Cursor
objects the CursorManager
.
cursorInfoSpec
- The CursorInfoSpecification
with which to replace the current CursorInfoSpecification
for this CursorManager
.public int getFetchSize()
Cursor
created by this CursorManager
.CursorManager
.public void setFetchSize(int fetchSize)
Cursor
objects created by this CursorManager
.fetchSize
- An integer that is the fetch size you want to specify for Cursor
objects created by this CursorManager
.
|
Oracle® OLAP Java API Reference 10g Release 2 (10.2) B14348-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |