Oracle® Coherence Java API Reference
v3.5.3

E15583-01

com.tangosol.net.cache
Class AbstractBundler.Bundle

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.cache.AbstractBundler.Bundle
Direct Known Subclasses:
AbstractEntryBundler.Bundle, AbstractKeyBundler.Bundle
Enclosing class:
AbstractBundler

protected abstract class AbstractBundler.Bundle
extends Base


Field Summary
static int STATUS_EXCEPTION
          Attempt to bundle encountered and exception; the execution has to be de-optimized and performed by individual threads.
static int STATUS_OPEN
          This Bundle accepting additional items.
static int STATUS_PENDING
          This Bundle is closed for accepting additional items and awaiting for the execution results.
static int STATUS_PROCESSED
          This Bundle is in process of returning the result of execution back to the client.
 
Constructor Summary
protected AbstractBundler.Bundle()
          Default constructor.
 
Method Summary
protected abstract  void ensureResults()
          Obtain results of the bundled requests.
protected  boolean ensureResults(boolean fBurst)
          Obtain results of the bundled requests or ensure that the results have already been retrieved.
protected  java.lang.String formatStatusName(int iStatus)
          Return a human readable name for the specified status value.
protected  int getBundleSize()
          Obtain this bundle size.
protected  boolean isException()
          Check whether or not this bundle is in the "exception" state - bundled execution threw an exception and requests have to be un-bundled.
protected  boolean isMaster()
          Check whether or not this is a "master" Bundle.
protected  boolean isOpen()
          Check whether or not this bundle is open for adding request elements.
protected  boolean isPending()
          Check whether or not this bundle is in the "pending" state - awaiting for the execution results.
protected  boolean isProcessed()
          Check whether or not this bundle is in the "processed" state - ready to return the result of execution back to the client.
protected  boolean releaseThread()
          Release all bundle resources associated with the current thread.
 void resetStatistics()
          Reset statistics for this Bundle.
protected  void setMaster()
          Designate this Bundle as a "master" bundle.
protected  void setStatus(int iStatus)
          Change the status of this Bundle.
 java.lang.String toString()
          Provide a human readable description for the Bundle obect (for debugging).
protected  boolean waitForResults(boolean fFirst)
          Wait until results of bundled requests are retrieved.
 

Field Detail

STATUS_OPEN

public static final int STATUS_OPEN
This Bundle accepting additional items.

See Also:
Constant Field Values

STATUS_PENDING

public static final int STATUS_PENDING
This Bundle is closed for accepting additional items and awaiting for the execution results.

See Also:
Constant Field Values

STATUS_PROCESSED

public static final int STATUS_PROCESSED
This Bundle is in process of returning the result of execution back to the client.

See Also:
Constant Field Values

STATUS_EXCEPTION

public static final int STATUS_EXCEPTION
Attempt to bundle encountered and exception; the execution has to be de-optimized and performed by individual threads.

See Also:
Constant Field Values
Constructor Detail

AbstractBundler.Bundle

protected AbstractBundler.Bundle()
Default constructor.

Method Detail

isOpen

protected boolean isOpen()
Check whether or not this bundle is open for adding request elements.

Returns:
true iff this Bundle is still open

isPending

protected boolean isPending()
Check whether or not this bundle is in the "pending" state - awaiting for the execution results.

Returns:
true iff this Bundle is in the "pending" state

isProcessed

protected boolean isProcessed()
Check whether or not this bundle is in the "processed" state - ready to return the result of execution back to the client.

Returns:
true iff this Bundle is in the "processed" state

isException

protected boolean isException()
Check whether or not this bundle is in the "exception" state - bundled execution threw an exception and requests have to be un-bundled.

Returns:
true iff this Bundle is in the "exception" state

setStatus

protected void setStatus(int iStatus)
Change the status of this Bundle.

Parameters:
iStatus - the new status value

getBundleSize

protected int getBundleSize()
Obtain this bundle size. The return value should be expressed in the same units as the value returned by the getSizeThreshold method.

Returns:
the bundle size

isMaster

protected boolean isMaster()
Check whether or not this is a "master" Bundle.

Returns:
true iff this Bundle is a designated "master" Bundle

setMaster

protected void setMaster()
Designate this Bundle as a "master" bundle.


ensureResults

protected abstract void ensureResults()
Obtain results of the bundled requests. This method should be implemented by concrete Bundle implementations using the most efficient mechanism.


waitForResults

protected boolean waitForResults(boolean fFirst)
Wait until results of bundled requests are retrieved.

Note that calls to this method must be externally synchronized.

Returns:
true if this thread is supposed to perform an actual bundled operation (burst); false otherwise

ensureResults

protected boolean ensureResults(boolean fBurst)
Obtain results of the bundled requests or ensure that the results have already been retrieved.

Parameters:
fBurst - specifies whether or not the actual results have to be fetched on this thread; this parameter will be true for one and only one thread per bundle
Returns:
true if the bundling has succeded; false if the un-bundling has to be performed as a result of a failure

releaseThread

protected boolean releaseThread()
Release all bundle resources associated with the current thread.


resetStatistics

public void resetStatistics()
Reset statistics for this Bundle.


toString

public java.lang.String toString()
Provide a human readable description for the Bundle obect (for debugging).

Returns:
a human readable description for the Bundle obect

formatStatusName

protected java.lang.String formatStatusName(int iStatus)
Return a human readable name for the specified status value.

Returns:
a human readable status name

Oracle® Coherence Java API Reference
v3.5.3

E15583-01

Copyright © 2000, 2010, Oracle. All rights reserved.